From 1c6059251153d5a84c043c31e12c6d10c7556c28 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Thu, 17 Apr 2025 09:48:44 +0200 Subject: [PATCH] [ts][phaser] Untrack erroneously added phaser-v3 dist folder. --- .../spine-phaser-v3/dist/SpineGameObject.d.ts | 137 - .../spine-phaser-v3/dist/SpineGameObject.js | 300 - .../spine-phaser-v3/dist/SpinePlugin.d.ts | 95 - spine-ts/spine-phaser-v3/dist/SpinePlugin.js | 350 - .../dist/esm/spine-phaser-v3.mjs | 15405 --------------- .../dist/esm/spine-phaser-v3.mjs.map | 7 - .../dist/iife/spine-phaser-v3.js | 15445 ---------------- .../dist/iife/spine-phaser-v3.js.map | 7 - spine-ts/spine-phaser-v3/dist/index.d.ts | 58 - spine-ts/spine-phaser-v3/dist/index.js | 38 - spine-ts/spine-phaser-v3/dist/keys.d.ts | 34 - spine-ts/spine-phaser-v3/dist/keys.js | 35 - spine-ts/spine-phaser-v3/dist/mixins.d.ts | 30 - spine-ts/spine-phaser-v3/dist/mixins.js | 48 - .../spine-phaser-v3/dist/require-shim.d.ts | 32 - spine-ts/spine-phaser-v3/dist/require-shim.js | 39 - 16 files changed, 32060 deletions(-) delete mode 100644 spine-ts/spine-phaser-v3/dist/SpineGameObject.d.ts delete mode 100644 spine-ts/spine-phaser-v3/dist/SpineGameObject.js delete mode 100644 spine-ts/spine-phaser-v3/dist/SpinePlugin.d.ts delete mode 100644 spine-ts/spine-phaser-v3/dist/SpinePlugin.js delete mode 100644 spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs delete mode 100644 spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs.map delete mode 100644 spine-ts/spine-phaser-v3/dist/iife/spine-phaser-v3.js delete mode 100644 spine-ts/spine-phaser-v3/dist/iife/spine-phaser-v3.js.map delete mode 100644 spine-ts/spine-phaser-v3/dist/index.d.ts delete mode 100644 spine-ts/spine-phaser-v3/dist/index.js delete mode 100644 spine-ts/spine-phaser-v3/dist/keys.d.ts delete mode 100644 spine-ts/spine-phaser-v3/dist/keys.js delete mode 100644 spine-ts/spine-phaser-v3/dist/mixins.d.ts delete mode 100644 spine-ts/spine-phaser-v3/dist/mixins.js delete mode 100644 spine-ts/spine-phaser-v3/dist/require-shim.d.ts delete mode 100644 spine-ts/spine-phaser-v3/dist/require-shim.js diff --git a/spine-ts/spine-phaser-v3/dist/SpineGameObject.d.ts b/spine-ts/spine-phaser-v3/dist/SpineGameObject.d.ts deleted file mode 100644 index 676fc086b..000000000 --- a/spine-ts/spine-phaser-v3/dist/SpineGameObject.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -import { SpinePlugin } from "./SpinePlugin.js"; -import { AnimationState, AnimationStateData, Bone, Skeleton } from "@esotericsoftware/spine-core"; -declare class BaseSpineGameObject extends Phaser.GameObjects.GameObject { - constructor(scene: Phaser.Scene, type: string); -} -/** A bounds provider calculates the bounding box for a skeleton, which is then assigned as the size of the SpineGameObject. */ -export interface SpineGameObjectBoundsProvider { - calculateBounds(gameObject: SpineGameObject): { - x: number; - y: number; - width: number; - height: number; - }; -} -/** A bounds provider that calculates the bounding box from the setup pose. */ -export declare class SetupPoseBoundsProvider implements SpineGameObjectBoundsProvider { - private clipping; - /** - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(clipping?: boolean); - calculateBounds(gameObject: SpineGameObject): { - x: number; - y: number; - width: number; - height: number; - }; -} -/** A bounds provider that calculates the bounding box by taking the maximumg bounding box for a combination of skins and specific animation. */ -export declare class SkinsAndAnimationBoundsProvider implements SpineGameObjectBoundsProvider { - private animation; - private skins; - private timeStep; - private clipping; - /** - * @param animation The animation to use for calculating the bounds. If null, the setup pose is used. - * @param skins The skins to use for calculating the bounds. If empty, the default skin is used. - * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation. - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(animation: string | null, skins?: string[], timeStep?: number, clipping?: boolean); - calculateBounds(gameObject: SpineGameObject): { - x: number; - y: number; - width: number; - height: number; - }; -} -declare const SpineGameObject_base: typeof BaseSpineGameObject & import("./mixins.js").Type & import("./mixins.js").Type & import("./mixins.js").Type & import("./mixins.js").Type & import("./mixins.js").Type & import("./mixins.js").Type & import("./mixins.js").Type & import("./mixins.js").Type; -/** - * A SpineGameObject is a Phaser {@link GameObject} that can be added to a Phaser Scene and render a Spine skeleton. - * - * The Spine GameObject is a thin wrapper around a Spine {@link Skeleton}, {@link AnimationState} and {@link AnimationStateData}. It is responsible for: - * - updating the animation state - * - applying the animation state to the skeleton's bones, slots, attachments, and draw order. - * - updating the skeleton's bone world transforms - * - rendering the skeleton - * - * See the {@link SpinePlugin} class for more information on how to create a `SpineGameObject`. - * - * The skeleton, animation state, and animation state data can be accessed via the repsective fields. They can be manually updated via {@link updatePose}. - * - * To modify the bone hierarchy before the world transforms are computed, a callback can be set via the {@link beforeUpdateWorldTransforms} field. - * - * To modify the bone hierarchy after the world transforms are computed, a callback can be set via the {@link afterUpdateWorldTransforms} field. - * - * The class also features methods to convert between the skeleton coordinate system and the Phaser coordinate system. - * - * See {@link skeletonToPhaserWorldCoordinates}, {@link phaserWorldCoordinatesToSkeleton}, and {@link phaserWorldCoordinatesToBoneLocal.} - */ -export declare class SpineGameObject extends SpineGameObject_base { - private plugin; - boundsProvider: SpineGameObjectBoundsProvider; - blendMode: number; - skeleton: Skeleton; - animationStateData: AnimationStateData; - animationState: AnimationState; - beforeUpdateWorldTransforms: (object: SpineGameObject) => void; - afterUpdateWorldTransforms: (object: SpineGameObject) => void; - private premultipliedAlpha; - constructor(scene: Phaser.Scene, plugin: SpinePlugin, x: number, y: number, dataKey: string, atlasKey: string, boundsProvider?: SpineGameObjectBoundsProvider); - updateSize(): void; - /** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */ - skeletonToPhaserWorldCoordinates(point: { - x: number; - y: number; - }): void; - /** Converts a point from the Phaser world coordinate system to the skeleton coordinate system. */ - phaserWorldCoordinatesToSkeleton(point: { - x: number; - y: number; - }): void; - /** Converts a point from the Phaser world coordinate system to the bone's local coordinate system. */ - phaserWorldCoordinatesToBone(point: { - x: number; - y: number; - }, bone: Bone): void; - /** - * Updates the {@link AnimationState}, applies it to the {@link Skeleton}, then updates the world transforms of all bones. - * @param delta The time delta in milliseconds - */ - updatePose(delta: number): void; - preUpdate(time: number, delta: number): void; - preDestroy(): void; - willRender(camera: Phaser.Cameras.Scene2D.Camera): boolean; - renderWebGL(renderer: Phaser.Renderer.WebGL.WebGLRenderer, src: SpineGameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; - renderCanvas(renderer: Phaser.Renderer.Canvas.CanvasRenderer, src: SpineGameObject, camera: Phaser.Cameras.Scene2D.Camera, parentMatrix: Phaser.GameObjects.Components.TransformMatrix): void; -} -export {}; diff --git a/spine-ts/spine-phaser-v3/dist/SpineGameObject.js b/spine-ts/spine-phaser-v3/dist/SpineGameObject.js deleted file mode 100644 index bc52619a0..000000000 --- a/spine-ts/spine-phaser-v3/dist/SpineGameObject.js +++ /dev/null @@ -1,300 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -import { SPINE_GAME_OBJECT_TYPE } from "./keys.js"; -import { ComputedSizeMixin, DepthMixin, FlipMixin, ScrollFactorMixin, TransformMixin, VisibleMixin, AlphaMixin, OriginMixin, } from "./mixins.js"; -import { AnimationState, AnimationStateData, MathUtils, Physics, Skeleton, SkeletonClipping, Skin, } from "@esotericsoftware/spine-core"; -class BaseSpineGameObject extends Phaser.GameObjects.GameObject { - constructor(scene, type) { - super(scene, type); - } -} -/** A bounds provider that calculates the bounding box from the setup pose. */ -export class SetupPoseBoundsProvider { - clipping; - /** - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(clipping = false) { - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton) - return { x: 0, y: 0, width: 0, height: 0 }; - // Make a copy of animation state and skeleton as this might be called while - // the skeleton in the GameObject has already been heavily modified. We can not - // reconstruct that state. - const skeleton = new Skeleton(gameObject.skeleton.data); - skeleton.setToSetupPose(); - skeleton.updateWorldTransform(Physics.update); - const bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : undefined); - return bounds.width == Number.NEGATIVE_INFINITY - ? { x: 0, y: 0, width: 0, height: 0 } - : bounds; - } -} -/** A bounds provider that calculates the bounding box by taking the maximumg bounding box for a combination of skins and specific animation. */ -export class SkinsAndAnimationBoundsProvider { - animation; - skins; - timeStep; - clipping; - /** - * @param animation The animation to use for calculating the bounds. If null, the setup pose is used. - * @param skins The skins to use for calculating the bounds. If empty, the default skin is used. - * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation. - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(animation, skins = [], timeStep = 0.05, clipping = false) { - this.animation = animation; - this.skins = skins; - this.timeStep = timeStep; - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton || !gameObject.animationState) - return { x: 0, y: 0, width: 0, height: 0 }; - // Make a copy of animation state and skeleton as this might be called while - // the skeleton in the GameObject has already been heavily modified. We can not - // reconstruct that state. - const animationState = new AnimationState(gameObject.animationState.data); - const skeleton = new Skeleton(gameObject.skeleton.data); - const clipper = this.clipping ? new SkeletonClipping() : undefined; - const data = skeleton.data; - if (this.skins.length > 0) { - let customSkin = new Skin("custom-skin"); - for (const skinName of this.skins) { - const skin = data.findSkin(skinName); - if (skin == null) - continue; - customSkin.addSkin(skin); - } - skeleton.setSkin(customSkin); - } - skeleton.setToSetupPose(); - const animation = this.animation != null ? data.findAnimation(this.animation) : null; - if (animation == null) { - skeleton.updateWorldTransform(Physics.update); - const bounds = skeleton.getBoundsRect(clipper); - return bounds.width == Number.NEGATIVE_INFINITY - ? { x: 0, y: 0, width: 0, height: 0 } - : bounds; - } - else { - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - animationState.clearTracks(); - animationState.setAnimationWith(0, animation, false); - const steps = Math.max(animation.duration / this.timeStep, 1.0); - for (let i = 0; i < steps; i++) { - const delta = i > 0 ? this.timeStep : 0; - animationState.update(delta); - animationState.apply(skeleton); - skeleton.update(delta); - skeleton.updateWorldTransform(Physics.update); - const bounds = skeleton.getBoundsRect(clipper); - minX = Math.min(minX, bounds.x); - minY = Math.min(minY, bounds.y); - maxX = Math.max(maxX, bounds.x + bounds.width); - maxY = Math.max(maxY, bounds.y + bounds.height); - } - const bounds = { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY, - }; - return bounds.width == Number.NEGATIVE_INFINITY - ? { x: 0, y: 0, width: 0, height: 0 } - : bounds; - } - } -} -/** - * A SpineGameObject is a Phaser {@link GameObject} that can be added to a Phaser Scene and render a Spine skeleton. - * - * The Spine GameObject is a thin wrapper around a Spine {@link Skeleton}, {@link AnimationState} and {@link AnimationStateData}. It is responsible for: - * - updating the animation state - * - applying the animation state to the skeleton's bones, slots, attachments, and draw order. - * - updating the skeleton's bone world transforms - * - rendering the skeleton - * - * See the {@link SpinePlugin} class for more information on how to create a `SpineGameObject`. - * - * The skeleton, animation state, and animation state data can be accessed via the repsective fields. They can be manually updated via {@link updatePose}. - * - * To modify the bone hierarchy before the world transforms are computed, a callback can be set via the {@link beforeUpdateWorldTransforms} field. - * - * To modify the bone hierarchy after the world transforms are computed, a callback can be set via the {@link afterUpdateWorldTransforms} field. - * - * The class also features methods to convert between the skeleton coordinate system and the Phaser coordinate system. - * - * See {@link skeletonToPhaserWorldCoordinates}, {@link phaserWorldCoordinatesToSkeleton}, and {@link phaserWorldCoordinatesToBoneLocal.} - */ -export class SpineGameObject extends DepthMixin(OriginMixin(ComputedSizeMixin(FlipMixin(ScrollFactorMixin(TransformMixin(VisibleMixin(AlphaMixin(BaseSpineGameObject)))))))) { - plugin; - boundsProvider; - blendMode = -1; - skeleton; - animationStateData; - animationState; - beforeUpdateWorldTransforms = () => { }; - afterUpdateWorldTransforms = () => { }; - premultipliedAlpha = false; - constructor(scene, plugin, x, y, dataKey, atlasKey, boundsProvider = new SetupPoseBoundsProvider()) { - super(scene, window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE); - this.plugin = plugin; - this.boundsProvider = boundsProvider; - this.setPosition(x, y); - this.premultipliedAlpha = this.plugin.isAtlasPremultiplied(atlasKey); - this.skeleton = this.plugin.createSkeleton(dataKey, atlasKey); - this.animationStateData = new AnimationStateData(this.skeleton.data); - this.animationState = new AnimationState(this.animationStateData); - this.skeleton.updateWorldTransform(Physics.update); - this.updateSize(); - } - updateSize() { - if (!this.skeleton) - return; - let bounds = this.boundsProvider.calculateBounds(this); - // For some reason the TS compiler and the ComputedSize mixin don't work well together and we have - // to cast to any. - let self = this; - self.width = bounds.width; - self.height = bounds.height; - this.displayOriginX = -bounds.x; - this.displayOriginY = -bounds.y; - } - /** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */ - skeletonToPhaserWorldCoordinates(point) { - let transform = this.getWorldTransformMatrix(); - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - let x = point.x; - let y = point.y; - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - } - /** Converts a point from the Phaser world coordinate system to the skeleton coordinate system. */ - phaserWorldCoordinatesToSkeleton(point) { - let transform = this.getWorldTransformMatrix(); - transform = transform.invert(); - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - let x = point.x; - let y = point.y; - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - } - /** Converts a point from the Phaser world coordinate system to the bone's local coordinate system. */ - phaserWorldCoordinatesToBone(point, bone) { - this.phaserWorldCoordinatesToSkeleton(point); - if (bone.parent) { - bone.parent.worldToLocal(point); - } - else { - bone.worldToLocal(point); - } - } - /** - * Updates the {@link AnimationState}, applies it to the {@link Skeleton}, then updates the world transforms of all bones. - * @param delta The time delta in milliseconds - */ - updatePose(delta) { - this.animationState.update(delta / 1000); - this.animationState.apply(this.skeleton); - this.beforeUpdateWorldTransforms(this); - this.skeleton.update(delta / 1000); - this.skeleton.updateWorldTransform(Physics.update); - this.afterUpdateWorldTransforms(this); - } - preUpdate(time, delta) { - if (!this.skeleton || !this.animationState) - return; - this.updatePose(delta); - } - preDestroy() { - // FIXME tear down any event emitters - } - willRender(camera) { - var GameObjectRenderMask = 0xf; - var result = !this.skeleton || !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && this.cameraFilter & camera.id)); - if (!this.visible) - result = false; - if (!result && this.parentContainer && this.plugin.webGLRenderer) { - var sceneRenderer = this.plugin.webGLRenderer; - if (this.plugin.gl && this.plugin.phaserRenderer instanceof Phaser.Renderer.WebGL.WebGLRenderer && sceneRenderer.batcher.isDrawing) { - sceneRenderer.end(); - this.plugin.phaserRenderer.pipelines.rebind(); - } - } - return result; - } - renderWebGL(renderer, src, camera, parentMatrix) { - if (!this.skeleton || !this.animationState || !this.plugin.webGLRenderer) - return; - let sceneRenderer = this.plugin.webGLRenderer; - if (renderer.newType) { - renderer.pipelines.clear(); - sceneRenderer.begin(); - } - camera.addToRenderList(src); - let transform = Phaser.GameObjects.GetCalcMatrix(src, camera, parentMatrix).calc; - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - sceneRenderer.drawSkeleton(this.skeleton, this.premultipliedAlpha, -1, -1, (vertices, numVertices, stride) => { - for (let i = 0; i < numVertices; i += stride) { - let vx = vertices[i]; - let vy = vertices[i + 1]; - vertices[i] = vx * a + vy * c + tx; - vertices[i + 1] = vx * b + vy * d + ty; - } - }); - if (!renderer.nextTypeMatch) { - sceneRenderer.end(); - renderer.pipelines.rebind(); - } - } - renderCanvas(renderer, src, camera, parentMatrix) { - if (!this.skeleton || !this.animationState || !this.plugin.canvasRenderer) - return; - let context = renderer.currentContext; - let skeletonRenderer = this.plugin.canvasRenderer; - skeletonRenderer.ctx = context; - camera.addToRenderList(src); - let transform = Phaser.GameObjects.GetCalcMatrix(src, camera, parentMatrix).calc; - let skeleton = this.skeleton; - skeleton.x = transform.tx; - skeleton.y = transform.ty; - skeleton.scaleX = transform.scaleX; - skeleton.scaleY = transform.scaleY; - let root = skeleton.getRootBone(); - root.rotation = -MathUtils.radiansToDegrees * transform.rotationNormalized; - this.skeleton.updateWorldTransform(Physics.update); - context.save(); - skeletonRenderer.draw(skeleton); - context.restore(); - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3BpbmVHYW1lT2JqZWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL1NwaW5lR2FtZU9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ldG9uUmVuZGVyZXIgPSB0aGlzLnBsdWdpbi5jYW52YXNSZW5kZXJlcjtcblx0XHQoc2tlbGV0b25SZW5kZXJlciBhcyBhbnkpLmN0eCA9IGNvbnRleHQ7XG5cblx0XHRjYW1lcmEuYWRkVG9SZW5kZXJMaXN0KHNyYyk7XG5cdFx0bGV0IHRyYW5zZm9ybSA9IFBoYXNlci5HYW1lT2JqZWN0cy5HZXRDYWxjTWF0cml4KFxuXHRcdFx0c3JjLFxuXHRcdFx0Y2FtZXJhLFxuXHRcdFx0cGFyZW50TWF0cml4XG5cdFx0KS5jYWxjO1xuXHRcdGxldCBza2VsZXRvbiA9IHRoaXMuc2tlbGV0b247XG5cdFx0c2tlbGV0b24ueCA9IHRyYW5zZm9ybS50eDtcblx0XHRza2VsZXRvbi55ID0gdHJhbnNmb3JtLnR5O1xuXHRcdHNrZWxldG9uLnNjYWxlWCA9IHRyYW5zZm9ybS5zY2FsZVg7XG5cdFx0c2tlbGV0b24uc2NhbGVZID0gdHJhbnNmb3JtLnNjYWxlWTtcblx0XHRsZXQgcm9vdCA9IHNrZWxldG9uLmdldFJvb3RCb25lKCkhO1xuXHRcdHJvb3Qucm90YXRpb24gPSAtTWF0aFV0aWxzLnJhZGlhbnNUb0RlZ3JlZXMgKiB0cmFuc2Zvcm0ucm90YXRpb25Ob3JtYWxpemVkO1xuXHRcdHRoaXMuc2tlbGV0b24udXBkYXRlV29ybGRUcmFuc2Zvcm0oUGh5c2ljcy51cGRhdGUpO1xuXG5cdFx0Y29udGV4dC5zYXZlKCk7XG5cdFx0c2tlbGV0b25SZW5kZXJlci5kcmF3KHNrZWxldG9uKTtcblx0XHRjb250ZXh0LnJlc3RvcmUoKTtcblx0fVxufVxuIl19 \ No newline at end of file diff --git a/spine-ts/spine-phaser-v3/dist/SpinePlugin.d.ts b/spine-ts/spine-phaser-v3/dist/SpinePlugin.d.ts deleted file mode 100644 index 2fff8afd1..000000000 --- a/spine-ts/spine-phaser-v3/dist/SpinePlugin.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -import * as Phaser from "phaser"; -import { SceneRenderer, Skeleton, SkeletonData, TextureAtlas } from "@esotericsoftware/spine-webgl"; -import { SpineGameObjectBoundsProvider } from "./SpineGameObject.js"; -import { SkeletonRenderer } from "@esotericsoftware/spine-canvas"; -/** - * Configuration object used when creating {@link SpineGameObject} instances via a scene's - * {@link GameObjectCreator} (`Scene.make`). - */ -export interface SpineGameObjectConfig extends Phaser.Types.GameObjects.GameObjectConfig { - /** The x-position of the object, optional, default: 0 */ - x?: number; - /** The y-position of the object, optional, default: 0 */ - y?: number; - /** The skeleton data key */ - dataKey: string; - /** The atlas key */ - atlasKey: string; - /** The bounds provider, optional, default: `SetupPoseBoundsProvider` */ - boundsProvider?: SpineGameObjectBoundsProvider; -} -/** - * {@link ScenePlugin} implementation adding Spine Runtime capabilities to a scene. - * - * The scene's {@link LoaderPlugin} (`Scene.load`) gets these additional functions: - * * `spineBinary(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`. - * * `spineJson(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`. - * * `spineAtlas(key: string, url: string, premultipliedAlpha: boolean = true, xhrSettings?: XHRSettingsObject)`: loads a texture atlas `.atlas` file from the `url` as well as its correponding texture atlas page images. - * - * The scene's {@link GameObjectFactory} (`Scene.add`) gets these additional functions: - * * `spine(x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider = SetupPoseBoundsProvider())`: - * creates a new {@link SpineGameObject} from the data and atlas at position `(x, y)`, using the {@link BoundsProvider} to calculate its bounding box. The object is automatically added to the scene. - * - * The scene's {@link GameObjectCreator} (`Scene.make`) gets these additional functions: - * * `spine(config: SpineGameObjectConfig)`: creates a new {@link SpineGameObject} from the given configuration object. - * - * The plugin has additional public methods to work with Spine Runtime core API objects: - * * `getAtlas(atlasKey: string)`: returns the {@link TextureAtlas} instance for the given atlas key. - * * `getSkeletonData(skeletonDataKey: string)`: returns the {@link SkeletonData} instance for the given skeleton data key. - * * `createSkeleton(skeletonDataKey: string, atlasKey: string, premultipliedAlpha: boolean = true)`: creates a new {@link Skeleton} instance from the given skeleton data and atlas key. - * * `isPremultipliedAlpha(atlasKey: string)`: returns `true` if the atlas with the given key has premultiplied alpha. - */ -export declare class SpinePlugin extends Phaser.Plugins.ScenePlugin { - game: Phaser.Game; - private isWebGL; - gl: WebGLRenderingContext | null; - static gameWebGLRenderer: SceneRenderer | null; - get webGLRenderer(): SceneRenderer | null; - canvasRenderer: SkeletonRenderer | null; - phaserRenderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer; - private skeletonDataCache; - private atlasCache; - constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string); - static rendererId: number; - boot(): void; - onResize(): void; - shutdown(): void; - destroy(): void; - gameDestroy(): void; - /** Returns the TextureAtlas instance for the given key */ - getAtlas(atlasKey: string): TextureAtlas; - /** Returns whether the TextureAtlas uses premultiplied alpha */ - isAtlasPremultiplied(atlasKey: string): any; - /** Returns the SkeletonData instance for the given data and atlas key */ - getSkeletonData(dataKey: string, atlasKey: string): SkeletonData; - /** Creates a new Skeleton instance from the data and atlas. */ - createSkeleton(dataKey: string, atlasKey: string): Skeleton; -} diff --git a/spine-ts/spine-phaser-v3/dist/SpinePlugin.js b/spine-ts/spine-phaser-v3/dist/SpinePlugin.js deleted file mode 100644 index 118ee804a..000000000 --- a/spine-ts/spine-phaser-v3/dist/SpinePlugin.js +++ /dev/null @@ -1,350 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -import * as Phaser from "phaser"; -import { SPINE_ATLAS_CACHE_KEY, SPINE_GAME_OBJECT_TYPE, SPINE_SKELETON_DATA_FILE_TYPE, SPINE_ATLAS_FILE_TYPE, SPINE_SKELETON_FILE_CACHE_KEY as SPINE_SKELETON_DATA_CACHE_KEY } from "./keys.js"; -import { AtlasAttachmentLoader, GLTexture, SceneRenderer, Skeleton, SkeletonBinary, SkeletonJson, TextureAtlas } from "@esotericsoftware/spine-webgl"; -import { SpineGameObject } from "./SpineGameObject.js"; -import { CanvasTexture, SkeletonRenderer } from "@esotericsoftware/spine-canvas"; -/** - * {@link ScenePlugin} implementation adding Spine Runtime capabilities to a scene. - * - * The scene's {@link LoaderPlugin} (`Scene.load`) gets these additional functions: - * * `spineBinary(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`. - * * `spineJson(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`. - * * `spineAtlas(key: string, url: string, premultipliedAlpha: boolean = true, xhrSettings?: XHRSettingsObject)`: loads a texture atlas `.atlas` file from the `url` as well as its correponding texture atlas page images. - * - * The scene's {@link GameObjectFactory} (`Scene.add`) gets these additional functions: - * * `spine(x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider = SetupPoseBoundsProvider())`: - * creates a new {@link SpineGameObject} from the data and atlas at position `(x, y)`, using the {@link BoundsProvider} to calculate its bounding box. The object is automatically added to the scene. - * - * The scene's {@link GameObjectCreator} (`Scene.make`) gets these additional functions: - * * `spine(config: SpineGameObjectConfig)`: creates a new {@link SpineGameObject} from the given configuration object. - * - * The plugin has additional public methods to work with Spine Runtime core API objects: - * * `getAtlas(atlasKey: string)`: returns the {@link TextureAtlas} instance for the given atlas key. - * * `getSkeletonData(skeletonDataKey: string)`: returns the {@link SkeletonData} instance for the given skeleton data key. - * * `createSkeleton(skeletonDataKey: string, atlasKey: string, premultipliedAlpha: boolean = true)`: creates a new {@link Skeleton} instance from the given skeleton data and atlas key. - * * `isPremultipliedAlpha(atlasKey: string)`: returns `true` if the atlas with the given key has premultiplied alpha. - */ -export class SpinePlugin extends Phaser.Plugins.ScenePlugin { - game; - isWebGL; - gl; - static gameWebGLRenderer = null; - get webGLRenderer() { - return SpinePlugin.gameWebGLRenderer; - } - canvasRenderer; - phaserRenderer; - skeletonDataCache; - atlasCache; - constructor(scene, pluginManager, pluginKey) { - super(scene, pluginManager, pluginKey); - this.game = pluginManager.game; - this.isWebGL = this.game.config.renderType === 2; - this.gl = this.isWebGL ? this.game.renderer.gl : null; - this.phaserRenderer = this.game.renderer; - this.canvasRenderer = null; - this.skeletonDataCache = this.game.cache.addCustom(SPINE_SKELETON_DATA_CACHE_KEY); - this.atlasCache = this.game.cache.addCustom(SPINE_ATLAS_CACHE_KEY); - let skeletonJsonFileCallback = function (key, url, xhrSettings) { - let file = new SpineSkeletonDataFile(this, key, url, SpineSkeletonDataFileType.json, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineJson", skeletonJsonFileCallback, scene); - let skeletonBinaryFileCallback = function (key, url, xhrSettings) { - let file = new SpineSkeletonDataFile(this, key, url, SpineSkeletonDataFileType.binary, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineBinary", skeletonBinaryFileCallback, scene); - let atlasFileCallback = function (key, url, premultipliedAlpha, xhrSettings) { - let file = new SpineAtlasFile(this, key, url, premultipliedAlpha, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineAtlas", atlasFileCallback, scene); - let addSpineGameObject = function (x, y, dataKey, atlasKey, boundsProvider) { - if (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.clear(); - } - const spinePlugin = this.scene.sys[pluginKey]; - let gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, dataKey, atlasKey, boundsProvider); - this.displayList.add(gameObject); - this.updateList.add(gameObject); - if (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.rebind(); - } - return gameObject; - }; - let makeSpineGameObject = function (config, addToScene = false) { - if (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.clear(); - } - let x = config.x ? config.x : 0; - let y = config.y ? config.y : 0; - let boundsProvider = config.boundsProvider ? config.boundsProvider : undefined; - const spinePlugin = this.scene.sys[pluginKey]; - let gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, config.dataKey, config.atlasKey, boundsProvider); - if (addToScene !== undefined) { - config.add = addToScene; - } - if (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.rebind(); - } - return Phaser.GameObjects.BuildGameObject(this.scene, gameObject, config); - }; - pluginManager.registerGameObject(window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, addSpineGameObject, makeSpineGameObject); - } - static rendererId = 0; - boot() { - Skeleton.yDown = true; - if (this.isWebGL) { - if (!SpinePlugin.gameWebGLRenderer) { - SpinePlugin.gameWebGLRenderer = new SceneRenderer(this.game.renderer.canvas, this.gl, true); - } - this.onResize(); - this.game.scale.on(Phaser.Scale.Events.RESIZE, this.onResize, this); - } - else { - if (!this.canvasRenderer) { - this.canvasRenderer = new SkeletonRenderer(this.scene.sys.context); - } - } - var eventEmitter = this.systems.events; - eventEmitter.once('shutdown', this.shutdown, this); - eventEmitter.once('destroy', this.destroy, this); - this.game.events.once('destroy', this.gameDestroy, this); - } - onResize() { - var phaserRenderer = this.game.renderer; - var sceneRenderer = this.webGLRenderer; - if (phaserRenderer && sceneRenderer) { - var viewportWidth = phaserRenderer.width; - var viewportHeight = phaserRenderer.height; - sceneRenderer.camera.position.x = viewportWidth / 2; - sceneRenderer.camera.position.y = viewportHeight / 2; - sceneRenderer.camera.up.y = -1; - sceneRenderer.camera.direction.z = 1; - sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); - } - } - shutdown() { - this.systems.events.off("shutdown", this.shutdown, this); - if (this.isWebGL) { - this.game.scale.off(Phaser.Scale.Events.RESIZE, this.onResize, this); - } - } - destroy() { - this.shutdown(); - } - gameDestroy() { - this.pluginManager.removeGameObject(window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, true, true); - if (this.webGLRenderer) - this.webGLRenderer.dispose(); - SpinePlugin.gameWebGLRenderer = null; - } - /** Returns the TextureAtlas instance for the given key */ - getAtlas(atlasKey) { - let atlas; - if (this.atlasCache.exists(atlasKey)) { - atlas = this.atlasCache.get(atlasKey); - } - else { - let atlasFile = this.game.cache.text.get(atlasKey); - atlas = new TextureAtlas(atlasFile.data); - if (this.isWebGL) { - let gl = this.gl; - const phaserUnpackPmaValue = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL); - if (phaserUnpackPmaValue) - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - for (let atlasPage of atlas.pages) { - atlasPage.setTexture(new GLTexture(gl, this.game.textures.get(atlasKey + "!" + atlasPage.name).getSourceImage(), false)); - } - if (phaserUnpackPmaValue) - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); - } - else { - for (let atlasPage of atlas.pages) { - atlasPage.setTexture(new CanvasTexture(this.game.textures.get(atlasKey + "!" + atlasPage.name).getSourceImage())); - } - } - this.atlasCache.add(atlasKey, atlas); - } - return atlas; - } - /** Returns whether the TextureAtlas uses premultiplied alpha */ - isAtlasPremultiplied(atlasKey) { - let atlasFile = this.game.cache.text.get(atlasKey); - if (!atlasFile) - return false; - return atlasFile.premultipliedAlpha; - } - /** Returns the SkeletonData instance for the given data and atlas key */ - getSkeletonData(dataKey, atlasKey) { - const atlas = this.getAtlas(atlasKey); - const combinedKey = dataKey + atlasKey; - let skeletonData; - if (this.skeletonDataCache.exists(combinedKey)) { - skeletonData = this.skeletonDataCache.get(combinedKey); - } - else { - if (this.game.cache.json.exists(dataKey)) { - let jsonFile = this.game.cache.json.get(dataKey); - let json = new SkeletonJson(new AtlasAttachmentLoader(atlas)); - skeletonData = json.readSkeletonData(jsonFile); - } - else { - let binaryFile = this.game.cache.binary.get(dataKey); - let binary = new SkeletonBinary(new AtlasAttachmentLoader(atlas)); - skeletonData = binary.readSkeletonData(new Uint8Array(binaryFile)); - } - this.skeletonDataCache.add(combinedKey, skeletonData); - } - return skeletonData; - } - /** Creates a new Skeleton instance from the data and atlas. */ - createSkeleton(dataKey, atlasKey) { - return new Skeleton(this.getSkeletonData(dataKey, atlasKey)); - } -} -var SpineSkeletonDataFileType; -(function (SpineSkeletonDataFileType) { - SpineSkeletonDataFileType[SpineSkeletonDataFileType["json"] = 0] = "json"; - SpineSkeletonDataFileType[SpineSkeletonDataFileType["binary"] = 1] = "binary"; -})(SpineSkeletonDataFileType || (SpineSkeletonDataFileType = {})); -class SpineSkeletonDataFile extends Phaser.Loader.MultiFile { - fileType; - constructor(loader, key, url, fileType, xhrSettings) { - if (typeof key !== "string") { - const config = key; - key = config.key; - url = config.url; - fileType = config.type === "spineJson" ? SpineSkeletonDataFileType.json : SpineSkeletonDataFileType.binary; - xhrSettings = config.xhrSettings; - } - let file = null; - let isJson = fileType == SpineSkeletonDataFileType.json; - if (isJson) { - file = new Phaser.Loader.FileTypes.JSONFile(loader, { - key: key, - url: url, - extension: "json", - xhrSettings: xhrSettings, - }); - } - else { - file = new Phaser.Loader.FileTypes.BinaryFile(loader, { - key: key, - url: url, - extension: "skel", - xhrSettings: xhrSettings, - }); - } - super(loader, SPINE_SKELETON_DATA_FILE_TYPE, key, [file]); - this.fileType = fileType; - } - onFileComplete(file) { - this.pending--; - } - addToCache() { - if (this.isReadyToProcess()) - this.files[0].addToCache(); - } -} -class SpineAtlasFile extends Phaser.Loader.MultiFile { - premultipliedAlpha; - constructor(loader, key, url, premultipliedAlpha, xhrSettings) { - if (typeof key !== "string") { - const config = key; - key = config.key; - url = config.url; - premultipliedAlpha = config.premultipliedAlpha; - xhrSettings = config.xhrSettings; - } - super(loader, SPINE_ATLAS_FILE_TYPE, key, [ - new Phaser.Loader.FileTypes.TextFile(loader, { - key: key, - url: url, - xhrSettings: xhrSettings, - extension: "atlas" - }) - ]); - this.premultipliedAlpha = premultipliedAlpha; - } - onFileComplete(file) { - if (this.files.indexOf(file) != -1) { - this.pending--; - if (file.type == "text") { - var lines = file.data.split(/\r\n|\r|\n/); - let textures = []; - textures.push(lines[0]); - for (var t = 1; t < lines.length; t++) { - var line = lines[t]; - if (line.trim() === '' && t < lines.length - 1) { - line = lines[t + 1]; - textures.push(line); - } - } - let basePath = file.src.match(/^.*\//) ?? ""; - for (var i = 0; i < textures.length; i++) { - var url = basePath + textures[i]; - var key = file.key + "!" + textures[i]; - var image = new Phaser.Loader.FileTypes.ImageFile(this.loader, key, url); - if (!this.loader.keyExists(image)) { - this.addToMultiFile(image); - this.loader.addFile(image); - } - } - } - } - } - addToCache() { - if (this.isReadyToProcess()) { - let textureManager = this.loader.textureManager; - for (let file of this.files) { - if (file.type == "image") { - if (!textureManager.exists(file.key)) { - textureManager.addImage(file.key, file.data); - } - } - else { - this.premultipliedAlpha = this.premultipliedAlpha ?? (file.data.indexOf("pma: true") >= 0 || file.data.indexOf("pma:true") >= 0); - file.data = { - data: file.data, - premultipliedAlpha: this.premultipliedAlpha, - }; - file.addToCache(); - } - } - } - } -} -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU3BpbmVQbHVnaW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvU3BpbmVQbHVnaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsrRUEyQitFO0FBRS9FLE9BQU8sS0FBSyxNQUFNLE1BQU0sUUFBUSxDQUFDO0FBQ2pDLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxzQkFBc0IsRUFBRSw2QkFBNkIsRUFBRSxxQkFBcUIsRUFBRSw2QkFBNkIsSUFBSSw2QkFBNkIsRUFBRSxNQUFNLFdBQVcsQ0FBQztBQUNoTSxPQUFPLEVBQUUscUJBQXFCLEVBQUUsU0FBUyxFQUFFLGFBQWEsRUFBRSxRQUFRLEVBQUUsY0FBYyxFQUFnQixZQUFZLEVBQUUsWUFBWSxFQUFFLE1BQU0sK0JBQStCLENBQUE7QUFDbkssT0FBTyxFQUFFLGVBQWUsRUFBaUMsTUFBTSxzQkFBc0IsQ0FBQztBQUN0RixPQUFPLEVBQUUsYUFBYSxFQUFFLGdCQUFnQixFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFtQmpGOzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQW9CRztBQUNILE1BQU0sT0FBTyxXQUFZLFNBQVEsTUFBTSxDQUFDLE9BQU8sQ0FBQyxXQUFXO0lBQzFELElBQUksQ0FBYztJQUNWLE9BQU8sQ0FBVTtJQUN6QixFQUFF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cdFx0XHRcdH1cblx0XHRcdFx0fVxuXHRcdFx0fVxuXHRcdH1cblx0fVxuXG5cdGFkZFRvQ2FjaGUgKCkge1xuXHRcdGlmICh0aGlzLmlzUmVhZHlUb1Byb2Nlc3MoKSkge1xuXHRcdFx0bGV0IHRleHR1cmVNYW5hZ2VyID0gdGhpcy5sb2FkZXIudGV4dHVyZU1hbmFnZXI7XG5cdFx0XHRmb3IgKGxldCBmaWxlIG9mIHRoaXMuZmlsZXMpIHtcblx0XHRcdFx0aWYgKGZpbGUudHlwZSA9PSBcImltYWdlXCIpIHtcblx0XHRcdFx0XHRpZiAoIXRleHR1cmVNYW5hZ2VyLmV4aXN0cyhmaWxlLmtleSkpIHtcblx0XHRcdFx0XHRcdHRleHR1cmVNYW5hZ2VyLmFkZEltYWdlKGZpbGUua2V5LCBmaWxlLmRhdGEpO1xuXHRcdFx0XHRcdH1cblx0XHRcdFx0fSBlbHNlIHtcblx0XHRcdFx0XHR0aGlzLnByZW11bHRpcGxpZWRBbHBoYSA9IHRoaXMucHJlbXVsdGlwbGllZEFscGhhID8/IChmaWxlLmRhdGEuaW5kZXhPZihcInBtYTogdHJ1ZVwiKSA+PSAwIHx8IGZpbGUuZGF0YS5pbmRleE9mKFwicG1hOnRydWVcIikgPj0gMCk7XG5cdFx0XHRcdFx0ZmlsZS5kYXRhID0ge1xuXHRcdFx0XHRcdFx0ZGF0YTogZmlsZS5kYXRhLFxuXHRcdFx0XHRcdFx0cHJlbXVsdGlwbGllZEFscGhhOiB0aGlzLnByZW11bHRpcGxpZWRBbHBoYSxcblx0XHRcdFx0XHR9O1xuXHRcdFx0XHRcdGZpbGUuYWRkVG9DYWNoZSgpO1xuXHRcdFx0XHR9XG5cdFx0XHR9XG5cdFx0fVxuXHR9XG59XG4iXX0= \ No newline at end of file diff --git a/spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs b/spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs deleted file mode 100644 index 2cbfe4079..000000000 --- a/spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs +++ /dev/null @@ -1,15405 +0,0 @@ -var __defProp = Object.defineProperty; -var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; -var __publicField = (obj, key, value) => { - __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); - return value; -}; - -// spine-phaser-v3/src/require-shim.ts -if (typeof window !== "undefined" && window.Phaser) { - let prevRequire = window.require; - window.require = (x) => { - if (prevRequire) - return prevRequire(x); - else if (x === "Phaser") - return window.Phaser; - }; -} - -// spine-phaser-v3/src/SpinePlugin.ts -import * as Phaser2 from "Phaser"; - -// spine-phaser-v3/src/keys.ts -var SPINE_SKELETON_FILE_CACHE_KEY = "esotericsoftware.spine.skeletonFile.cache"; -var SPINE_ATLAS_CACHE_KEY = "esotericsoftware.spine.atlas.cache"; -var SPINE_SKELETON_DATA_FILE_TYPE = "spineSkeletonData"; -var SPINE_ATLAS_FILE_TYPE = "spineAtlasData"; -var SPINE_GAME_OBJECT_TYPE = "spine"; - -// spine-core/src/Utils.ts -var IntSet = class { - array = new Array(); - add(value) { - let contains = this.contains(value); - this.array[value | 0] = value | 0; - return !contains; - } - contains(value) { - return this.array[value | 0] != void 0; - } - remove(value) { - this.array[value | 0] = void 0; - } - clear() { - this.array.length = 0; - } -}; -var StringSet = class { - entries = {}; - size = 0; - add(value) { - let contains = this.entries[value]; - this.entries[value] = true; - if (!contains) { - this.size++; - return true; - } - return false; - } - addAll(values) { - let oldSize = this.size; - for (var i = 0, n = values.length; i < n; i++) - this.add(values[i]); - return oldSize != this.size; - } - contains(value) { - return this.entries[value]; - } - clear() { - this.entries = {}; - this.size = 0; - } -}; -var _Color = class { - constructor(r = 0, g = 0, b = 0, a = 0) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - set(r, g, b, a) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - return this.clamp(); - } - setFromColor(c) { - this.r = c.r; - this.g = c.g; - this.b = c.b; - this.a = c.a; - return this; - } - setFromString(hex) { - hex = hex.charAt(0) == "#" ? hex.substr(1) : hex; - this.r = parseInt(hex.substr(0, 2), 16) / 255; - this.g = parseInt(hex.substr(2, 2), 16) / 255; - this.b = parseInt(hex.substr(4, 2), 16) / 255; - this.a = hex.length != 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255; - return this; - } - add(r, g, b, a) { - this.r += r; - this.g += g; - this.b += b; - this.a += a; - return this.clamp(); - } - clamp() { - if (this.r < 0) - this.r = 0; - else if (this.r > 1) - this.r = 1; - if (this.g < 0) - this.g = 0; - else if (this.g > 1) - this.g = 1; - if (this.b < 0) - this.b = 0; - else if (this.b > 1) - this.b = 1; - if (this.a < 0) - this.a = 0; - else if (this.a > 1) - this.a = 1; - return this; - } - static rgba8888ToColor(color, value) { - color.r = ((value & 4278190080) >>> 24) / 255; - color.g = ((value & 16711680) >>> 16) / 255; - color.b = ((value & 65280) >>> 8) / 255; - color.a = (value & 255) / 255; - } - static rgb888ToColor(color, value) { - color.r = ((value & 16711680) >>> 16) / 255; - color.g = ((value & 65280) >>> 8) / 255; - color.b = (value & 255) / 255; - } - toRgb888() { - const hex = (x) => ("0" + (x * 255).toString(16)).slice(-2); - return Number("0x" + hex(this.r) + hex(this.g) + hex(this.b)); - } - static fromString(hex) { - return new _Color().setFromString(hex); - } -}; -var Color = _Color; -__publicField(Color, "WHITE", new _Color(1, 1, 1, 1)); -__publicField(Color, "RED", new _Color(1, 0, 0, 1)); -__publicField(Color, "GREEN", new _Color(0, 1, 0, 1)); -__publicField(Color, "BLUE", new _Color(0, 0, 1, 1)); -__publicField(Color, "MAGENTA", new _Color(1, 0, 1, 1)); -var _MathUtils = class { - static clamp(value, min, max) { - if (value < min) - return min; - if (value > max) - return max; - return value; - } - static cosDeg(degrees) { - return Math.cos(degrees * _MathUtils.degRad); - } - static sinDeg(degrees) { - return Math.sin(degrees * _MathUtils.degRad); - } - static atan2Deg(y, x) { - return Math.atan2(y, x) * _MathUtils.degRad; - } - static signum(value) { - return value > 0 ? 1 : value < 0 ? -1 : 0; - } - static toInt(x) { - return x > 0 ? Math.floor(x) : Math.ceil(x); - } - static cbrt(x) { - let y = Math.pow(Math.abs(x), 1 / 3); - return x < 0 ? -y : y; - } - static randomTriangular(min, max) { - return _MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); - } - static randomTriangularWith(min, max, mode) { - let u = Math.random(); - let d = max - min; - if (u <= (mode - min) / d) - return min + Math.sqrt(u * d * (mode - min)); - return max - Math.sqrt((1 - u) * d * (max - mode)); - } - static isPowerOfTwo(value) { - return value && (value & value - 1) === 0; - } -}; -var MathUtils = _MathUtils; -__publicField(MathUtils, "PI", 3.1415927); -__publicField(MathUtils, "PI2", _MathUtils.PI * 2); -__publicField(MathUtils, "invPI2", 1 / _MathUtils.PI2); -__publicField(MathUtils, "radiansToDegrees", 180 / _MathUtils.PI); -__publicField(MathUtils, "radDeg", _MathUtils.radiansToDegrees); -__publicField(MathUtils, "degreesToRadians", _MathUtils.PI / 180); -__publicField(MathUtils, "degRad", _MathUtils.degreesToRadians); -var Interpolation = class { - apply(start, end, a) { - return start + (end - start) * this.applyInternal(a); - } -}; -var Pow = class extends Interpolation { - power = 2; - constructor(power) { - super(); - this.power = power; - } - applyInternal(a) { - if (a <= 0.5) - return Math.pow(a * 2, this.power) / 2; - return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; - } -}; -var PowOut = class extends Pow { - constructor(power) { - super(power); - } - applyInternal(a) { - return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; - } -}; -var _Utils = class { - static arrayCopy(source, sourceStart, dest, destStart, numElements) { - for (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { - dest[j] = source[i]; - } - } - static arrayFill(array, fromIndex, toIndex, value) { - for (let i = fromIndex; i < toIndex; i++) - array[i] = value; - } - static setArraySize(array, size, value = 0) { - let oldSize = array.length; - if (oldSize == size) - return array; - array.length = size; - if (oldSize < size) { - for (let i = oldSize; i < size; i++) - array[i] = value; - } - return array; - } - static ensureArrayCapacity(array, size, value = 0) { - if (array.length >= size) - return array; - return _Utils.setArraySize(array, size, value); - } - static newArray(size, defaultValue) { - let array = new Array(size); - for (let i = 0; i < size; i++) - array[i] = defaultValue; - return array; - } - static newFloatArray(size) { - if (_Utils.SUPPORTS_TYPED_ARRAYS) - return new Float32Array(size); - else { - let array = new Array(size); - for (let i = 0; i < array.length; i++) - array[i] = 0; - return array; - } - } - static newShortArray(size) { - if (_Utils.SUPPORTS_TYPED_ARRAYS) - return new Int16Array(size); - else { - let array = new Array(size); - for (let i = 0; i < array.length; i++) - array[i] = 0; - return array; - } - } - static toFloatArray(array) { - return _Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; - } - static toSinglePrecision(value) { - return _Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; - } - // This function is used to fix WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109 - static webkit602BugfixHelper(alpha, blend) { - } - static contains(array, element, identity = true) { - for (var i = 0; i < array.length; i++) - if (array[i] == element) - return true; - return false; - } - static enumValue(type, name) { - return type[name[0].toUpperCase() + name.slice(1)]; - } -}; -var Utils = _Utils; -__publicField(Utils, "SUPPORTS_TYPED_ARRAYS", typeof Float32Array !== "undefined"); -var DebugUtils = class { - static logBones(skeleton) { - for (let i = 0; i < skeleton.bones.length; i++) { - let bone = skeleton.bones[i]; - console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); - } - } -}; -var Pool = class { - items = new Array(); - instantiator; - constructor(instantiator) { - this.instantiator = instantiator; - } - obtain() { - return this.items.length > 0 ? this.items.pop() : this.instantiator(); - } - free(item) { - if (item.reset) - item.reset(); - this.items.push(item); - } - freeAll(items) { - for (let i = 0; i < items.length; i++) - this.free(items[i]); - } - clear() { - this.items.length = 0; - } -}; -var Vector2 = class { - constructor(x = 0, y = 0) { - this.x = x; - this.y = y; - } - set(x, y) { - this.x = x; - this.y = y; - return this; - } - length() { - let x = this.x; - let y = this.y; - return Math.sqrt(x * x + y * y); - } - normalize() { - let len = this.length(); - if (len != 0) { - this.x /= len; - this.y /= len; - } - return this; - } -}; -var TimeKeeper = class { - maxDelta = 0.064; - framesPerSecond = 0; - delta = 0; - totalTime = 0; - lastTime = Date.now() / 1e3; - frameCount = 0; - frameTime = 0; - update() { - let now = Date.now() / 1e3; - this.delta = now - this.lastTime; - this.frameTime += this.delta; - this.totalTime += this.delta; - if (this.delta > this.maxDelta) - this.delta = this.maxDelta; - this.lastTime = now; - this.frameCount++; - if (this.frameTime > 1) { - this.framesPerSecond = this.frameCount / this.frameTime; - this.frameTime = 0; - this.frameCount = 0; - } - } -}; -var WindowedMean = class { - values; - addedValues = 0; - lastValue = 0; - mean = 0; - dirty = true; - constructor(windowSize = 32) { - this.values = new Array(windowSize); - } - hasEnoughData() { - return this.addedValues >= this.values.length; - } - addValue(value) { - if (this.addedValues < this.values.length) - this.addedValues++; - this.values[this.lastValue++] = value; - if (this.lastValue > this.values.length - 1) - this.lastValue = 0; - this.dirty = true; - } - getMean() { - if (this.hasEnoughData()) { - if (this.dirty) { - let mean = 0; - for (let i = 0; i < this.values.length; i++) - mean += this.values[i]; - this.mean = mean / this.values.length; - this.dirty = false; - } - return this.mean; - } - return 0; - } -}; - -// spine-core/src/attachments/Attachment.ts -var Attachment = class { - name; - constructor(name) { - if (!name) - throw new Error("name cannot be null."); - this.name = name; - } -}; -var _VertexAttachment = class extends Attachment { - /** The unique ID for this attachment. */ - id = _VertexAttachment.nextID++; - /** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting - * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null - * if this attachment has no weights. */ - bones = null; - /** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y` - * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting - * each vertex. */ - vertices = []; - /** The maximum number of world vertex values that can be output by - * {@link #computeWorldVertices()} using the `count` parameter. */ - worldVerticesLength = 0; - /** Timelines for the timeline attachment are also applied to this attachment. - * May be null if no attachment-specific timelines should be applied. */ - timelineAttachment = this; - constructor(name) { - super(name); - } - /** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is - * not empty, it is used to deform the vertices. - * - * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine - * Runtimes Guide. - * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y. - * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`. - * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` * - * `stride` / 2. - * @param offset The `worldVertices` index to begin writing values. - * @param stride The number of `worldVertices` entries between the value pairs written. */ - computeWorldVertices(slot, start, count, worldVertices2, offset, stride) { - count = offset + (count >> 1) * stride; - let skeleton = slot.bone.skeleton; - let deformArray = slot.deform; - let vertices = this.vertices; - let bones = this.bones; - if (!bones) { - if (deformArray.length > 0) - vertices = deformArray; - let bone = slot.bone; - let x = bone.worldX; - let y = bone.worldY; - let a = bone.a, b = bone.b, c = bone.c, d = bone.d; - for (let v2 = start, w = offset; w < count; v2 += 2, w += stride) { - let vx = vertices[v2], vy = vertices[v2 + 1]; - worldVertices2[w] = vx * a + vy * b + x; - worldVertices2[w + 1] = vx * c + vy * d + y; - } - return; - } - let v = 0, skip = 0; - for (let i = 0; i < start; i += 2) { - let n = bones[v]; - v += n + 1; - skip += n; - } - let skeletonBones = skeleton.bones; - if (deformArray.length == 0) { - for (let w = offset, b = skip * 3; w < count; w += stride) { - let wx = 0, wy = 0; - let n = bones[v++]; - n += v; - for (; v < n; v++, b += 3) { - let bone = skeletonBones[bones[v]]; - let vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; - wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; - wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; - } - worldVertices2[w] = wx; - worldVertices2[w + 1] = wy; - } - } else { - let deform = deformArray; - for (let w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { - let wx = 0, wy = 0; - let n = bones[v++]; - n += v; - for (; v < n; v++, b += 3, f += 2) { - let bone = skeletonBones[bones[v]]; - let vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; - wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; - wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; - } - worldVertices2[w] = wx; - worldVertices2[w + 1] = wy; - } - } - } - /** Does not copy id (generated) or name (set on construction). **/ - copyTo(attachment) { - if (this.bones) { - attachment.bones = new Array(this.bones.length); - Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length); - } else - attachment.bones = null; - if (this.vertices) { - attachment.vertices = Utils.newFloatArray(this.vertices.length); - Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length); - } - attachment.worldVerticesLength = this.worldVerticesLength; - attachment.timelineAttachment = this.timelineAttachment; - } -}; -var VertexAttachment = _VertexAttachment; -__publicField(VertexAttachment, "nextID", 0); - -// spine-core/src/attachments/Sequence.ts -var _Sequence = class { - id = _Sequence.nextID(); - regions; - start = 0; - digits = 0; - /** The index of the region to show for the setup pose. */ - setupIndex = 0; - constructor(count) { - this.regions = new Array(count); - } - copy() { - let copy = new _Sequence(this.regions.length); - Utils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length); - copy.start = this.start; - copy.digits = this.digits; - copy.setupIndex = this.setupIndex; - return copy; - } - apply(slot, attachment) { - let index = slot.sequenceIndex; - if (index == -1) - index = this.setupIndex; - if (index >= this.regions.length) - index = this.regions.length - 1; - let region = this.regions[index]; - if (attachment.region != region) { - attachment.region = region; - attachment.updateRegion(); - } - } - getPath(basePath, index) { - let result = basePath; - let frame = (this.start + index).toString(); - for (let i = this.digits - frame.length; i > 0; i--) - result += "0"; - result += frame; - return result; - } - static nextID() { - return _Sequence._nextID++; - } -}; -var Sequence = _Sequence; -__publicField(Sequence, "_nextID", 0); -var SequenceMode = /* @__PURE__ */ ((SequenceMode2) => { - SequenceMode2[SequenceMode2["hold"] = 0] = "hold"; - SequenceMode2[SequenceMode2["once"] = 1] = "once"; - SequenceMode2[SequenceMode2["loop"] = 2] = "loop"; - SequenceMode2[SequenceMode2["pingpong"] = 3] = "pingpong"; - SequenceMode2[SequenceMode2["onceReverse"] = 4] = "onceReverse"; - SequenceMode2[SequenceMode2["loopReverse"] = 5] = "loopReverse"; - SequenceMode2[SequenceMode2["pingpongReverse"] = 6] = "pingpongReverse"; - return SequenceMode2; -})(SequenceMode || {}); -var SequenceModeValues = [ - 0 /* hold */, - 1 /* once */, - 2 /* loop */, - 3 /* pingpong */, - 4 /* onceReverse */, - 5 /* loopReverse */, - 6 /* pingpongReverse */ -]; - -// spine-core/src/Animation.ts -var Animation = class { - /** The animation's name, which is unique across all animations in the skeleton. */ - name; - timelines = []; - timelineIds = new StringSet(); - /** The duration of the animation in seconds, which is the highest time of all keys in the timeline. */ - duration; - constructor(name, timelines, duration) { - if (!name) - throw new Error("name cannot be null."); - this.name = name; - this.setTimelines(timelines); - this.duration = duration; - } - setTimelines(timelines) { - if (!timelines) - throw new Error("timelines cannot be null."); - this.timelines = timelines; - this.timelineIds.clear(); - for (var i = 0; i < timelines.length; i++) - this.timelineIds.addAll(timelines[i].getPropertyIds()); - } - hasTimeline(ids) { - for (let i = 0; i < ids.length; i++) - if (this.timelineIds.contains(ids[i])) - return true; - return false; - } - /** Applies all the animation's timelines to the specified skeleton. - * - * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. - * @param loop If true, the animation repeats after {@link #getDuration()}. - * @param events May be null to ignore fired events. */ - apply(skeleton, lastTime, time, loop, events, alpha, blend, direction) { - if (!skeleton) - throw new Error("skeleton cannot be null."); - if (loop && this.duration != 0) { - time %= this.duration; - if (lastTime > 0) - lastTime %= this.duration; - } - let timelines = this.timelines; - for (let i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); - } -}; -var MixBlend = /* @__PURE__ */ ((MixBlend2) => { - MixBlend2[MixBlend2["setup"] = 0] = "setup"; - MixBlend2[MixBlend2["first"] = 1] = "first"; - MixBlend2[MixBlend2["replace"] = 2] = "replace"; - MixBlend2[MixBlend2["add"] = 3] = "add"; - return MixBlend2; -})(MixBlend || {}); -var MixDirection = /* @__PURE__ */ ((MixDirection2) => { - MixDirection2[MixDirection2["mixIn"] = 0] = "mixIn"; - MixDirection2[MixDirection2["mixOut"] = 1] = "mixOut"; - return MixDirection2; -})(MixDirection || {}); -var Property = { - rotate: 0, - x: 1, - y: 2, - scaleX: 3, - scaleY: 4, - shearX: 5, - shearY: 6, - inherit: 7, - rgb: 8, - alpha: 9, - rgb2: 10, - attachment: 11, - deform: 12, - event: 13, - drawOrder: 14, - ikConstraint: 15, - transformConstraint: 16, - pathConstraintPosition: 17, - pathConstraintSpacing: 18, - pathConstraintMix: 19, - physicsConstraintInertia: 20, - physicsConstraintStrength: 21, - physicsConstraintDamping: 22, - physicsConstraintMass: 23, - physicsConstraintWind: 24, - physicsConstraintGravity: 25, - physicsConstraintMix: 26, - physicsConstraintReset: 27, - sequence: 28 -}; -var Timeline = class { - propertyIds; - frames; - constructor(frameCount, propertyIds) { - this.propertyIds = propertyIds; - this.frames = Utils.newFloatArray(frameCount * this.getFrameEntries()); - } - getPropertyIds() { - return this.propertyIds; - } - getFrameEntries() { - return 1; - } - getFrameCount() { - return this.frames.length / this.getFrameEntries(); - } - getDuration() { - return this.frames[this.frames.length - this.getFrameEntries()]; - } - static search1(frames, time) { - let n = frames.length; - for (let i = 1; i < n; i++) - if (frames[i] > time) - return i - 1; - return n - 1; - } - static search(frames, time, step) { - let n = frames.length; - for (let i = step; i < n; i += step) - if (frames[i] > time) - return i - step; - return n - step; - } -}; -var CurveTimeline = class extends Timeline { - curves; - // type, x, y, ... - constructor(frameCount, bezierCount, propertyIds) { - super(frameCount, propertyIds); - this.curves = Utils.newFloatArray( - frameCount + bezierCount * 18 - /*BEZIER_SIZE*/ - ); - this.curves[frameCount - 1] = 1; - } - /** Sets the specified key frame to linear interpolation. */ - setLinear(frame) { - this.curves[frame] = 0; - } - /** Sets the specified key frame to stepped interpolation. */ - setStepped(frame) { - this.curves[frame] = 1; - } - /** Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger - * than the actual number of Bezier curves. */ - shrink(bezierCount) { - let size = this.getFrameCount() + bezierCount * 18; - if (this.curves.length > size) { - let newCurves = Utils.newFloatArray(size); - Utils.arrayCopy(this.curves, 0, newCurves, 0, size); - this.curves = newCurves; - } - } - /** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than - * one curve per frame. - * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified - * in the constructor), inclusive. - * @param frame Between 0 and frameCount - 1, inclusive. - * @param value The index of the value for this frame that this curve is used for. - * @param time1 The time for the first key. - * @param value1 The value for the first key. - * @param cx1 The time for the first Bezier handle. - * @param cy1 The value for the first Bezier handle. - * @param cx2 The time of the second Bezier handle. - * @param cy2 The value for the second Bezier handle. - * @param time2 The time for the second key. - * @param value2 The value for the second key. */ - setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) { - let curves = this.curves; - let i = this.getFrameCount() + bezier * 18; - if (value == 0) - curves[frame] = 2 + i; - let tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03; - let dddx = ((cx1 - cx2) * 3 - time1 + time2) * 6e-3, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 6e-3; - let ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy; - let dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667; - let x = time1 + dx, y = value1 + dy; - for (let n = i + 18; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dx += ddx; - dy += ddy; - ddx += dddx; - ddy += dddy; - x += dx; - y += dy; - } - } - /** Returns the Bezier interpolated value for the specified time. - * @param frameIndex The index into {@link #getFrames()} for the values of the frame before time. - * @param valueOffset The offset from frameIndex to the value this curve is used for. - * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */ - getBezierValue(time, frameIndex, valueOffset, i) { - let curves = this.curves; - if (curves[i] > time) { - let x2 = this.frames[frameIndex], y2 = this.frames[frameIndex + valueOffset]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - let n = i + 18; - for (i += 2; i < n; i += 2) { - if (curves[i] >= time) { - let x2 = curves[i - 2], y2 = curves[i - 1]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - } - frameIndex += this.getFrameEntries(); - let x = curves[n - 2], y = curves[n - 1]; - return y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y); - } -}; -var CurveTimeline1 = class extends CurveTimeline { - constructor(frameCount, bezierCount, propertyId) { - super(frameCount, bezierCount, [propertyId]); - } - getFrameEntries() { - return 2; - } - /** Sets the time and value for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, value) { - frame <<= 1; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*VALUE*/ - ] = value; - } - /** Returns the interpolated value for the specified time. */ - getCurveValue(time) { - let frames = this.frames; - let i = frames.length - 2; - for (let ii = 2; ii <= i; ii += 2) { - if (frames[ii] > time) { - i = ii - 2; - break; - } - } - let curveType = this.curves[i >> 1]; - switch (curveType) { - case 0: - let before = frames[i], value = frames[ - i + 1 - /*VALUE*/ - ]; - return value + (time - before) / (frames[ - i + 2 - /*ENTRIES*/ - ] - before) * (frames[ - i + 2 + 1 - /*VALUE*/ - ] - value); - case 1: - return frames[ - i + 1 - /*VALUE*/ - ]; - } - return this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - } - getRelativeValue(time, alpha, blend, current, setup) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - let value = this.getCurveValue(time); - switch (blend) { - case 0 /* setup */: - return setup + value * alpha; - case 1 /* first */: - case 2 /* replace */: - value += setup - current; - } - return current + value * alpha; - } - getAbsoluteValue(time, alpha, blend, current, setup) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - let value = this.getCurveValue(time); - if (blend == 0 /* setup */) - return setup + (value - setup) * alpha; - return current + (value - current) * alpha; - } - getAbsoluteValue2(time, alpha, blend, current, setup, value) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - if (blend == 0 /* setup */) - return setup + (value - setup) * alpha; - return current + (value - current) * alpha; - } - getScaleValue(time, alpha, blend, direction, current, setup) { - const frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - let value = this.getCurveValue(time) * setup; - if (alpha == 1) { - if (blend == 3 /* add */) - return current + value - setup; - return value; - } - if (direction == 1 /* mixOut */) { - switch (blend) { - case 0 /* setup */: - return setup + (Math.abs(value) * MathUtils.signum(setup) - setup) * alpha; - case 1 /* first */: - case 2 /* replace */: - return current + (Math.abs(value) * MathUtils.signum(current) - current) * alpha; - } - } else { - let s = 0; - switch (blend) { - case 0 /* setup */: - s = Math.abs(setup) * MathUtils.signum(value); - return s + (value - s) * alpha; - case 1 /* first */: - case 2 /* replace */: - s = Math.abs(current) * MathUtils.signum(value); - return s + (value - s) * alpha; - } - } - return current + (value - setup) * alpha; - } -}; -var CurveTimeline2 = class extends CurveTimeline { - /** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}. - * @param propertyIds Unique identifiers for the properties the timeline modifies. */ - constructor(frameCount, bezierCount, propertyId1, propertyId2) { - super(frameCount, bezierCount, [propertyId1, propertyId2]); - } - getFrameEntries() { - return 3; - } - /** Sets the time and values for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, value1, value2) { - frame *= 3; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*VALUE1*/ - ] = value1; - this.frames[ - frame + 2 - /*VALUE2*/ - ] = value2; - } -}; -var RotateTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.rotate + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.rotation = this.getRelativeValue(time, alpha, blend, bone.rotation, bone.data.rotation); - } -}; -var TranslateTimeline = class extends CurveTimeline2 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super( - frameCount, - bezierCount, - Property.x + "|" + boneIndex, - Property.y + "|" + boneIndex - ); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (!bone.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - bone.x = bone.data.x; - bone.y = bone.data.y; - return; - case 1 /* first */: - bone.x += (bone.data.x - bone.x) * alpha; - bone.y += (bone.data.y - bone.y) * alpha; - } - return; - } - let x = 0, y = 0; - let i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - let t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: - bone.x = bone.data.x + x * alpha; - bone.y = bone.data.y + y * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bone.x += (bone.data.x + x - bone.x) * alpha; - bone.y += (bone.data.y + y - bone.y) * alpha; - break; - case 3 /* add */: - bone.x += x * alpha; - bone.y += y * alpha; - } - } -}; -var TranslateXTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.x + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.x = this.getRelativeValue(time, alpha, blend, bone.x, bone.data.x); - } -}; -var TranslateYTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.y + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.y = this.getRelativeValue(time, alpha, blend, bone.y, bone.data.y); - } -}; -var ScaleTimeline = class extends CurveTimeline2 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super( - frameCount, - bezierCount, - Property.scaleX + "|" + boneIndex, - Property.scaleY + "|" + boneIndex - ); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (!bone.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - bone.scaleX = bone.data.scaleX; - bone.scaleY = bone.data.scaleY; - return; - case 1 /* first */: - bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; - } - return; - } - let x, y; - let i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - let t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - x *= bone.data.scaleX; - y *= bone.data.scaleY; - if (alpha == 1) { - if (blend == 3 /* add */) { - bone.scaleX += x - bone.data.scaleX; - bone.scaleY += y - bone.data.scaleY; - } else { - bone.scaleX = x; - bone.scaleY = y; - } - } else { - let bx = 0, by = 0; - if (direction == 1 /* mixOut */) { - switch (blend) { - case 0 /* setup */: - bx = bone.data.scaleX; - by = bone.data.scaleY; - bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha; - bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bx = bone.scaleX; - by = bone.scaleY; - bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha; - bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha; - break; - case 3 /* add */: - bone.scaleX += (x - bone.data.scaleX) * alpha; - bone.scaleY += (y - bone.data.scaleY) * alpha; - } - } else { - switch (blend) { - case 0 /* setup */: - bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x); - by = Math.abs(bone.data.scaleY) * MathUtils.signum(y); - bone.scaleX = bx + (x - bx) * alpha; - bone.scaleY = by + (y - by) * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bx = Math.abs(bone.scaleX) * MathUtils.signum(x); - by = Math.abs(bone.scaleY) * MathUtils.signum(y); - bone.scaleX = bx + (x - bx) * alpha; - bone.scaleY = by + (y - by) * alpha; - break; - case 3 /* add */: - bone.scaleX += (x - bone.data.scaleX) * alpha; - bone.scaleY += (y - bone.data.scaleY) * alpha; - } - } - } - } -}; -var ScaleXTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.scaleX + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.scaleX = this.getScaleValue(time, alpha, blend, direction, bone.scaleX, bone.data.scaleX); - } -}; -var ScaleYTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.scaleY + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.scaleY, bone.data.scaleY); - } -}; -var ShearTimeline = class extends CurveTimeline2 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super( - frameCount, - bezierCount, - Property.shearX + "|" + boneIndex, - Property.shearY + "|" + boneIndex - ); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (!bone.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - bone.shearX = bone.data.shearX; - bone.shearY = bone.data.shearY; - return; - case 1 /* first */: - bone.shearX += (bone.data.shearX - bone.shearX) * alpha; - bone.shearY += (bone.data.shearY - bone.shearY) * alpha; - } - return; - } - let x = 0, y = 0; - let i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - let t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: - bone.shearX = bone.data.shearX + x * alpha; - bone.shearY = bone.data.shearY + y * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; - bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; - break; - case 3 /* add */: - bone.shearX += x * alpha; - bone.shearY += y * alpha; - } - } -}; -var ShearXTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.shearX + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.shearX = this.getRelativeValue(time, alpha, blend, bone.shearX, bone.data.shearX); - } -}; -var ShearYTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.shearY + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.shearY = this.getRelativeValue(time, alpha, blend, bone.shearY, bone.data.shearY); - } -}; -var InheritTimeline = class extends Timeline { - boneIndex = 0; - constructor(frameCount, boneIndex) { - super(frameCount, [Property.inherit + "|" + boneIndex]); - this.boneIndex = boneIndex; - } - getFrameEntries() { - return 2; - } - /** Sets the transform mode for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, inherit) { - frame *= 2; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*INHERIT*/ - ] = inherit; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (!bone.active) - return; - if (direction == 1 /* mixOut */) { - if (blend == 0 /* setup */) - bone.inherit = bone.data.inherit; - return; - } - let frames = this.frames; - if (time < frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - bone.inherit = bone.data.inherit; - return; - } - bone.inherit = this.frames[ - Timeline.search( - frames, - time, - 2 - /*ENTRIES*/ - ) + 1 - /*INHERIT*/ - ]; - } -}; -var RGBATimeline = class extends CurveTimeline { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, [ - Property.rgb + "|" + slotIndex, - Property.alpha + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - } - getFrameEntries() { - return 5; - } - /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */ - setFrame(frame, time, r, g, b, a) { - frame *= 5; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*A*/ - ] = a; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let frames = this.frames; - let color = slot.color; - if (time < frames[0]) { - let setup = slot.data.color; - switch (blend) { - case 0 /* setup */: - color.setFromColor(setup); - return; - case 1 /* first */: - color.add( - (setup.r - color.r) * alpha, - (setup.g - color.g) * alpha, - (setup.b - color.b) * alpha, - (setup.a - color.a) * alpha - ); - } - return; - } - let r = 0, g = 0, b = 0, a = 0; - let i = Timeline.search( - frames, - time, - 5 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 5 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - let t = (time - before) / (frames[ - i + 5 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 5 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 5 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 5 + 3 - /*B*/ - ] - b) * t; - a += (frames[ - i + 5 + 4 - /*A*/ - ] - a) * t; - break; - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - a = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - } - if (alpha == 1) - color.set(r, g, b, a); - else { - if (blend == 0 /* setup */) - color.setFromColor(slot.data.color); - color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); - } - } -}; -var RGBTimeline = class extends CurveTimeline { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, [ - Property.rgb + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - } - getFrameEntries() { - return 4; - } - /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */ - setFrame(frame, time, r, g, b) { - frame <<= 2; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let frames = this.frames; - let color = slot.color; - if (time < frames[0]) { - let setup = slot.data.color; - switch (blend) { - case 0 /* setup */: - color.r = setup.r; - color.g = setup.g; - color.b = setup.b; - return; - case 1 /* first */: - color.r += (setup.r - color.r) * alpha; - color.g += (setup.g - color.g) * alpha; - color.b += (setup.b - color.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0; - let i = Timeline.search( - frames, - time, - 4 - /*ENTRIES*/ - ); - let curveType = this.curves[i >> 2]; - switch (curveType) { - case 0: - let before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - let t = (time - before) / (frames[ - i + 4 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 4 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 4 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 4 + 3 - /*B*/ - ] - b) * t; - break; - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - } - if (alpha == 1) { - color.r = r; - color.g = g; - color.b = b; - } else { - if (blend == 0 /* setup */) { - let setup = slot.data.color; - color.r = setup.r; - color.g = setup.g; - color.b = setup.b; - } - color.r += (r - color.r) * alpha; - color.g += (g - color.g) * alpha; - color.b += (b - color.b) * alpha; - } - } -}; -var AlphaTimeline = class extends CurveTimeline1 { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, Property.alpha + "|" + slotIndex); - this.slotIndex = slotIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let color = slot.color; - if (time < this.frames[0]) { - let setup = slot.data.color; - switch (blend) { - case 0 /* setup */: - color.a = setup.a; - return; - case 1 /* first */: - color.a += (setup.a - color.a) * alpha; - } - return; - } - let a = this.getCurveValue(time); - if (alpha == 1) - color.a = a; - else { - if (blend == 0 /* setup */) - color.a = slot.data.color.a; - color.a += (a - color.a) * alpha; - } - } -}; -var RGBA2Timeline = class extends CurveTimeline { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, [ - Property.rgb + "|" + slotIndex, - Property.alpha + "|" + slotIndex, - Property.rgb2 + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - } - getFrameEntries() { - return 8; - } - /** Sets the time in seconds, light, and dark colors for the specified key frame. */ - setFrame(frame, time, r, g, b, a, r2, g2, b2) { - frame <<= 3; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*A*/ - ] = a; - this.frames[ - frame + 5 - /*R2*/ - ] = r2; - this.frames[ - frame + 6 - /*G2*/ - ] = g2; - this.frames[ - frame + 7 - /*B2*/ - ] = b2; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let frames = this.frames; - let light = slot.color, dark = slot.darkColor; - if (time < frames[0]) { - let setupLight = slot.data.color, setupDark = slot.data.darkColor; - switch (blend) { - case 0 /* setup */: - light.setFromColor(setupLight); - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - return; - case 1 /* first */: - light.add( - (setupLight.r - light.r) * alpha, - (setupLight.g - light.g) * alpha, - (setupLight.b - light.b) * alpha, - (setupLight.a - light.a) * alpha - ); - dark.r += (setupDark.r - dark.r) * alpha; - dark.g += (setupDark.g - dark.g) * alpha; - dark.b += (setupDark.b - dark.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; - let i = Timeline.search( - frames, - time, - 8 - /*ENTRIES*/ - ); - let curveType = this.curves[i >> 3]; - switch (curveType) { - case 0: - let before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - r2 = frames[ - i + 5 - /*R2*/ - ]; - g2 = frames[ - i + 6 - /*G2*/ - ]; - b2 = frames[ - i + 7 - /*B2*/ - ]; - let t = (time - before) / (frames[ - i + 8 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 8 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 8 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 8 + 3 - /*B*/ - ] - b) * t; - a += (frames[ - i + 8 + 4 - /*A*/ - ] - a) * t; - r2 += (frames[ - i + 8 + 5 - /*R2*/ - ] - r2) * t; - g2 += (frames[ - i + 8 + 6 - /*G2*/ - ] - g2) * t; - b2 += (frames[ - i + 8 + 7 - /*B2*/ - ] - b2) * t; - break; - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - r2 = frames[ - i + 5 - /*R2*/ - ]; - g2 = frames[ - i + 6 - /*G2*/ - ]; - b2 = frames[ - i + 7 - /*B2*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - a = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - r2 = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - g2 = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - b2 = this.getBezierValue( - time, - i, - 7, - curveType + 18 * 6 - 2 - /*BEZIER*/ - ); - } - if (alpha == 1) { - light.set(r, g, b, a); - dark.r = r2; - dark.g = g2; - dark.b = b2; - } else { - if (blend == 0 /* setup */) { - light.setFromColor(slot.data.color); - let setupDark = slot.data.darkColor; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - } - light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); - dark.r += (r2 - dark.r) * alpha; - dark.g += (g2 - dark.g) * alpha; - dark.b += (b2 - dark.b) * alpha; - } - } -}; -var RGB2Timeline = class extends CurveTimeline { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, [ - Property.rgb + "|" + slotIndex, - Property.rgb2 + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - } - getFrameEntries() { - return 7; - } - /** Sets the time in seconds, light, and dark colors for the specified key frame. */ - setFrame(frame, time, r, g, b, r2, g2, b2) { - frame *= 7; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*R2*/ - ] = r2; - this.frames[ - frame + 5 - /*G2*/ - ] = g2; - this.frames[ - frame + 6 - /*B2*/ - ] = b2; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let frames = this.frames; - let light = slot.color, dark = slot.darkColor; - if (time < frames[0]) { - let setupLight = slot.data.color, setupDark = slot.data.darkColor; - switch (blend) { - case 0 /* setup */: - light.r = setupLight.r; - light.g = setupLight.g; - light.b = setupLight.b; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - return; - case 1 /* first */: - light.r += (setupLight.r - light.r) * alpha; - light.g += (setupLight.g - light.g) * alpha; - light.b += (setupLight.b - light.b) * alpha; - dark.r += (setupDark.r - dark.r) * alpha; - dark.g += (setupDark.g - dark.g) * alpha; - dark.b += (setupDark.b - dark.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; - let i = Timeline.search( - frames, - time, - 7 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 7 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - r2 = frames[ - i + 4 - /*R2*/ - ]; - g2 = frames[ - i + 5 - /*G2*/ - ]; - b2 = frames[ - i + 6 - /*B2*/ - ]; - let t = (time - before) / (frames[ - i + 7 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 7 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 7 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 7 + 3 - /*B*/ - ] - b) * t; - r2 += (frames[ - i + 7 + 4 - /*R2*/ - ] - r2) * t; - g2 += (frames[ - i + 7 + 5 - /*G2*/ - ] - g2) * t; - b2 += (frames[ - i + 7 + 6 - /*B2*/ - ] - b2) * t; - break; - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - r2 = frames[ - i + 4 - /*R2*/ - ]; - g2 = frames[ - i + 5 - /*G2*/ - ]; - b2 = frames[ - i + 6 - /*B2*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - r2 = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - g2 = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - b2 = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - } - if (alpha == 1) { - light.r = r; - light.g = g; - light.b = b; - dark.r = r2; - dark.g = g2; - dark.b = b2; - } else { - if (blend == 0 /* setup */) { - let setupLight = slot.data.color, setupDark = slot.data.darkColor; - light.r = setupLight.r; - light.g = setupLight.g; - light.b = setupLight.b; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - } - light.r += (r - light.r) * alpha; - light.g += (g - light.g) * alpha; - light.b += (b - light.b) * alpha; - dark.r += (r2 - dark.r) * alpha; - dark.g += (g2 - dark.g) * alpha; - dark.b += (b2 - dark.b) * alpha; - } - } -}; -var AttachmentTimeline = class extends Timeline { - slotIndex = 0; - /** The attachment name for each key frame. May contain null values to clear the attachment. */ - attachmentNames; - constructor(frameCount, slotIndex) { - super(frameCount, [ - Property.attachment + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - this.attachmentNames = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the attachment name for the specified key frame. */ - setFrame(frame, time, attachmentName) { - this.frames[frame] = time; - this.attachmentNames[frame] = attachmentName; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - if (direction == 1 /* mixOut */) { - if (blend == 0 /* setup */) - this.setAttachment(skeleton, slot, slot.data.attachmentName); - return; - } - if (time < this.frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - this.setAttachment(skeleton, slot, slot.data.attachmentName); - return; - } - this.setAttachment(skeleton, slot, this.attachmentNames[Timeline.search1(this.frames, time)]); - } - setAttachment(skeleton, slot, attachmentName) { - slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); - } -}; -var DeformTimeline = class extends CurveTimeline { - slotIndex = 0; - /** The attachment that will be deformed. */ - attachment; - /** The vertices for each key frame. */ - vertices; - constructor(frameCount, bezierCount, slotIndex, attachment) { - super(frameCount, bezierCount, [ - Property.deform + "|" + slotIndex + "|" + attachment.id - ]); - this.slotIndex = slotIndex; - this.attachment = attachment; - this.vertices = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the vertices for the specified key frame. - * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */ - setFrame(frame, time, vertices) { - this.frames[frame] = time; - this.vertices[frame] = vertices; - } - /** @param value1 Ignored (0 is used for a deform timeline). - * @param value2 Ignored (1 is used for a deform timeline). */ - setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) { - let curves = this.curves; - let i = this.getFrameCount() + bezier * 18; - if (value == 0) - curves[frame] = 2 + i; - let tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06; - let dddx = ((cx1 - cx2) * 3 - time1 + time2) * 6e-3, dddy = (cy1 - cy2 + 0.33333333) * 0.018; - let ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy; - let dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667; - let x = time1 + dx, y = dy; - for (let n = i + 18; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dx += ddx; - dy += ddy; - ddx += dddx; - ddy += dddy; - x += dx; - y += dy; - } - } - getCurvePercent(time, frame) { - let curves = this.curves; - let i = curves[frame]; - switch (i) { - case 0: - let x2 = this.frames[frame]; - return (time - x2) / (this.frames[frame + this.getFrameEntries()] - x2); - case 1: - return 0; - } - i -= 2; - if (curves[i] > time) { - let x2 = this.frames[frame]; - return curves[i + 1] * (time - x2) / (curves[i] - x2); - } - let n = i + 18; - for (i += 2; i < n; i += 2) { - if (curves[i] >= time) { - let x2 = curves[i - 2], y2 = curves[i - 1]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - } - let x = curves[n - 2], y = curves[n - 1]; - return y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x); - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let slotAttachment = slot.getAttachment(); - if (!slotAttachment) - return; - if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != this.attachment) - return; - let deform = slot.deform; - if (deform.length == 0) - blend = 0 /* setup */; - let vertices = this.vertices; - let vertexCount = vertices[0].length; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - deform.length = 0; - return; - case 1 /* first */: - if (alpha == 1) { - deform.length = 0; - return; - } - deform.length = vertexCount; - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (var i = 0; i < vertexCount; i++) - deform[i] += (setupVertices[i] - deform[i]) * alpha; - } else { - alpha = 1 - alpha; - for (var i = 0; i < vertexCount; i++) - deform[i] *= alpha; - } - } - return; - } - deform.length = vertexCount; - if (time >= frames[frames.length - 1]) { - let lastVertices = vertices[frames.length - 1]; - if (alpha == 1) { - if (blend == 3 /* add */) { - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += lastVertices[i2] - setupVertices[i2]; - } else { - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += lastVertices[i2]; - } - } else - Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount); - } else { - switch (blend) { - case 0 /* setup */: { - let vertexAttachment2 = slotAttachment; - if (!vertexAttachment2.bones) { - let setupVertices = vertexAttachment2.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) { - let setup = setupVertices[i2]; - deform[i2] = setup + (lastVertices[i2] - setup) * alpha; - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] = lastVertices[i2] * alpha; - } - break; - } - case 1 /* first */: - case 2 /* replace */: - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += (lastVertices[i2] - deform[i2]) * alpha; - break; - case 3 /* add */: - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += (lastVertices[i2] - setupVertices[i2]) * alpha; - } else { - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += lastVertices[i2] * alpha; - } - } - } - return; - } - let frame = Timeline.search1(frames, time); - let percent = this.getCurvePercent(time, frame); - let prevVertices = vertices[frame]; - let nextVertices = vertices[frame + 1]; - if (alpha == 1) { - if (blend == 3 /* add */) { - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += prev + (nextVertices[i2] - prev) * percent - setupVertices[i2]; - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += prev + (nextVertices[i2] - prev) * percent; - } - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] = prev + (nextVertices[i2] - prev) * percent; - } - } - } else { - switch (blend) { - case 0 /* setup */: { - let vertexAttachment2 = slotAttachment; - if (!vertexAttachment2.bones) { - let setupVertices = vertexAttachment2.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2], setup = setupVertices[i2]; - deform[i2] = setup + (prev + (nextVertices[i2] - prev) * percent - setup) * alpha; - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] = (prev + (nextVertices[i2] - prev) * percent) * alpha; - } - } - break; - } - case 1 /* first */: - case 2 /* replace */: - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += (prev + (nextVertices[i2] - prev) * percent - deform[i2]) * alpha; - } - break; - case 3 /* add */: - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += (prev + (nextVertices[i2] - prev) * percent - setupVertices[i2]) * alpha; - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += (prev + (nextVertices[i2] - prev) * percent) * alpha; - } - } - } - } - } -}; -var _EventTimeline = class extends Timeline { - /** The event for each key frame. */ - events; - constructor(frameCount) { - super(frameCount, _EventTimeline.propertyIds); - this.events = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the event for the specified key frame. */ - setFrame(frame, event) { - this.frames[frame] = event.time; - this.events[frame] = event; - } - /** Fires events for frames > `lastTime` and <= `time`. */ - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - if (!firedEvents) - return; - let frames = this.frames; - let frameCount = this.frames.length; - if (lastTime > time) { - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) - return; - if (time < frames[0]) - return; - let i = 0; - if (lastTime < frames[0]) - i = 0; - else { - i = Timeline.search1(frames, lastTime) + 1; - let frameTime = frames[i]; - while (i > 0) { - if (frames[i - 1] != frameTime) - break; - i--; - } - } - for (; i < frameCount && time >= frames[i]; i++) - firedEvents.push(this.events[i]); - } -}; -var EventTimeline = _EventTimeline; -__publicField(EventTimeline, "propertyIds", ["" + Property.event]); -var _DrawOrderTimeline = class extends Timeline { - /** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */ - drawOrders; - constructor(frameCount) { - super(frameCount, _DrawOrderTimeline.propertyIds); - this.drawOrders = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the draw order for the specified key frame. - * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose - * draw order. */ - setFrame(frame, time, drawOrder) { - this.frames[frame] = time; - this.drawOrders[frame] = drawOrder; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - if (direction == 1 /* mixOut */) { - if (blend == 0 /* setup */) - Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - if (time < this.frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - let idx = Timeline.search1(this.frames, time); - let drawOrderToSetupIndex = this.drawOrders[idx]; - if (!drawOrderToSetupIndex) - Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - else { - let drawOrder = skeleton.drawOrder; - let slots = skeleton.slots; - for (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = slots[drawOrderToSetupIndex[i]]; - } - } -}; -var DrawOrderTimeline = _DrawOrderTimeline; -__publicField(DrawOrderTimeline, "propertyIds", ["" + Property.drawOrder]); -var IkConstraintTimeline = class extends CurveTimeline { - /** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is applied */ - constraintIndex = 0; - constructor(frameCount, bezierCount, ikConstraintIndex) { - super(frameCount, bezierCount, [ - Property.ikConstraint + "|" + ikConstraintIndex - ]); - this.constraintIndex = ikConstraintIndex; - } - getFrameEntries() { - return 6; - } - /** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */ - setFrame(frame, time, mix, softness, bendDirection, compress, stretch) { - frame *= 6; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*MIX*/ - ] = mix; - this.frames[ - frame + 2 - /*SOFTNESS*/ - ] = softness; - this.frames[ - frame + 3 - /*BEND_DIRECTION*/ - ] = bendDirection; - this.frames[ - frame + 4 - /*COMPRESS*/ - ] = compress ? 1 : 0; - this.frames[ - frame + 5 - /*STRETCH*/ - ] = stretch ? 1 : 0; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.ikConstraints[this.constraintIndex]; - if (!constraint.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - constraint.mix = constraint.data.mix; - constraint.softness = constraint.data.softness; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - return; - case 1 /* first */: - constraint.mix += (constraint.data.mix - constraint.mix) * alpha; - constraint.softness += (constraint.data.softness - constraint.softness) * alpha; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - return; - } - let mix = 0, softness = 0; - let i = Timeline.search( - frames, - time, - 6 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 6 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - mix = frames[ - i + 1 - /*MIX*/ - ]; - softness = frames[ - i + 2 - /*SOFTNESS*/ - ]; - let t = (time - before) / (frames[ - i + 6 - /*ENTRIES*/ - ] - before); - mix += (frames[ - i + 6 + 1 - /*MIX*/ - ] - mix) * t; - softness += (frames[ - i + 6 + 2 - /*SOFTNESS*/ - ] - softness) * t; - break; - case 1: - mix = frames[ - i + 1 - /*MIX*/ - ]; - softness = frames[ - i + 2 - /*SOFTNESS*/ - ]; - break; - default: - mix = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - softness = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - if (blend == 0 /* setup */) { - constraint.mix = constraint.data.mix + (mix - constraint.data.mix) * alpha; - constraint.softness = constraint.data.softness + (softness - constraint.data.softness) * alpha; - if (direction == 1 /* mixOut */) { - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } else { - constraint.bendDirection = frames[ - i + 3 - /*BEND_DIRECTION*/ - ]; - constraint.compress = frames[ - i + 4 - /*COMPRESS*/ - ] != 0; - constraint.stretch = frames[ - i + 5 - /*STRETCH*/ - ] != 0; - } - } else { - constraint.mix += (mix - constraint.mix) * alpha; - constraint.softness += (softness - constraint.softness) * alpha; - if (direction == 0 /* mixIn */) { - constraint.bendDirection = frames[ - i + 3 - /*BEND_DIRECTION*/ - ]; - constraint.compress = frames[ - i + 4 - /*COMPRESS*/ - ] != 0; - constraint.stretch = frames[ - i + 5 - /*STRETCH*/ - ] != 0; - } - } - } -}; -var TransformConstraintTimeline = class extends CurveTimeline { - /** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, transformConstraintIndex) { - super(frameCount, bezierCount, [ - Property.transformConstraint + "|" + transformConstraintIndex - ]); - this.constraintIndex = transformConstraintIndex; - } - getFrameEntries() { - return 7; - } - /** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */ - setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY) { - let frames = this.frames; - frame *= 7; - frames[frame] = time; - frames[ - frame + 1 - /*ROTATE*/ - ] = mixRotate; - frames[ - frame + 2 - /*X*/ - ] = mixX; - frames[ - frame + 3 - /*Y*/ - ] = mixY; - frames[ - frame + 4 - /*SCALEX*/ - ] = mixScaleX; - frames[ - frame + 5 - /*SCALEY*/ - ] = mixScaleY; - frames[ - frame + 6 - /*SHEARY*/ - ] = mixShearY; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.transformConstraints[this.constraintIndex]; - if (!constraint.active) - return; - let frames = this.frames; - if (time < frames[0]) { - let data = constraint.data; - switch (blend) { - case 0 /* setup */: - constraint.mixRotate = data.mixRotate; - constraint.mixX = data.mixX; - constraint.mixY = data.mixY; - constraint.mixScaleX = data.mixScaleX; - constraint.mixScaleY = data.mixScaleY; - constraint.mixShearY = data.mixShearY; - return; - case 1 /* first */: - constraint.mixRotate += (data.mixRotate - constraint.mixRotate) * alpha; - constraint.mixX += (data.mixX - constraint.mixX) * alpha; - constraint.mixY += (data.mixY - constraint.mixY) * alpha; - constraint.mixScaleX += (data.mixScaleX - constraint.mixScaleX) * alpha; - constraint.mixScaleY += (data.mixScaleY - constraint.mixScaleY) * alpha; - constraint.mixShearY += (data.mixShearY - constraint.mixShearY) * alpha; - } - return; - } - let rotate, x, y, scaleX, scaleY, shearY; - let i = Timeline.search( - frames, - time, - 7 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 7 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - scaleX = frames[ - i + 4 - /*SCALEX*/ - ]; - scaleY = frames[ - i + 5 - /*SCALEY*/ - ]; - shearY = frames[ - i + 6 - /*SHEARY*/ - ]; - let t = (time - before) / (frames[ - i + 7 - /*ENTRIES*/ - ] - before); - rotate += (frames[ - i + 7 + 1 - /*ROTATE*/ - ] - rotate) * t; - x += (frames[ - i + 7 + 2 - /*X*/ - ] - x) * t; - y += (frames[ - i + 7 + 3 - /*Y*/ - ] - y) * t; - scaleX += (frames[ - i + 7 + 4 - /*SCALEX*/ - ] - scaleX) * t; - scaleY += (frames[ - i + 7 + 5 - /*SCALEY*/ - ] - scaleY) * t; - shearY += (frames[ - i + 7 + 6 - /*SHEARY*/ - ] - shearY) * t; - break; - case 1: - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - scaleX = frames[ - i + 4 - /*SCALEX*/ - ]; - scaleY = frames[ - i + 5 - /*SCALEY*/ - ]; - shearY = frames[ - i + 6 - /*SHEARY*/ - ]; - break; - default: - rotate = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - x = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - scaleX = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - scaleY = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - shearY = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - } - if (blend == 0 /* setup */) { - let data = constraint.data; - constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha; - constraint.mixX = data.mixX + (x - data.mixX) * alpha; - constraint.mixY = data.mixY + (y - data.mixY) * alpha; - constraint.mixScaleX = data.mixScaleX + (scaleX - data.mixScaleX) * alpha; - constraint.mixScaleY = data.mixScaleY + (scaleY - data.mixScaleY) * alpha; - constraint.mixShearY = data.mixShearY + (shearY - data.mixShearY) * alpha; - } else { - constraint.mixRotate += (rotate - constraint.mixRotate) * alpha; - constraint.mixX += (x - constraint.mixX) * alpha; - constraint.mixY += (y - constraint.mixY) * alpha; - constraint.mixScaleX += (scaleX - constraint.mixScaleX) * alpha; - constraint.mixScaleY += (scaleY - constraint.mixScaleY) * alpha; - constraint.mixShearY += (shearY - constraint.mixShearY) * alpha; - } - } -}; -var PathConstraintPositionTimeline = class extends CurveTimeline1 { - /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is - * applied. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, pathConstraintIndex) { - super(frameCount, bezierCount, Property.pathConstraintPosition + "|" + pathConstraintIndex); - this.constraintIndex = pathConstraintIndex; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.pathConstraints[this.constraintIndex]; - if (constraint.active) - constraint.position = this.getAbsoluteValue(time, alpha, blend, constraint.position, constraint.data.position); - } -}; -var PathConstraintSpacingTimeline = class extends CurveTimeline1 { - /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is - * applied. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, pathConstraintIndex) { - super(frameCount, bezierCount, Property.pathConstraintSpacing + "|" + pathConstraintIndex); - this.constraintIndex = pathConstraintIndex; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.pathConstraints[this.constraintIndex]; - if (constraint.active) - constraint.spacing = this.getAbsoluteValue(time, alpha, blend, constraint.spacing, constraint.data.spacing); - } -}; -var PathConstraintMixTimeline = class extends CurveTimeline { - /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is - * applied. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, pathConstraintIndex) { - super(frameCount, bezierCount, [ - Property.pathConstraintMix + "|" + pathConstraintIndex - ]); - this.constraintIndex = pathConstraintIndex; - } - getFrameEntries() { - return 4; - } - setFrame(frame, time, mixRotate, mixX, mixY) { - let frames = this.frames; - frame <<= 2; - frames[frame] = time; - frames[ - frame + 1 - /*ROTATE*/ - ] = mixRotate; - frames[ - frame + 2 - /*X*/ - ] = mixX; - frames[ - frame + 3 - /*Y*/ - ] = mixY; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.pathConstraints[this.constraintIndex]; - if (!constraint.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - constraint.mixRotate = constraint.data.mixRotate; - constraint.mixX = constraint.data.mixX; - constraint.mixY = constraint.data.mixY; - return; - case 1 /* first */: - constraint.mixRotate += (constraint.data.mixRotate - constraint.mixRotate) * alpha; - constraint.mixX += (constraint.data.mixX - constraint.mixX) * alpha; - constraint.mixY += (constraint.data.mixY - constraint.mixY) * alpha; - } - return; - } - let rotate, x, y; - let i = Timeline.search( - frames, - time, - 4 - /*ENTRIES*/ - ); - let curveType = this.curves[i >> 2]; - switch (curveType) { - case 0: - let before = frames[i]; - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - let t = (time - before) / (frames[ - i + 4 - /*ENTRIES*/ - ] - before); - rotate += (frames[ - i + 4 + 1 - /*ROTATE*/ - ] - rotate) * t; - x += (frames[ - i + 4 + 2 - /*X*/ - ] - x) * t; - y += (frames[ - i + 4 + 3 - /*Y*/ - ] - y) * t; - break; - case 1: - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - break; - default: - rotate = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - x = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - } - if (blend == 0 /* setup */) { - let data = constraint.data; - constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha; - constraint.mixX = data.mixX + (x - data.mixX) * alpha; - constraint.mixY = data.mixY + (y - data.mixY) * alpha; - } else { - constraint.mixRotate += (rotate - constraint.mixRotate) * alpha; - constraint.mixX += (x - constraint.mixX) * alpha; - constraint.mixY += (y - constraint.mixY) * alpha; - } - } -}; -var PhysicsConstraintTimeline = class extends CurveTimeline1 { - /** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be changed when this timeline - * is applied, or -1 if all physics constraints in the skeleton will be changed. */ - constraintIndex = 0; - /** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */ - constructor(frameCount, bezierCount, physicsConstraintIndex, property) { - super(frameCount, bezierCount, property + "|" + physicsConstraintIndex); - this.constraintIndex = physicsConstraintIndex; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint; - if (this.constraintIndex == -1) { - const value = time >= this.frames[0] ? this.getCurveValue(time) : 0; - for (const constraint2 of skeleton.physicsConstraints) { - if (constraint2.active && this.global(constraint2.data)) - this.set(constraint2, this.getAbsoluteValue2(time, alpha, blend, this.get(constraint2), this.setup(constraint2), value)); - } - } else { - constraint = skeleton.physicsConstraints[this.constraintIndex]; - if (constraint.active) - this.set(constraint, this.getAbsoluteValue(time, alpha, blend, this.get(constraint), this.setup(constraint))); - } - } -}; -var PhysicsConstraintInertiaTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia); - } - setup(constraint) { - return constraint.data.inertia; - } - get(constraint) { - return constraint.inertia; - } - set(constraint, value) { - constraint.inertia = value; - } - global(constraint) { - return constraint.inertiaGlobal; - } -}; -var PhysicsConstraintStrengthTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength); - } - setup(constraint) { - return constraint.data.strength; - } - get(constraint) { - return constraint.strength; - } - set(constraint, value) { - constraint.strength = value; - } - global(constraint) { - return constraint.strengthGlobal; - } -}; -var PhysicsConstraintDampingTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping); - } - setup(constraint) { - return constraint.data.damping; - } - get(constraint) { - return constraint.damping; - } - set(constraint, value) { - constraint.damping = value; - } - global(constraint) { - return constraint.dampingGlobal; - } -}; -var PhysicsConstraintMassTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass); - } - setup(constraint) { - return 1 / constraint.data.massInverse; - } - get(constraint) { - return 1 / constraint.massInverse; - } - set(constraint, value) { - constraint.massInverse = 1 / value; - } - global(constraint) { - return constraint.massGlobal; - } -}; -var PhysicsConstraintWindTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind); - } - setup(constraint) { - return constraint.data.wind; - } - get(constraint) { - return constraint.wind; - } - set(constraint, value) { - constraint.wind = value; - } - global(constraint) { - return constraint.windGlobal; - } -}; -var PhysicsConstraintGravityTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity); - } - setup(constraint) { - return constraint.data.gravity; - } - get(constraint) { - return constraint.gravity; - } - set(constraint, value) { - constraint.gravity = value; - } - global(constraint) { - return constraint.gravityGlobal; - } -}; -var PhysicsConstraintMixTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix); - } - setup(constraint) { - return constraint.data.mix; - } - get(constraint) { - return constraint.mix; - } - set(constraint, value) { - constraint.mix = value; - } - global(constraint) { - return constraint.mixGlobal; - } -}; -var _PhysicsConstraintResetTimeline = class extends Timeline { - /** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be reset when this timeline is - * applied, or -1 if all physics constraints in the skeleton will be reset. */ - constraintIndex; - /** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */ - constructor(frameCount, physicsConstraintIndex) { - super(frameCount, _PhysicsConstraintResetTimeline.propertyIds); - this.constraintIndex = physicsConstraintIndex; - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time for the specified frame. - * @param frame Between 0 and frameCount, inclusive. */ - setFrame(frame, time) { - this.frames[frame] = time; - } - /** Resets the physics constraint when frames > lastTime and <= time. */ - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint; - if (this.constraintIndex != -1) { - constraint = skeleton.physicsConstraints[this.constraintIndex]; - if (!constraint.active) - return; - } - const frames = this.frames; - if (lastTime > time) { - this.apply(skeleton, lastTime, Number.MAX_VALUE, [], alpha, blend, direction); - lastTime = -1; - } else if (lastTime >= frames[frames.length - 1]) - return; - if (time < frames[0]) - return; - if (lastTime < frames[0] || time >= frames[Timeline.search1(frames, lastTime) + 1]) { - if (constraint != null) - constraint.reset(); - else { - for (const constraint2 of skeleton.physicsConstraints) { - if (constraint2.active) - constraint2.reset(); - } - } - } - } -}; -var PhysicsConstraintResetTimeline = _PhysicsConstraintResetTimeline; -__publicField(PhysicsConstraintResetTimeline, "propertyIds", [Property.physicsConstraintReset.toString()]); -var _SequenceTimeline = class extends Timeline { - slotIndex; - attachment; - constructor(frameCount, slotIndex, attachment) { - super(frameCount, [ - Property.sequence + "|" + slotIndex + "|" + attachment.sequence.id - ]); - this.slotIndex = slotIndex; - this.attachment = attachment; - } - getFrameEntries() { - return _SequenceTimeline.ENTRIES; - } - getSlotIndex() { - return this.slotIndex; - } - getAttachment() { - return this.attachment; - } - /** Sets the time, mode, index, and frame time for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time Seconds between frames. */ - setFrame(frame, time, mode, index, delay) { - let frames = this.frames; - frame *= _SequenceTimeline.ENTRIES; - frames[frame] = time; - frames[frame + _SequenceTimeline.MODE] = mode | index << 4; - frames[frame + _SequenceTimeline.DELAY] = delay; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let slotAttachment = slot.attachment; - let attachment = this.attachment; - if (slotAttachment != attachment) { - if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != attachment) - return; - } - if (direction == 1 /* mixOut */) { - if (blend == 0 /* setup */) - slot.sequenceIndex = -1; - return; - } - let frames = this.frames; - if (time < frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - slot.sequenceIndex = -1; - return; - } - let i = Timeline.search(frames, time, _SequenceTimeline.ENTRIES); - let before = frames[i]; - let modeAndIndex = frames[i + _SequenceTimeline.MODE]; - let delay = frames[i + _SequenceTimeline.DELAY]; - if (!this.attachment.sequence) - return; - let index = modeAndIndex >> 4, count = this.attachment.sequence.regions.length; - let mode = SequenceModeValues[modeAndIndex & 15]; - if (mode != 0 /* hold */) { - index += (time - before) / delay + 1e-5 | 0; - switch (mode) { - case 1 /* once */: - index = Math.min(count - 1, index); - break; - case 2 /* loop */: - index %= count; - break; - case 3 /* pingpong */: { - let n = (count << 1) - 2; - index = n == 0 ? 0 : index % n; - if (index >= count) - index = n - index; - break; - } - case 4 /* onceReverse */: - index = Math.max(count - 1 - index, 0); - break; - case 5 /* loopReverse */: - index = count - 1 - index % count; - break; - case 6 /* pingpongReverse */: { - let n = (count << 1) - 2; - index = n == 0 ? 0 : (index + count - 1) % n; - if (index >= count) - index = n - index; - } - } - } - slot.sequenceIndex = index; - } -}; -var SequenceTimeline = _SequenceTimeline; -__publicField(SequenceTimeline, "ENTRIES", 3); -__publicField(SequenceTimeline, "MODE", 1); -__publicField(SequenceTimeline, "DELAY", 2); - -// spine-core/src/AnimationState.ts -var _AnimationState = class { - static emptyAnimation() { - return _AnimationState._emptyAnimation; - } - /** The AnimationStateData to look up mix durations. */ - data; - /** The list of tracks that currently have animations, which may contain null entries. */ - tracks = new Array(); - /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower - * or faster. Defaults to 1. - * - * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */ - timeScale = 1; - unkeyedState = 0; - events = new Array(); - listeners = new Array(); - queue = new EventQueue(this); - propertyIDs = new StringSet(); - animationsChanged = false; - trackEntryPool = new Pool(() => new TrackEntry()); - constructor(data) { - this.data = data; - } - /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */ - update(delta) { - delta *= this.timeScale; - let tracks = this.tracks; - for (let i = 0, n = tracks.length; i < n; i++) { - let current = tracks[i]; - if (!current) - continue; - current.animationLast = current.nextAnimationLast; - current.trackLast = current.nextTrackLast; - let currentDelta = delta * current.timeScale; - if (current.delay > 0) { - current.delay -= currentDelta; - if (current.delay > 0) - continue; - currentDelta = -current.delay; - current.delay = 0; - } - let next = current.next; - if (next) { - let nextTime = current.trackLast - next.delay; - if (nextTime >= 0) { - next.delay = 0; - next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; - current.trackTime += currentDelta; - this.setCurrent(i, next, true); - while (next.mixingFrom) { - next.mixTime += delta; - next = next.mixingFrom; - } - continue; - } - } else if (current.trackLast >= current.trackEnd && !current.mixingFrom) { - tracks[i] = null; - this.queue.end(current); - this.clearNext(current); - continue; - } - if (current.mixingFrom && this.updateMixingFrom(current, delta)) { - let from = current.mixingFrom; - current.mixingFrom = null; - if (from) - from.mixingTo = null; - while (from) { - this.queue.end(from); - from = from.mixingFrom; - } - } - current.trackTime += currentDelta; - } - this.queue.drain(); - } - /** Returns true when all mixing from entries are complete. */ - updateMixingFrom(to, delta) { - let from = to.mixingFrom; - if (!from) - return true; - let finished = this.updateMixingFrom(from, delta); - from.animationLast = from.nextAnimationLast; - from.trackLast = from.nextTrackLast; - if (to.nextTrackLast != -1 && to.mixTime >= to.mixDuration) { - if (from.totalAlpha == 0 || to.mixDuration == 0) { - to.mixingFrom = from.mixingFrom; - if (from.mixingFrom != null) - from.mixingFrom.mixingTo = to; - to.interruptAlpha = from.interruptAlpha; - this.queue.end(from); - } - return finished; - } - from.trackTime += delta * from.timeScale; - to.mixTime += delta; - return false; - } - /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the - * animation state can be applied to multiple skeletons to pose them identically. - * @returns True if any animations were applied. */ - apply(skeleton) { - if (!skeleton) - throw new Error("skeleton cannot be null."); - if (this.animationsChanged) - this._animationsChanged(); - let events = this.events; - let tracks = this.tracks; - let applied = false; - for (let i2 = 0, n2 = tracks.length; i2 < n2; i2++) { - let current = tracks[i2]; - if (!current || current.delay > 0) - continue; - applied = true; - let blend = i2 == 0 ? 1 /* first */ : current.mixBlend; - let alpha = current.alpha; - if (current.mixingFrom) - alpha *= this.applyMixingFrom(current, skeleton, blend); - else if (current.trackTime >= current.trackEnd && !current.next) - alpha = 0; - let attachments = alpha >= current.alphaAttachmentThreshold; - let animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime; - let applyEvents = events; - if (current.reverse) { - applyTime = current.animation.duration - applyTime; - applyEvents = null; - } - let timelines = current.animation.timelines; - let timelineCount = timelines.length; - if (i2 == 0 && alpha == 1 || blend == 3 /* add */) { - if (i2 == 0) - attachments = true; - for (let ii = 0; ii < timelineCount; ii++) { - Utils.webkit602BugfixHelper(alpha, blend); - var timeline = timelines[ii]; - if (timeline instanceof AttachmentTimeline) - this.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments); - else - timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, 0 /* mixIn */); - } - } else { - let timelineMode = current.timelineMode; - let shortestRotation = current.shortestRotation; - let firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1; - if (firstFrame) - current.timelinesRotation.length = timelineCount << 1; - for (let ii = 0; ii < timelineCount; ii++) { - let timeline2 = timelines[ii]; - let timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : 0 /* setup */; - if (!shortestRotation && timeline2 instanceof RotateTimeline) { - this.applyRotateTimeline(timeline2, skeleton, applyTime, alpha, timelineBlend, current.timelinesRotation, ii << 1, firstFrame); - } else if (timeline2 instanceof AttachmentTimeline) { - this.applyAttachmentTimeline(timeline2, skeleton, applyTime, blend, attachments); - } else { - Utils.webkit602BugfixHelper(alpha, blend); - timeline2.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, 0 /* mixIn */); - } - } - } - this.queueEvents(current, animationTime); - events.length = 0; - current.nextAnimationLast = animationTime; - current.nextTrackLast = current.trackTime; - } - var setupState = this.unkeyedState + SETUP; - var slots = skeleton.slots; - for (var i = 0, n = skeleton.slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.attachmentState == setupState) { - var attachmentName = slot.data.attachmentName; - slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName)); - } - } - this.unkeyedState += 2; - this.queue.drain(); - return applied; - } - applyMixingFrom(to, skeleton, blend) { - let from = to.mixingFrom; - if (from.mixingFrom) - this.applyMixingFrom(from, skeleton, blend); - let mix = 0; - if (to.mixDuration == 0) { - mix = 1; - if (blend == 1 /* first */) - blend = 0 /* setup */; - } else { - mix = to.mixTime / to.mixDuration; - if (mix > 1) - mix = 1; - if (blend != 1 /* first */) - blend = from.mixBlend; - } - let attachments = mix < from.mixAttachmentThreshold, drawOrder = mix < from.mixDrawOrderThreshold; - let timelines = from.animation.timelines; - let timelineCount = timelines.length; - let alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); - let animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime; - let events = null; - if (from.reverse) - applyTime = from.animation.duration - applyTime; - else if (mix < from.eventThreshold) - events = this.events; - if (blend == 3 /* add */) { - for (let i = 0; i < timelineCount; i++) - timelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, 1 /* mixOut */); - } else { - let timelineMode = from.timelineMode; - let timelineHoldMix = from.timelineHoldMix; - let shortestRotation = from.shortestRotation; - let firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1; - if (firstFrame) - from.timelinesRotation.length = timelineCount << 1; - from.totalAlpha = 0; - for (let i = 0; i < timelineCount; i++) { - let timeline = timelines[i]; - let direction = 1 /* mixOut */; - let timelineBlend; - let alpha = 0; - switch (timelineMode[i]) { - case SUBSEQUENT: - if (!drawOrder && timeline instanceof DrawOrderTimeline) - continue; - timelineBlend = blend; - alpha = alphaMix; - break; - case FIRST: - timelineBlend = 0 /* setup */; - alpha = alphaMix; - break; - case HOLD_SUBSEQUENT: - timelineBlend = blend; - alpha = alphaHold; - break; - case HOLD_FIRST: - timelineBlend = 0 /* setup */; - alpha = alphaHold; - break; - default: - timelineBlend = 0 /* setup */; - let holdMix = timelineHoldMix[i]; - alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); - break; - } - from.totalAlpha += alpha; - if (!shortestRotation && timeline instanceof RotateTimeline) - this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame); - else if (timeline instanceof AttachmentTimeline) - this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments && alpha >= from.alphaAttachmentThreshold); - else { - Utils.webkit602BugfixHelper(alpha, blend); - if (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == 0 /* setup */) - direction = 0 /* mixIn */; - timeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction); - } - } - } - if (to.mixDuration > 0) - this.queueEvents(from, animationTime); - this.events.length = 0; - from.nextAnimationLast = animationTime; - from.nextTrackLast = from.trackTime; - return mix; - } - applyAttachmentTimeline(timeline, skeleton, time, blend, attachments) { - var slot = skeleton.slots[timeline.slotIndex]; - if (!slot.bone.active) - return; - if (time < timeline.frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments); - } else - this.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search1(timeline.frames, time)], attachments); - if (slot.attachmentState <= this.unkeyedState) - slot.attachmentState = this.unkeyedState + SETUP; - } - setAttachment(skeleton, slot, attachmentName, attachments) { - slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName)); - if (attachments) - slot.attachmentState = this.unkeyedState + CURRENT; - } - applyRotateTimeline(timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { - if (firstFrame) - timelinesRotation[i] = 0; - if (alpha == 1) { - timeline.apply(skeleton, 0, time, null, 1, blend, 0 /* mixIn */); - return; - } - let bone = skeleton.bones[timeline.boneIndex]; - if (!bone.active) - return; - let frames = timeline.frames; - let r1 = 0, r2 = 0; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - bone.rotation = bone.data.rotation; - default: - return; - case 1 /* first */: - r1 = bone.rotation; - r2 = bone.data.rotation; - } - } else { - r1 = blend == 0 /* setup */ ? bone.data.rotation : bone.rotation; - r2 = bone.data.rotation + timeline.getCurveValue(time); - } - let total = 0, diff = r2 - r1; - diff -= Math.ceil(diff / 360 - 0.5) * 360; - if (diff == 0) { - total = timelinesRotation[i]; - } else { - let lastTotal = 0, lastDiff = 0; - if (firstFrame) { - lastTotal = 0; - lastDiff = diff; - } else { - lastTotal = timelinesRotation[i]; - lastDiff = timelinesRotation[i + 1]; - } - let loops = lastTotal - lastTotal % 360; - total = diff + loops; - let current = diff >= 0, dir = lastTotal >= 0; - if (Math.abs(lastDiff) <= 90 && MathUtils.signum(lastDiff) != MathUtils.signum(diff)) { - if (Math.abs(lastTotal - loops) > 180) { - total += 360 * MathUtils.signum(lastTotal); - dir = current; - } else if (loops != 0) - total -= 360 * MathUtils.signum(lastTotal); - else - dir = current; - } - if (dir != current) - total += 360 * MathUtils.signum(lastTotal); - timelinesRotation[i] = total; - } - timelinesRotation[i + 1] = diff; - bone.rotation = r1 + total * alpha; - } - queueEvents(entry, animationTime) { - let animationStart = entry.animationStart, animationEnd = entry.animationEnd; - let duration = animationEnd - animationStart; - let trackLastWrapped = entry.trackLast % duration; - let events = this.events; - let i = 0, n = events.length; - for (; i < n; i++) { - let event = events[i]; - if (event.time < trackLastWrapped) - break; - if (event.time > animationEnd) - continue; - this.queue.event(entry, event); - } - let complete = false; - if (entry.loop) { - if (duration == 0) - complete = true; - else { - const cycles = Math.floor(entry.trackTime / duration); - complete = cycles > 0 && cycles > Math.floor(entry.trackLast / duration); - } - } else - complete = animationTime >= animationEnd && entry.animationLast < animationEnd; - if (complete) - this.queue.complete(entry); - for (; i < n; i++) { - let event = events[i]; - if (event.time < animationStart) - continue; - this.queue.event(entry, event); - } - } - /** Removes all animations from all tracks, leaving skeletons in their current pose. - * - * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose, - * rather than leaving them in their current pose. */ - clearTracks() { - let oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (let i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - } - /** Removes all animations from the track, leaving skeletons in their current pose. - * - * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose, - * rather than leaving them in their current pose. */ - clearTrack(trackIndex) { - if (trackIndex >= this.tracks.length) - return; - let current = this.tracks[trackIndex]; - if (!current) - return; - this.queue.end(current); - this.clearNext(current); - let entry = current; - while (true) { - let from = entry.mixingFrom; - if (!from) - break; - this.queue.end(from); - entry.mixingFrom = null; - entry.mixingTo = null; - entry = from; - } - this.tracks[current.trackIndex] = null; - this.queue.drain(); - } - setCurrent(index, current, interrupt) { - let from = this.expandToIndex(index); - this.tracks[index] = current; - current.previous = null; - if (from) { - if (interrupt) - this.queue.interrupt(from); - current.mixingFrom = from; - from.mixingTo = current; - current.mixTime = 0; - if (from.mixingFrom && from.mixDuration > 0) - current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); - from.timelinesRotation.length = 0; - } - this.queue.start(current); - } - /** Sets an animation by name. - * - * See {@link #setAnimationWith()}. */ - setAnimation(trackIndex, animationName, loop = false) { - let animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) - throw new Error("Animation not found: " + animationName); - return this.setAnimationWith(trackIndex, animation, loop); - } - /** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never - * applied to a skeleton, it is replaced (not mixed from). - * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its - * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared. - * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose()} event occurs. */ - setAnimationWith(trackIndex, animation, loop = false) { - if (!animation) - throw new Error("animation cannot be null."); - let interrupt = true; - let current = this.expandToIndex(trackIndex); - if (current) { - if (current.nextTrackLast == -1) { - this.tracks[trackIndex] = current.mixingFrom; - this.queue.interrupt(current); - this.queue.end(current); - this.clearNext(current); - current = current.mixingFrom; - interrupt = false; - } else - this.clearNext(current); - } - let entry = this.trackEntry(trackIndex, animation, loop, current); - this.setCurrent(trackIndex, entry, interrupt); - this.queue.drain(); - return entry; - } - /** Queues an animation by name. - * - * See {@link #addAnimationWith()}. */ - addAnimation(trackIndex, animationName, loop = false, delay = 0) { - let animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) - throw new Error("Animation not found: " + animationName); - return this.addAnimationWith(trackIndex, animation, loop, delay); - } - /** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is - * equivalent to calling {@link #setAnimationWith()}. - * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry - * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix - * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the - * previous entry is looping, its next loop completion is used instead of its duration. - * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose()} event occurs. */ - addAnimationWith(trackIndex, animation, loop = false, delay = 0) { - if (!animation) - throw new Error("animation cannot be null."); - let last = this.expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - } - let entry = this.trackEntry(trackIndex, animation, loop, last); - if (!last) { - this.setCurrent(trackIndex, entry, true); - this.queue.drain(); - } else { - last.next = entry; - entry.previous = last; - if (delay <= 0) - delay += last.getTrackComplete() - entry.mixDuration; - } - entry.delay = delay; - return entry; - } - /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's - * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out. - * - * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()}, - * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes - * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation - * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of - * 0 still mixes out over one frame. - * - * Mixing in is done by first setting an empty animation, then adding an animation using - * {@link #addAnimation()} and on the returned track entry, set the - * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and - * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the - * setup pose value if no lower tracks key the property to the value keyed in the new animation. */ - setEmptyAnimation(trackIndex, mixDuration = 0) { - let entry = this.setAnimationWith(trackIndex, _AnimationState.emptyAnimation(), false); - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - } - /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's - * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling - * {@link #setEmptyAnimation()}. - * - * See {@link #setEmptyAnimation()}. - * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry - * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or - * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next - * loop completion is used instead of its duration. - * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose()} event occurs. */ - addEmptyAnimation(trackIndex, mixDuration = 0, delay = 0) { - let entry = this.addAnimationWith(trackIndex, _AnimationState.emptyAnimation(), false, delay); - if (delay <= 0) - entry.delay += entry.mixDuration - mixDuration; - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - } - /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix - * duration. */ - setEmptyAnimations(mixDuration = 0) { - let oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (let i = 0, n = this.tracks.length; i < n; i++) { - let current = this.tracks[i]; - if (current) - this.setEmptyAnimation(current.trackIndex, mixDuration); - } - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - } - expandToIndex(index) { - if (index < this.tracks.length) - return this.tracks[index]; - Utils.ensureArrayCapacity(this.tracks, index + 1, null); - this.tracks.length = index + 1; - return null; - } - /** @param last May be null. */ - trackEntry(trackIndex, animation, loop, last) { - let entry = this.trackEntryPool.obtain(); - entry.reset(); - entry.trackIndex = trackIndex; - entry.animation = animation; - entry.loop = loop; - entry.holdPrevious = false; - entry.reverse = false; - entry.shortestRotation = false; - entry.eventThreshold = 0; - entry.alphaAttachmentThreshold = 0; - entry.mixAttachmentThreshold = 0; - entry.mixDrawOrderThreshold = 0; - entry.animationStart = 0; - entry.animationEnd = animation.duration; - entry.animationLast = -1; - entry.nextAnimationLast = -1; - entry.delay = 0; - entry.trackTime = 0; - entry.trackLast = -1; - entry.nextTrackLast = -1; - entry.trackEnd = Number.MAX_VALUE; - entry.timeScale = 1; - entry.alpha = 1; - entry.mixTime = 0; - entry.mixDuration = !last ? 0 : this.data.getMix(last.animation, animation); - entry.interruptAlpha = 1; - entry.totalAlpha = 0; - entry.mixBlend = 2 /* replace */; - return entry; - } - /** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */ - clearNext(entry) { - let next = entry.next; - while (next) { - this.queue.dispose(next); - next = next.next; - } - entry.next = null; - } - _animationsChanged() { - this.animationsChanged = false; - this.propertyIDs.clear(); - let tracks = this.tracks; - for (let i = 0, n = tracks.length; i < n; i++) { - let entry = tracks[i]; - if (!entry) - continue; - while (entry.mixingFrom) - entry = entry.mixingFrom; - do { - if (!entry.mixingTo || entry.mixBlend != 3 /* add */) - this.computeHold(entry); - entry = entry.mixingTo; - } while (entry); - } - } - computeHold(entry) { - let to = entry.mixingTo; - let timelines = entry.animation.timelines; - let timelinesCount = entry.animation.timelines.length; - let timelineMode = entry.timelineMode; - timelineMode.length = timelinesCount; - let timelineHoldMix = entry.timelineHoldMix; - timelineHoldMix.length = 0; - let propertyIDs = this.propertyIDs; - if (to && to.holdPrevious) { - for (let i = 0; i < timelinesCount; i++) - timelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT; - return; - } - outer: - for (let i = 0; i < timelinesCount; i++) { - let timeline = timelines[i]; - let ids = timeline.getPropertyIds(); - if (!propertyIDs.addAll(ids)) - timelineMode[i] = SUBSEQUENT; - else if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline || timeline instanceof EventTimeline || !to.animation.hasTimeline(ids)) { - timelineMode[i] = FIRST; - } else { - for (let next = to.mixingTo; next; next = next.mixingTo) { - if (next.animation.hasTimeline(ids)) - continue; - if (entry.mixDuration > 0) { - timelineMode[i] = HOLD_MIX; - timelineHoldMix[i] = next; - continue outer; - } - break; - } - timelineMode[i] = HOLD_FIRST; - } - } - } - /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */ - getCurrent(trackIndex) { - if (trackIndex >= this.tracks.length) - return null; - return this.tracks[trackIndex]; - } - /** Adds a listener to receive events for all track entries. */ - addListener(listener) { - if (!listener) - throw new Error("listener cannot be null."); - this.listeners.push(listener); - } - /** Removes the listener added with {@link #addListener()}. */ - removeListener(listener) { - let index = this.listeners.indexOf(listener); - if (index >= 0) - this.listeners.splice(index, 1); - } - /** Removes all listeners added with {@link #addListener()}. */ - clearListeners() { - this.listeners.length = 0; - } - /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an - * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery - * are not wanted because new animations are being set. */ - clearListenerNotifications() { - this.queue.clear(); - } -}; -var AnimationState = _AnimationState; -__publicField(AnimationState, "_emptyAnimation", new Animation("", [], 0)); -var TrackEntry = class { - /** The animation to apply for this track entry. */ - animation = null; - previous = null; - /** The animation queued to start after this animation, or null. `next` makes up a linked list. */ - next = null; - /** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no - * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */ - mixingFrom = null; - /** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is - * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */ - mixingTo = null; - /** The listener for events generated by this track entry, or null. - * - * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation - * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */ - listener = null; - /** The index of the track where this track entry is either current or queued. - * - * See {@link AnimationState#getCurrent()}. */ - trackIndex = 0; - /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its - * duration. */ - loop = false; - /** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead - * of being mixed out. - * - * When mixing between animations that key the same property, if a lower track also keys that property then the value will - * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0% - * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation - * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which - * keys the property, only when a higher track also keys the property. - * - * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the - * previous animation. */ - holdPrevious = false; - reverse = false; - shortestRotation = false; - /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the - * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event - * timelines are not applied while this animation is being mixed out. */ - eventThreshold = 0; - /** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the - * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to - * 0, so attachment timelines are not applied while this animation is being mixed out. */ - mixAttachmentThreshold = 0; - /** When {@link #getAlpha()} is greater than alphaAttachmentThreshold, attachment timelines are applied. - * Defaults to 0, so attachment timelines are always applied. */ - alphaAttachmentThreshold = 0; - /** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the - * mixDrawOrderThreshold, draw order timelines are applied while this animation is being mixed out. Defaults to - * 0, so draw order timelines are not applied while this animation is being mixed out. */ - mixDrawOrderThreshold = 0; - /** Seconds when this animation starts, both initially and after looping. Defaults to 0. - * - * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same - * value to prevent timeline keys before the start time from triggering. */ - animationStart = 0; - /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will - * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */ - animationEnd = 0; - /** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this - * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and - * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation - * is applied. */ - animationLast = 0; - nextAnimationLast = 0; - /** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay` - * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from - * the start of the previous animation to when this track entry will become the current track entry (ie when the previous - * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`). - * - * {@link #timeScale} affects the delay. */ - delay = 0; - /** Current time in seconds this track entry has been the current track entry. The track time determines - * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting - * looping. */ - trackTime = 0; - trackLast = 0; - nextTrackLast = 0; - /** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float - * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time - * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the - * properties keyed by the animation are set to the setup pose and the track is cleared. - * - * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation - * abruptly cease being applied. */ - trackEnd = 0; - /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or - * faster. Defaults to 1. - * - * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to - * match the animation speed. - * - * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the - * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If - * the time scale is not 1, the delay may need to be adjusted. - * - * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */ - timeScale = 0; - /** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults - * to 1, which overwrites the skeleton's current pose with this animation. - * - * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to - * use alpha on track 0 if the skeleton pose is from the last frame render. */ - alpha = 0; - /** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be - * slightly more than `mixDuration` when the mix is complete. */ - mixTime = 0; - /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData - * {@link AnimationStateData#getMix()} based on the animation before this animation (if any). - * - * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the - * properties it was animating. - * - * The `mixDuration` can be set manually rather than use the value from - * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new - * track entry only before {@link AnimationState#update(float)} is first called. - * - * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the - * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set - * afterward. */ - _mixDuration = 0; - interruptAlpha = 0; - totalAlpha = 0; - get mixDuration() { - return this._mixDuration; - } - set mixDuration(mixDuration) { - this._mixDuration = mixDuration; - } - setMixDurationWithDelay(mixDuration, delay) { - this._mixDuration = mixDuration; - if (this.previous != null && delay <= 0) - delay += this.previous.getTrackComplete() - mixDuration; - this.delay = delay; - } - /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which - * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to - * the values from the lower tracks. - * - * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first - * called. */ - mixBlend = 2 /* replace */; - timelineMode = new Array(); - timelineHoldMix = new Array(); - timelinesRotation = new Array(); - reset() { - this.next = null; - this.previous = null; - this.mixingFrom = null; - this.mixingTo = null; - this.animation = null; - this.listener = null; - this.timelineMode.length = 0; - this.timelineHoldMix.length = 0; - this.timelinesRotation.length = 0; - } - /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart} - * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the - * `animationStart` time. */ - getAnimationTime() { - if (this.loop) { - let duration = this.animationEnd - this.animationStart; - if (duration == 0) - return this.animationStart; - return this.trackTime % duration + this.animationStart; - } - return Math.min(this.trackTime + this.animationStart, this.animationEnd); - } - setAnimationLast(animationLast) { - this.animationLast = animationLast; - this.nextAnimationLast = animationLast; - } - /** Returns true if at least one loop has been completed. - * - * See {@link AnimationStateListener#complete()}. */ - isComplete() { - return this.trackTime >= this.animationEnd - this.animationStart; - } - /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the - * long way around when using {@link #alpha} and starting animations on other tracks. - * - * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions: - * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long - * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the - * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */ - resetRotationDirections() { - this.timelinesRotation.length = 0; - } - getTrackComplete() { - let duration = this.animationEnd - this.animationStart; - if (duration != 0) { - if (this.loop) - return duration * (1 + (this.trackTime / duration | 0)); - if (this.trackTime < duration) - return duration; - } - return this.trackTime; - } - /** Returns true if this track entry has been applied at least once. - *

- * See {@link AnimationState#apply(Skeleton)}. */ - wasApplied() { - return this.nextTrackLast != -1; - } - /** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next - * {@link AnimationState#update(float)}. */ - isNextReady() { - return this.next != null && this.nextTrackLast - this.next.delay >= 0; - } -}; -var EventQueue = class { - objects = []; - drainDisabled = false; - animState; - constructor(animState) { - this.animState = animState; - } - start(entry) { - this.objects.push(EventType.start); - this.objects.push(entry); - this.animState.animationsChanged = true; - } - interrupt(entry) { - this.objects.push(EventType.interrupt); - this.objects.push(entry); - } - end(entry) { - this.objects.push(EventType.end); - this.objects.push(entry); - this.animState.animationsChanged = true; - } - dispose(entry) { - this.objects.push(EventType.dispose); - this.objects.push(entry); - } - complete(entry) { - this.objects.push(EventType.complete); - this.objects.push(entry); - } - event(entry, event) { - this.objects.push(EventType.event); - this.objects.push(entry); - this.objects.push(event); - } - drain() { - if (this.drainDisabled) - return; - this.drainDisabled = true; - let objects = this.objects; - let listeners = this.animState.listeners; - for (let i = 0; i < objects.length; i += 2) { - let type = objects[i]; - let entry = objects[i + 1]; - switch (type) { - case EventType.start: - if (entry.listener && entry.listener.start) - entry.listener.start(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.start) - listener.start(entry); - } - break; - case EventType.interrupt: - if (entry.listener && entry.listener.interrupt) - entry.listener.interrupt(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.interrupt) - listener.interrupt(entry); - } - break; - case EventType.end: - if (entry.listener && entry.listener.end) - entry.listener.end(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.end) - listener.end(entry); - } - case EventType.dispose: - if (entry.listener && entry.listener.dispose) - entry.listener.dispose(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.dispose) - listener.dispose(entry); - } - this.animState.trackEntryPool.free(entry); - break; - case EventType.complete: - if (entry.listener && entry.listener.complete) - entry.listener.complete(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.complete) - listener.complete(entry); - } - break; - case EventType.event: - let event = objects[i++ + 2]; - if (entry.listener && entry.listener.event) - entry.listener.event(entry, event); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.event) - listener.event(entry, event); - } - break; - } - } - this.clear(); - this.drainDisabled = false; - } - clear() { - this.objects.length = 0; - } -}; -var EventType = /* @__PURE__ */ ((EventType2) => { - EventType2[EventType2["start"] = 0] = "start"; - EventType2[EventType2["interrupt"] = 1] = "interrupt"; - EventType2[EventType2["end"] = 2] = "end"; - EventType2[EventType2["dispose"] = 3] = "dispose"; - EventType2[EventType2["complete"] = 4] = "complete"; - EventType2[EventType2["event"] = 5] = "event"; - return EventType2; -})(EventType || {}); -var AnimationStateAdapter = class { - start(entry) { - } - interrupt(entry) { - } - end(entry) { - } - dispose(entry) { - } - complete(entry) { - } - event(entry, event) { - } -}; -var SUBSEQUENT = 0; -var FIRST = 1; -var HOLD_SUBSEQUENT = 2; -var HOLD_FIRST = 3; -var HOLD_MIX = 4; -var SETUP = 1; -var CURRENT = 2; - -// spine-core/src/AnimationStateData.ts -var AnimationStateData = class { - /** The SkeletonData to look up animations when they are specified by name. */ - skeletonData; - animationToMixTime = {}; - /** The mix duration to use when no mix duration has been defined between two animations. */ - defaultMix = 0; - constructor(skeletonData) { - if (!skeletonData) - throw new Error("skeletonData cannot be null."); - this.skeletonData = skeletonData; - } - /** Sets a mix duration by animation name. - * - * See {@link #setMixWith()}. */ - setMix(fromName, toName, duration) { - let from = this.skeletonData.findAnimation(fromName); - if (!from) - throw new Error("Animation not found: " + fromName); - let to = this.skeletonData.findAnimation(toName); - if (!to) - throw new Error("Animation not found: " + toName); - this.setMixWith(from, to, duration); - } - /** Sets the mix duration when changing from the specified animation to the other. - * - * See {@link TrackEntry#mixDuration}. */ - setMixWith(from, to, duration) { - if (!from) - throw new Error("from cannot be null."); - if (!to) - throw new Error("to cannot be null."); - let key = from.name + "." + to.name; - this.animationToMixTime[key] = duration; - } - /** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if - * no mix duration has been set. */ - getMix(from, to) { - let key = from.name + "." + to.name; - let value = this.animationToMixTime[key]; - return value === void 0 ? this.defaultMix : value; - } -}; - -// spine-core/src/attachments/BoundingBoxAttachment.ts -var BoundingBoxAttachment = class extends VertexAttachment { - color = new Color(1, 1, 1, 1); - constructor(name) { - super(name); - } - copy() { - let copy = new BoundingBoxAttachment(this.name); - this.copyTo(copy); - copy.color.setFromColor(this.color); - return copy; - } -}; - -// spine-core/src/attachments/ClippingAttachment.ts -var ClippingAttachment = class extends VertexAttachment { - /** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of - * the skeleton's rendering. */ - endSlot = null; - // Nonessential. - /** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons - * are not usually rendered at runtime. */ - color = new Color(0.2275, 0.2275, 0.8078, 1); - // ce3a3aff - constructor(name) { - super(name); - } - copy() { - let copy = new ClippingAttachment(this.name); - this.copyTo(copy); - copy.endSlot = this.endSlot; - copy.color.setFromColor(this.color); - return copy; - } -}; - -// spine-core/src/Texture.ts -var Texture = class { - _image; - constructor(image) { - this._image = image; - } - getImage() { - return this._image; - } -}; -var TextureFilter = /* @__PURE__ */ ((TextureFilter3) => { - TextureFilter3[TextureFilter3["Nearest"] = 9728] = "Nearest"; - TextureFilter3[TextureFilter3["Linear"] = 9729] = "Linear"; - TextureFilter3[TextureFilter3["MipMap"] = 9987] = "MipMap"; - TextureFilter3[TextureFilter3["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; - TextureFilter3[TextureFilter3["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; - TextureFilter3[TextureFilter3["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; - TextureFilter3[TextureFilter3["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; - return TextureFilter3; -})(TextureFilter || {}); -var TextureWrap = /* @__PURE__ */ ((TextureWrap4) => { - TextureWrap4[TextureWrap4["MirroredRepeat"] = 33648] = "MirroredRepeat"; - TextureWrap4[TextureWrap4["ClampToEdge"] = 33071] = "ClampToEdge"; - TextureWrap4[TextureWrap4["Repeat"] = 10497] = "Repeat"; - return TextureWrap4; -})(TextureWrap || {}); -var TextureRegion = class { - texture; - u = 0; - v = 0; - u2 = 0; - v2 = 0; - width = 0; - height = 0; - degrees = 0; - offsetX = 0; - offsetY = 0; - originalWidth = 0; - originalHeight = 0; -}; -var FakeTexture = class extends Texture { - setFilters(minFilter, magFilter) { - } - setWraps(uWrap, vWrap) { - } - dispose() { - } -}; - -// spine-core/src/TextureAtlas.ts -var TextureAtlas = class { - pages = new Array(); - regions = new Array(); - constructor(atlasText) { - let reader = new TextureAtlasReader(atlasText); - let entry = new Array(4); - let pageFields = {}; - pageFields["size"] = (page2) => { - page2.width = parseInt(entry[1]); - page2.height = parseInt(entry[2]); - }; - pageFields["format"] = () => { - }; - pageFields["filter"] = (page2) => { - page2.minFilter = Utils.enumValue(TextureFilter, entry[1]); - page2.magFilter = Utils.enumValue(TextureFilter, entry[2]); - }; - pageFields["repeat"] = (page2) => { - if (entry[1].indexOf("x") != -1) - page2.uWrap = 10497 /* Repeat */; - if (entry[1].indexOf("y") != -1) - page2.vWrap = 10497 /* Repeat */; - }; - pageFields["pma"] = (page2) => { - page2.pma = entry[1] == "true"; - }; - var regionFields = {}; - regionFields["xy"] = (region) => { - region.x = parseInt(entry[1]); - region.y = parseInt(entry[2]); - }; - regionFields["size"] = (region) => { - region.width = parseInt(entry[1]); - region.height = parseInt(entry[2]); - }; - regionFields["bounds"] = (region) => { - region.x = parseInt(entry[1]); - region.y = parseInt(entry[2]); - region.width = parseInt(entry[3]); - region.height = parseInt(entry[4]); - }; - regionFields["offset"] = (region) => { - region.offsetX = parseInt(entry[1]); - region.offsetY = parseInt(entry[2]); - }; - regionFields["orig"] = (region) => { - region.originalWidth = parseInt(entry[1]); - region.originalHeight = parseInt(entry[2]); - }; - regionFields["offsets"] = (region) => { - region.offsetX = parseInt(entry[1]); - region.offsetY = parseInt(entry[2]); - region.originalWidth = parseInt(entry[3]); - region.originalHeight = parseInt(entry[4]); - }; - regionFields["rotate"] = (region) => { - let value = entry[1]; - if (value == "true") - region.degrees = 90; - else if (value != "false") - region.degrees = parseInt(value); - }; - regionFields["index"] = (region) => { - region.index = parseInt(entry[1]); - }; - let line = reader.readLine(); - while (line && line.trim().length == 0) - line = reader.readLine(); - while (true) { - if (!line || line.trim().length == 0) - break; - if (reader.readEntry(entry, line) == 0) - break; - line = reader.readLine(); - } - let page = null; - let names = null; - let values = null; - while (true) { - if (line === null) - break; - if (line.trim().length == 0) { - page = null; - line = reader.readLine(); - } else if (!page) { - page = new TextureAtlasPage(line.trim()); - while (true) { - if (reader.readEntry(entry, line = reader.readLine()) == 0) - break; - let field = pageFields[entry[0]]; - if (field) - field(page); - } - this.pages.push(page); - } else { - let region = new TextureAtlasRegion(page, line); - while (true) { - let count = reader.readEntry(entry, line = reader.readLine()); - if (count == 0) - break; - let field = regionFields[entry[0]]; - if (field) - field(region); - else { - if (!names) - names = []; - if (!values) - values = []; - names.push(entry[0]); - let entryValues = []; - for (let i = 0; i < count; i++) - entryValues.push(parseInt(entry[i + 1])); - values.push(entryValues); - } - } - if (region.originalWidth == 0 && region.originalHeight == 0) { - region.originalWidth = region.width; - region.originalHeight = region.height; - } - if (names && names.length > 0 && values && values.length > 0) { - region.names = names; - region.values = values; - names = null; - values = null; - } - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.degrees == 90) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - this.regions.push(region); - } - } - } - findRegion(name) { - for (let i = 0; i < this.regions.length; i++) { - if (this.regions[i].name == name) { - return this.regions[i]; - } - } - return null; - } - setTextures(assetManager, pathPrefix = "") { - for (let page of this.pages) - page.setTexture(assetManager.get(pathPrefix + page.name)); - } - dispose() { - for (let i = 0; i < this.pages.length; i++) { - this.pages[i].texture?.dispose(); - } - } -}; -var TextureAtlasReader = class { - lines; - index = 0; - constructor(text) { - this.lines = text.split(/\r\n|\r|\n/); - } - readLine() { - if (this.index >= this.lines.length) - return null; - return this.lines[this.index++]; - } - readEntry(entry, line) { - if (!line) - return 0; - line = line.trim(); - if (line.length == 0) - return 0; - let colon = line.indexOf(":"); - if (colon == -1) - return 0; - entry[0] = line.substr(0, colon).trim(); - for (let i = 1, lastMatch = colon + 1; ; i++) { - let comma = line.indexOf(",", lastMatch); - if (comma == -1) { - entry[i] = line.substr(lastMatch).trim(); - return i; - } - entry[i] = line.substr(lastMatch, comma - lastMatch).trim(); - lastMatch = comma + 1; - if (i == 4) - return 4; - } - } -}; -var TextureAtlasPage = class { - name; - minFilter = 9728 /* Nearest */; - magFilter = 9728 /* Nearest */; - uWrap = 33071 /* ClampToEdge */; - vWrap = 33071 /* ClampToEdge */; - texture = null; - width = 0; - height = 0; - pma = false; - regions = new Array(); - constructor(name) { - this.name = name; - } - setTexture(texture) { - this.texture = texture; - texture.setFilters(this.minFilter, this.magFilter); - texture.setWraps(this.uWrap, this.vWrap); - for (let region of this.regions) - region.texture = texture; - } -}; -var TextureAtlasRegion = class extends TextureRegion { - page; - name; - x = 0; - y = 0; - offsetX = 0; - offsetY = 0; - originalWidth = 0; - originalHeight = 0; - index = 0; - degrees = 0; - names = null; - values = null; - constructor(page, name) { - super(); - this.page = page; - this.name = name; - page.regions.push(this); - } -}; - -// spine-core/src/attachments/MeshAttachment.ts -var MeshAttachment = class extends VertexAttachment { - region = null; - /** The name of the texture region for this attachment. */ - path; - /** The UV pair for each vertex, normalized within the texture region. */ - regionUVs = []; - /** The UV pair for each vertex, normalized within the entire texture. - * - * See {@link #updateUVs}. */ - uvs = []; - /** Triplets of vertex indices which describe the mesh's triangulation. */ - triangles = []; - /** The color to tint the mesh. */ - color = new Color(1, 1, 1, 1); - /** The width of the mesh's image. Available only when nonessential data was exported. */ - width = 0; - /** The height of the mesh's image. Available only when nonessential data was exported. */ - height = 0; - /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */ - hullLength = 0; - /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if - * nonessential data was exported. Triangulation is not performed at runtime. */ - edges = []; - parentMesh = null; - sequence = null; - tempColor = new Color(0, 0, 0, 0); - constructor(name, path) { - super(name); - this.path = path; - } - /** Calculates {@link #uvs} using the {@link #regionUVs} and region. Must be called if the region, the region's properties, or - * the {@link #regionUVs} are changed. */ - updateRegion() { - if (!this.region) - throw new Error("Region not set."); - let regionUVs = this.regionUVs; - if (!this.uvs || this.uvs.length != regionUVs.length) - this.uvs = Utils.newFloatArray(regionUVs.length); - let uvs = this.uvs; - let n = this.uvs.length; - let u = this.region.u, v = this.region.v, width = 0, height = 0; - if (this.region instanceof TextureAtlasRegion) { - let region = this.region, page = region.page; - let textureWidth = page.width, textureHeight = page.height; - switch (region.degrees) { - case 90: - u -= (region.originalHeight - region.offsetY - region.height) / textureWidth; - v -= (region.originalWidth - region.offsetX - region.width) / textureHeight; - width = region.originalHeight / textureWidth; - height = region.originalWidth / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + regionUVs[i + 1] * width; - uvs[i + 1] = v + (1 - regionUVs[i]) * height; - } - return; - case 180: - u -= (region.originalWidth - region.offsetX - region.width) / textureWidth; - v -= region.offsetY / textureHeight; - width = region.originalWidth / textureWidth; - height = region.originalHeight / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + (1 - regionUVs[i]) * width; - uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height; - } - return; - case 270: - u -= region.offsetY / textureWidth; - v -= region.offsetX / textureHeight; - width = region.originalHeight / textureWidth; - height = region.originalWidth / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + (1 - regionUVs[i + 1]) * width; - uvs[i + 1] = v + regionUVs[i] * height; - } - return; - } - u -= region.offsetX / textureWidth; - v -= (region.originalHeight - region.offsetY - region.height) / textureHeight; - width = region.originalWidth / textureWidth; - height = region.originalHeight / textureHeight; - } else if (!this.region) { - u = v = 0; - width = height = 1; - } else { - width = this.region.u2 - u; - height = this.region.v2 - v; - } - for (let i = 0; i < n; i += 2) { - uvs[i] = u + regionUVs[i] * width; - uvs[i + 1] = v + regionUVs[i + 1] * height; - } - } - /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices}, - * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the - * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */ - getParentMesh() { - return this.parentMesh; - } - /** @param parentMesh May be null. */ - setParentMesh(parentMesh) { - this.parentMesh = parentMesh; - if (parentMesh) { - this.bones = parentMesh.bones; - this.vertices = parentMesh.vertices; - this.worldVerticesLength = parentMesh.worldVerticesLength; - this.regionUVs = parentMesh.regionUVs; - this.triangles = parentMesh.triangles; - this.hullLength = parentMesh.hullLength; - this.worldVerticesLength = parentMesh.worldVerticesLength; - } - } - copy() { - if (this.parentMesh) - return this.newLinkedMesh(); - let copy = new MeshAttachment(this.name, this.path); - copy.region = this.region; - copy.color.setFromColor(this.color); - this.copyTo(copy); - copy.regionUVs = new Array(this.regionUVs.length); - Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length); - copy.uvs = new Array(this.uvs.length); - Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length); - copy.triangles = new Array(this.triangles.length); - Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length); - copy.hullLength = this.hullLength; - copy.sequence = this.sequence != null ? this.sequence.copy() : null; - if (this.edges) { - copy.edges = new Array(this.edges.length); - Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length); - } - copy.width = this.width; - copy.height = this.height; - return copy; - } - computeWorldVertices(slot, start, count, worldVertices2, offset, stride) { - if (this.sequence != null) - this.sequence.apply(slot, this); - super.computeWorldVertices(slot, start, count, worldVertices2, offset, stride); - } - /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/ - newLinkedMesh() { - let copy = new MeshAttachment(this.name, this.path); - copy.region = this.region; - copy.color.setFromColor(this.color); - copy.timelineAttachment = this.timelineAttachment; - copy.setParentMesh(this.parentMesh ? this.parentMesh : this); - if (copy.region != null) - copy.updateRegion(); - return copy; - } -}; - -// spine-core/src/attachments/PathAttachment.ts -var PathAttachment = class extends VertexAttachment { - /** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */ - lengths = []; - /** If true, the start and end knots are connected. */ - closed = false; - /** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer - * calculations are performed but calculating positions along the path is less accurate. */ - constantSpeed = false; - /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually - * rendered at runtime. */ - color = new Color(1, 1, 1, 1); - constructor(name) { - super(name); - } - copy() { - let copy = new PathAttachment(this.name); - this.copyTo(copy); - copy.lengths = new Array(this.lengths.length); - Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length); - copy.closed = closed; - copy.constantSpeed = this.constantSpeed; - copy.color.setFromColor(this.color); - return copy; - } -}; - -// spine-core/src/attachments/PointAttachment.ts -var PointAttachment = class extends VertexAttachment { - x = 0; - y = 0; - rotation = 0; - /** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments - * are not usually rendered at runtime. */ - color = new Color(0.38, 0.94, 0, 1); - constructor(name) { - super(name); - } - computeWorldPosition(bone, point) { - point.x = this.x * bone.a + this.y * bone.b + bone.worldX; - point.y = this.x * bone.c + this.y * bone.d + bone.worldY; - return point; - } - computeWorldRotation(bone) { - const r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r); - const x = cos * bone.a + sin * bone.b; - const y = cos * bone.c + sin * bone.d; - return MathUtils.atan2Deg(y, x); - } - copy() { - let copy = new PointAttachment(this.name); - copy.x = this.x; - copy.y = this.y; - copy.rotation = this.rotation; - copy.color.setFromColor(this.color); - return copy; - } -}; - -// spine-core/src/attachments/RegionAttachment.ts -var _RegionAttachment = class extends Attachment { - /** The local x translation. */ - x = 0; - /** The local y translation. */ - y = 0; - /** The local scaleX. */ - scaleX = 1; - /** The local scaleY. */ - scaleY = 1; - /** The local rotation. */ - rotation = 0; - /** The width of the region attachment in Spine. */ - width = 0; - /** The height of the region attachment in Spine. */ - height = 0; - /** The color to tint the region attachment. */ - color = new Color(1, 1, 1, 1); - /** The name of the texture region for this attachment. */ - path; - region = null; - sequence = null; - /** For each of the 4 vertices, a pair of x,y values that is the local position of the vertex. - * - * See {@link #updateOffset()}. */ - offset = Utils.newFloatArray(8); - uvs = Utils.newFloatArray(8); - tempColor = new Color(1, 1, 1, 1); - constructor(name, path) { - super(name); - this.path = path; - } - /** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */ - updateRegion() { - if (!this.region) - throw new Error("Region not set."); - let region = this.region; - let uvs = this.uvs; - if (region == null) { - uvs[0] = 0; - uvs[1] = 0; - uvs[2] = 0; - uvs[3] = 1; - uvs[4] = 1; - uvs[5] = 1; - uvs[6] = 1; - uvs[7] = 0; - return; - } - let regionScaleX = this.width / this.region.originalWidth * this.scaleX; - let regionScaleY = this.height / this.region.originalHeight * this.scaleY; - let localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; - let localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; - let localX2 = localX + this.region.width * regionScaleX; - let localY2 = localY + this.region.height * regionScaleY; - let radians = this.rotation * MathUtils.degRad; - let cos = Math.cos(radians); - let sin = Math.sin(radians); - let x = this.x, y = this.y; - let localXCos = localX * cos + x; - let localXSin = localX * sin; - let localYCos = localY * cos + y; - let localYSin = localY * sin; - let localX2Cos = localX2 * cos + x; - let localX2Sin = localX2 * sin; - let localY2Cos = localY2 * cos + y; - let localY2Sin = localY2 * sin; - let offset = this.offset; - offset[0] = localXCos - localYSin; - offset[1] = localYCos + localXSin; - offset[2] = localXCos - localY2Sin; - offset[3] = localY2Cos + localXSin; - offset[4] = localX2Cos - localY2Sin; - offset[5] = localY2Cos + localX2Sin; - offset[6] = localX2Cos - localYSin; - offset[7] = localYCos + localX2Sin; - if (region.degrees == 90) { - uvs[0] = region.u2; - uvs[1] = region.v2; - uvs[2] = region.u; - uvs[3] = region.v2; - uvs[4] = region.u; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v; - } else { - uvs[0] = region.u; - uvs[1] = region.v2; - uvs[2] = region.u; - uvs[3] = region.v; - uvs[4] = region.u2; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v2; - } - } - /** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may - * be changed. - *

- * See World transforms in the Spine - * Runtimes Guide. - * @param worldVertices The output world vertices. Must have a length >= offset + 8. - * @param offset The worldVertices index to begin writing values. - * @param stride The number of worldVertices entries between the value pairs written. */ - computeWorldVertices(slot, worldVertices2, offset, stride) { - if (this.sequence != null) - this.sequence.apply(slot, this); - let bone = slot.bone; - let vertexOffset = this.offset; - let x = bone.worldX, y = bone.worldY; - let a = bone.a, b = bone.b, c = bone.c, d = bone.d; - let offsetX = 0, offsetY = 0; - offsetX = vertexOffset[0]; - offsetY = vertexOffset[1]; - worldVertices2[offset] = offsetX * a + offsetY * b + x; - worldVertices2[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[2]; - offsetY = vertexOffset[3]; - worldVertices2[offset] = offsetX * a + offsetY * b + x; - worldVertices2[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[4]; - offsetY = vertexOffset[5]; - worldVertices2[offset] = offsetX * a + offsetY * b + x; - worldVertices2[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[6]; - offsetY = vertexOffset[7]; - worldVertices2[offset] = offsetX * a + offsetY * b + x; - worldVertices2[offset + 1] = offsetX * c + offsetY * d + y; - } - copy() { - let copy = new _RegionAttachment(this.name, this.path); - copy.region = this.region; - copy.x = this.x; - copy.y = this.y; - copy.scaleX = this.scaleX; - copy.scaleY = this.scaleY; - copy.rotation = this.rotation; - copy.width = this.width; - copy.height = this.height; - Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8); - Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8); - copy.color.setFromColor(this.color); - copy.sequence = this.sequence != null ? this.sequence.copy() : null; - return copy; - } -}; -var RegionAttachment = _RegionAttachment; -__publicField(RegionAttachment, "X1", 0); -__publicField(RegionAttachment, "Y1", 1); -__publicField(RegionAttachment, "C1R", 2); -__publicField(RegionAttachment, "C1G", 3); -__publicField(RegionAttachment, "C1B", 4); -__publicField(RegionAttachment, "C1A", 5); -__publicField(RegionAttachment, "U1", 6); -__publicField(RegionAttachment, "V1", 7); -__publicField(RegionAttachment, "X2", 8); -__publicField(RegionAttachment, "Y2", 9); -__publicField(RegionAttachment, "C2R", 10); -__publicField(RegionAttachment, "C2G", 11); -__publicField(RegionAttachment, "C2B", 12); -__publicField(RegionAttachment, "C2A", 13); -__publicField(RegionAttachment, "U2", 14); -__publicField(RegionAttachment, "V2", 15); -__publicField(RegionAttachment, "X3", 16); -__publicField(RegionAttachment, "Y3", 17); -__publicField(RegionAttachment, "C3R", 18); -__publicField(RegionAttachment, "C3G", 19); -__publicField(RegionAttachment, "C3B", 20); -__publicField(RegionAttachment, "C3A", 21); -__publicField(RegionAttachment, "U3", 22); -__publicField(RegionAttachment, "V3", 23); -__publicField(RegionAttachment, "X4", 24); -__publicField(RegionAttachment, "Y4", 25); -__publicField(RegionAttachment, "C4R", 26); -__publicField(RegionAttachment, "C4G", 27); -__publicField(RegionAttachment, "C4B", 28); -__publicField(RegionAttachment, "C4A", 29); -__publicField(RegionAttachment, "U4", 30); -__publicField(RegionAttachment, "V4", 31); - -// spine-core/src/AtlasAttachmentLoader.ts -var AtlasAttachmentLoader = class { - atlas; - constructor(atlas) { - this.atlas = atlas; - } - loadSequence(name, basePath, sequence) { - let regions = sequence.regions; - for (let i = 0, n = regions.length; i < n; i++) { - let path = sequence.getPath(basePath, i); - let region = this.atlas.findRegion(path); - if (region == null) - throw new Error("Region not found in atlas: " + path + " (sequence: " + name + ")"); - regions[i] = region; - } - } - newRegionAttachment(skin, name, path, sequence) { - let attachment = new RegionAttachment(name, path); - if (sequence != null) { - this.loadSequence(name, path, sequence); - } else { - let region = this.atlas.findRegion(path); - if (!region) - throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); - attachment.region = region; - } - return attachment; - } - newMeshAttachment(skin, name, path, sequence) { - let attachment = new MeshAttachment(name, path); - if (sequence != null) { - this.loadSequence(name, path, sequence); - } else { - let region = this.atlas.findRegion(path); - if (!region) - throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); - attachment.region = region; - } - return attachment; - } - newBoundingBoxAttachment(skin, name) { - return new BoundingBoxAttachment(name); - } - newPathAttachment(skin, name) { - return new PathAttachment(name); - } - newPointAttachment(skin, name) { - return new PointAttachment(name); - } - newClippingAttachment(skin, name) { - return new ClippingAttachment(name); - } -}; - -// spine-core/src/BoneData.ts -var BoneData = class { - /** The index of the bone in {@link Skeleton#getBones()}. */ - index = 0; - /** The name of the bone, which is unique across all bones in the skeleton. */ - name; - /** @returns May be null. */ - parent = null; - /** The bone's length. */ - length = 0; - /** The local x translation. */ - x = 0; - /** The local y translation. */ - y = 0; - /** The local rotation in degrees, counter clockwise. */ - rotation = 0; - /** The local scaleX. */ - scaleX = 1; - /** The local scaleY. */ - scaleY = 1; - /** The local shearX. */ - shearX = 0; - /** The local shearX. */ - shearY = 0; - /** The transform mode for how parent world transforms affect this bone. */ - inherit = Inherit.Normal; - /** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this - * bone. - * @see Skin#bones */ - skinRequired = false; - /** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually - * rendered at runtime. */ - color = new Color(); - /** The bone icon as it was in Spine, or null if nonessential data was not exported. */ - icon; - /** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */ - visible = false; - constructor(index, name, parent) { - if (index < 0) - throw new Error("index must be >= 0."); - if (!name) - throw new Error("name cannot be null."); - this.index = index; - this.name = name; - this.parent = parent; - } -}; -var Inherit = /* @__PURE__ */ ((Inherit2) => { - Inherit2[Inherit2["Normal"] = 0] = "Normal"; - Inherit2[Inherit2["OnlyTranslation"] = 1] = "OnlyTranslation"; - Inherit2[Inherit2["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; - Inherit2[Inherit2["NoScale"] = 3] = "NoScale"; - Inherit2[Inherit2["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; - return Inherit2; -})(Inherit || {}); - -// spine-core/src/Bone.ts -var Bone = class { - /** The bone's setup pose data. */ - data; - /** The skeleton this bone belongs to. */ - skeleton; - /** The parent bone, or null if this is the root bone. */ - parent = null; - /** The immediate children of this bone. */ - children = new Array(); - /** The local x translation. */ - x = 0; - /** The local y translation. */ - y = 0; - /** The local rotation in degrees, counter clockwise. */ - rotation = 0; - /** The local scaleX. */ - scaleX = 0; - /** The local scaleY. */ - scaleY = 0; - /** The local shearX. */ - shearX = 0; - /** The local shearY. */ - shearY = 0; - /** The applied local x translation. */ - ax = 0; - /** The applied local y translation. */ - ay = 0; - /** The applied local rotation in degrees, counter clockwise. */ - arotation = 0; - /** The applied local scaleX. */ - ascaleX = 0; - /** The applied local scaleY. */ - ascaleY = 0; - /** The applied local shearX. */ - ashearX = 0; - /** The applied local shearY. */ - ashearY = 0; - /** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */ - a = 0; - /** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */ - b = 0; - /** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */ - c = 0; - /** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */ - d = 0; - /** The world X position. If changed, {@link #updateAppliedTransform()} should be called. */ - worldY = 0; - /** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */ - worldX = 0; - inherit = 0 /* Normal */; - sorted = false; - active = false; - /** @param parent May be null. */ - constructor(data, skeleton, parent) { - if (!data) - throw new Error("data cannot be null."); - if (!skeleton) - throw new Error("skeleton cannot be null."); - this.data = data; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); - } - /** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the - * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */ - isActive() { - return this.active; - } - /** Computes the world transform using the parent bone and this bone's local applied transform. */ - update(physics) { - this.updateWorldTransformWith(this.ax, this.ay, this.arotation, this.ascaleX, this.ascaleY, this.ashearX, this.ashearY); - } - /** Computes the world transform using the parent bone and this bone's local transform. - * - * See {@link #updateWorldTransformWith()}. */ - updateWorldTransform() { - this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); - } - /** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the - * specified local transform. Child bones are not updated. - * - * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine - * Runtimes Guide. */ - updateWorldTransformWith(x, y, rotation, scaleX, scaleY, shearX, shearY) { - this.ax = x; - this.ay = y; - this.arotation = rotation; - this.ascaleX = scaleX; - this.ascaleY = scaleY; - this.ashearX = shearX; - this.ashearY = shearY; - let parent = this.parent; - if (!parent) { - let skeleton = this.skeleton; - const sx = skeleton.scaleX, sy = skeleton.scaleY; - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - this.a = Math.cos(rx) * scaleX * sx; - this.b = Math.cos(ry) * scaleY * sx; - this.c = Math.sin(rx) * scaleX * sy; - this.d = Math.sin(ry) * scaleY * sy; - this.worldX = x * sx + skeleton.x; - this.worldY = y * sy + skeleton.y; - return; - } - let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - this.worldX = pa * x + pb * y + parent.worldX; - this.worldY = pc * x + pd * y + parent.worldY; - switch (this.inherit) { - case 0 /* Normal */: { - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - const la = Math.cos(rx) * scaleX; - const lb = Math.cos(ry) * scaleY; - const lc = Math.sin(rx) * scaleX; - const ld = Math.sin(ry) * scaleY; - this.a = pa * la + pb * lc; - this.b = pa * lb + pb * ld; - this.c = pc * la + pd * lc; - this.d = pc * lb + pd * ld; - return; - } - case 1 /* OnlyTranslation */: { - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - this.a = Math.cos(rx) * scaleX; - this.b = Math.cos(ry) * scaleY; - this.c = Math.sin(rx) * scaleX; - this.d = Math.sin(ry) * scaleY; - break; - } - case 2 /* NoRotationOrReflection */: { - let sx = 1 / this.skeleton.scaleX, sy = 1 / this.skeleton.scaleY; - pa *= sx; - pc *= sy; - let s = pa * pa + pc * pc; - let prx = 0; - if (s > 1e-4) { - s = Math.abs(pa * pd * sy - pb * sx * pc) / s; - pb = pc * s; - pd = pa * s; - prx = Math.atan2(pc, pa) * MathUtils.radDeg; - } else { - pa = 0; - pc = 0; - prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg; - } - const rx = (rotation + shearX - prx) * MathUtils.degRad; - const ry = (rotation + shearY - prx + 90) * MathUtils.degRad; - const la = Math.cos(rx) * scaleX; - const lb = Math.cos(ry) * scaleY; - const lc = Math.sin(rx) * scaleX; - const ld = Math.sin(ry) * scaleY; - this.a = pa * la - pb * lc; - this.b = pa * lb - pb * ld; - this.c = pc * la + pd * lc; - this.d = pc * lb + pd * ld; - break; - } - case 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: { - rotation *= MathUtils.degRad; - const cos = Math.cos(rotation), sin = Math.sin(rotation); - let za = (pa * cos + pb * sin) / this.skeleton.scaleX; - let zc = (pc * cos + pd * sin) / this.skeleton.scaleY; - let s = Math.sqrt(za * za + zc * zc); - if (s > 1e-5) - s = 1 / s; - za *= s; - zc *= s; - s = Math.sqrt(za * za + zc * zc); - if (this.inherit == 3 /* NoScale */ && pa * pd - pb * pc < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) - s = -s; - rotation = Math.PI / 2 + Math.atan2(zc, za); - const zb = Math.cos(rotation) * s; - const zd = Math.sin(rotation) * s; - shearX *= MathUtils.degRad; - shearY = (90 + shearY) * MathUtils.degRad; - const la = Math.cos(shearX) * scaleX; - const lb = Math.cos(shearY) * scaleY; - const lc = Math.sin(shearX) * scaleX; - const ld = Math.sin(shearY) * scaleY; - this.a = za * la + zb * lc; - this.b = za * lb + zb * ld; - this.c = zc * la + zd * lc; - this.d = zc * lb + zd * ld; - break; - } - } - this.a *= this.skeleton.scaleX; - this.b *= this.skeleton.scaleX; - this.c *= this.skeleton.scaleY; - this.d *= this.skeleton.scaleY; - } - /** Sets this bone's local transform to the setup pose. */ - setToSetupPose() { - let data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.shearX = data.shearX; - this.shearY = data.shearY; - this.inherit = data.inherit; - } - /** Computes the applied transform values from the world transform. - * - * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so - * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other - * constraints). - * - * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after - * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */ - updateAppliedTransform() { - let parent = this.parent; - if (!parent) { - this.ax = this.worldX - this.skeleton.x; - this.ay = this.worldY - this.skeleton.y; - this.arotation = Math.atan2(this.c, this.a) * MathUtils.radDeg; - this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c); - this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d); - this.ashearX = 0; - this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * MathUtils.radDeg; - return; - } - let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - let pid = 1 / (pa * pd - pb * pc); - let ia = pd * pid, ib = pb * pid, ic = pc * pid, id = pa * pid; - let dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; - this.ax = dx * ia - dy * ib; - this.ay = dy * id - dx * ic; - let ra, rb, rc, rd; - if (this.inherit == 1 /* OnlyTranslation */) { - ra = this.a; - rb = this.b; - rc = this.c; - rd = this.d; - } else { - switch (this.inherit) { - case 2 /* NoRotationOrReflection */: { - let s2 = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc); - pb = -pc * this.skeleton.scaleX * s2 / this.skeleton.scaleY; - pd = pa * this.skeleton.scaleY * s2 / this.skeleton.scaleX; - pid = 1 / (pa * pd - pb * pc); - ia = pd * pid; - ib = pb * pid; - break; - } - case 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: - let cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation); - pa = (pa * cos + pb * sin) / this.skeleton.scaleX; - pc = (pc * cos + pd * sin) / this.skeleton.scaleY; - let s = Math.sqrt(pa * pa + pc * pc); - if (s > 1e-5) - s = 1 / s; - pa *= s; - pc *= s; - s = Math.sqrt(pa * pa + pc * pc); - if (this.inherit == 3 /* NoScale */ && pid < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) - s = -s; - let r = MathUtils.PI / 2 + Math.atan2(pc, pa); - pb = Math.cos(r) * s; - pd = Math.sin(r) * s; - pid = 1 / (pa * pd - pb * pc); - ia = pd * pid; - ib = pb * pid; - ic = pc * pid; - id = pa * pid; - } - ra = ia * this.a - ib * this.c; - rb = ia * this.b - ib * this.d; - rc = id * this.c - ic * this.a; - rd = id * this.d - ic * this.b; - } - this.ashearX = 0; - this.ascaleX = Math.sqrt(ra * ra + rc * rc); - if (this.ascaleX > 1e-4) { - let det = ra * rd - rb * rc; - this.ascaleY = det / this.ascaleX; - this.ashearY = -Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg; - this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg; - } else { - this.ascaleX = 0; - this.ascaleY = Math.sqrt(rb * rb + rd * rd); - this.ashearY = 0; - this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg; - } - } - /** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */ - getWorldRotationX() { - return Math.atan2(this.c, this.a) * MathUtils.radDeg; - } - /** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */ - getWorldRotationY() { - return Math.atan2(this.d, this.b) * MathUtils.radDeg; - } - /** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */ - getWorldScaleX() { - return Math.sqrt(this.a * this.a + this.c * this.c); - } - /** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */ - getWorldScaleY() { - return Math.sqrt(this.b * this.b + this.d * this.d); - } - /** Transforms a point from world coordinates to the bone's local coordinates. */ - worldToLocal(world) { - let invDet = 1 / (this.a * this.d - this.b * this.c); - let x = world.x - this.worldX, y = world.y - this.worldY; - world.x = x * this.d * invDet - y * this.b * invDet; - world.y = y * this.a * invDet - x * this.c * invDet; - return world; - } - /** Transforms a point from the bone's local coordinates to world coordinates. */ - localToWorld(local) { - let x = local.x, y = local.y; - local.x = x * this.a + y * this.b + this.worldX; - local.y = x * this.c + y * this.d + this.worldY; - return local; - } - /** Transforms a point from world coordinates to the parent bone's local coordinates. */ - worldToParent(world) { - if (world == null) - throw new Error("world cannot be null."); - return this.parent == null ? world : this.parent.worldToLocal(world); - } - /** Transforms a point from the parent bone's coordinates to world coordinates. */ - parentToWorld(world) { - if (world == null) - throw new Error("world cannot be null."); - return this.parent == null ? world : this.parent.localToWorld(world); - } - /** Transforms a world rotation to a local rotation. */ - worldToLocalRotation(worldRotation) { - let sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation); - return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * MathUtils.radDeg + this.rotation - this.shearX; - } - /** Transforms a local rotation to a world rotation. */ - localToWorldRotation(localRotation) { - localRotation -= this.rotation - this.shearX; - let sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation); - return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * MathUtils.radDeg; - } - /** Rotates the world transform the specified amount. - *

- * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and - * {@link #update(Physics)} will need to be called on any child bones, recursively. */ - rotateWorld(degrees) { - degrees *= MathUtils.degRad; - const sin = Math.sin(degrees), cos = Math.cos(degrees); - const ra = this.a, rb = this.b; - this.a = cos * ra - sin * this.c; - this.b = cos * rb - sin * this.d; - this.c = sin * ra + cos * this.c; - this.d = sin * rb + cos * this.d; - } -}; - -// spine-core/src/ConstraintData.ts -var ConstraintData = class { - constructor(name, order, skinRequired) { - this.name = name; - this.order = order; - this.skinRequired = skinRequired; - } -}; - -// spine-core/src/AssetManagerBase.ts -var AssetManagerBase = class { - pathPrefix = ""; - textureLoader; - downloader; - assets = {}; - errors = {}; - toLoad = 0; - loaded = 0; - constructor(textureLoader, pathPrefix = "", downloader = new Downloader()) { - this.textureLoader = textureLoader; - this.pathPrefix = pathPrefix; - this.downloader = downloader; - } - start(path) { - this.toLoad++; - return this.pathPrefix + path; - } - success(callback, path, asset) { - this.toLoad--; - this.loaded++; - this.assets[path] = asset; - if (callback) - callback(path, asset); - } - error(callback, path, message) { - this.toLoad--; - this.loaded++; - this.errors[path] = message; - if (callback) - callback(path, message); - } - loadAll() { - let promise = new Promise((resolve, reject) => { - let check = () => { - if (this.isLoadingComplete()) { - if (this.hasErrors()) - reject(this.errors); - else - resolve(this); - return; - } - requestAnimationFrame(check); - }; - requestAnimationFrame(check); - }); - return promise; - } - setRawDataURI(path, data) { - this.downloader.rawDataUris[this.pathPrefix + path] = data; - } - loadBinary(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - this.downloader.downloadBinary(path, (data) => { - this.success(success, path, data); - }, (status, responseText) => { - this.error(error, path, `Couldn't load binary ${path}: status ${status}, ${responseText}`); - }); - } - loadText(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - this.downloader.downloadText(path, (data) => { - this.success(success, path, data); - }, (status, responseText) => { - this.error(error, path, `Couldn't load text ${path}: status ${status}, ${responseText}`); - }); - } - loadJson(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - this.downloader.downloadJson(path, (data) => { - this.success(success, path, data); - }, (status, responseText) => { - this.error(error, path, `Couldn't load JSON ${path}: status ${status}, ${responseText}`); - }); - } - loadTexture(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - let isBrowser = !!(typeof window !== "undefined" && typeof navigator !== "undefined" && window.document); - let isWebWorker = !isBrowser; - if (isWebWorker) { - fetch(path, { mode: "cors" }).then((response) => { - if (response.ok) - return response.blob(); - this.error(error, path, `Couldn't load image: ${path}`); - return null; - }).then((blob) => { - return blob ? createImageBitmap(blob, { premultiplyAlpha: "none", colorSpaceConversion: "none" }) : null; - }).then((bitmap) => { - if (bitmap) - this.success(success, path, this.textureLoader(bitmap)); - }); - } else { - let image = new Image(); - image.crossOrigin = "anonymous"; - image.onload = () => { - this.success(success, path, this.textureLoader(image)); - }; - image.onerror = () => { - this.error(error, path, `Couldn't load image: ${path}`); - }; - if (this.downloader.rawDataUris[path]) - path = this.downloader.rawDataUris[path]; - image.src = path; - } - } - loadTextureAtlas(path, success = () => { - }, error = () => { - }, fileAlias) { - let index = path.lastIndexOf("/"); - let parent = index >= 0 ? path.substring(0, index + 1) : ""; - path = this.start(path); - this.downloader.downloadText(path, (atlasText) => { - try { - let atlas = new TextureAtlas(atlasText); - let toLoad = atlas.pages.length, abort = false; - for (let page of atlas.pages) { - this.loadTexture( - !fileAlias ? parent + page.name : fileAlias[page.name], - (imagePath, texture) => { - if (!abort) { - page.setTexture(texture); - if (--toLoad == 0) - this.success(success, path, atlas); - } - }, - (imagePath, message) => { - if (!abort) - this.error(error, path, `Couldn't load texture atlas ${path} page image: ${imagePath}`); - abort = true; - } - ); - } - } catch (e) { - this.error(error, path, `Couldn't parse texture atlas ${path}: ${e.message}`); - } - }, (status, responseText) => { - this.error(error, path, `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`); - }); - } - get(path) { - return this.assets[this.pathPrefix + path]; - } - require(path) { - path = this.pathPrefix + path; - let asset = this.assets[path]; - if (asset) - return asset; - let error = this.errors[path]; - throw Error("Asset not found: " + path + (error ? "\n" + error : "")); - } - remove(path) { - path = this.pathPrefix + path; - let asset = this.assets[path]; - if (asset.dispose) - asset.dispose(); - delete this.assets[path]; - return asset; - } - removeAll() { - for (let key in this.assets) { - let asset = this.assets[key]; - if (asset.dispose) - asset.dispose(); - } - this.assets = {}; - } - isLoadingComplete() { - return this.toLoad == 0; - } - getToLoad() { - return this.toLoad; - } - getLoaded() { - return this.loaded; - } - dispose() { - this.removeAll(); - } - hasErrors() { - return Object.keys(this.errors).length > 0; - } - getErrors() { - return this.errors; - } -}; -var Downloader = class { - callbacks = {}; - rawDataUris = {}; - dataUriToString(dataUri) { - if (!dataUri.startsWith("data:")) { - throw new Error("Not a data URI."); - } - let base64Idx = dataUri.indexOf("base64,"); - if (base64Idx != -1) { - base64Idx += "base64,".length; - return atob(dataUri.substr(base64Idx)); - } else { - return dataUri.substr(dataUri.indexOf(",") + 1); - } - } - base64ToUint8Array(base64) { - var binary_string = window.atob(base64); - var len = binary_string.length; - var bytes = new Uint8Array(len); - for (var i = 0; i < len; i++) { - bytes[i] = binary_string.charCodeAt(i); - } - return bytes; - } - dataUriToUint8Array(dataUri) { - if (!dataUri.startsWith("data:")) { - throw new Error("Not a data URI."); - } - let base64Idx = dataUri.indexOf("base64,"); - if (base64Idx == -1) - throw new Error("Not a binary data URI."); - base64Idx += "base64,".length; - return this.base64ToUint8Array(dataUri.substr(base64Idx)); - } - downloadText(url, success, error) { - if (this.start(url, success, error)) - return; - if (this.rawDataUris[url]) { - try { - let dataUri = this.rawDataUris[url]; - this.finish(url, 200, this.dataUriToString(dataUri)); - } catch (e) { - this.finish(url, 400, JSON.stringify(e)); - } - return; - } - let request = new XMLHttpRequest(); - request.overrideMimeType("text/html"); - request.open("GET", url, true); - let done = () => { - this.finish(url, request.status, request.responseText); - }; - request.onload = done; - request.onerror = done; - request.send(); - } - downloadJson(url, success, error) { - this.downloadText(url, (data) => { - success(JSON.parse(data)); - }, error); - } - downloadBinary(url, success, error) { - if (this.start(url, success, error)) - return; - if (this.rawDataUris[url]) { - try { - let dataUri = this.rawDataUris[url]; - this.finish(url, 200, this.dataUriToUint8Array(dataUri)); - } catch (e) { - this.finish(url, 400, JSON.stringify(e)); - } - return; - } - let request = new XMLHttpRequest(); - request.open("GET", url, true); - request.responseType = "arraybuffer"; - let onerror = () => { - this.finish(url, request.status, request.response); - }; - request.onload = () => { - if (request.status == 200 || request.status == 0) - this.finish(url, 200, new Uint8Array(request.response)); - else - onerror(); - }; - request.onerror = onerror; - request.send(); - } - start(url, success, error) { - let callbacks = this.callbacks[url]; - try { - if (callbacks) - return true; - this.callbacks[url] = callbacks = []; - } finally { - callbacks.push(success, error); - } - } - finish(url, status, data) { - let callbacks = this.callbacks[url]; - delete this.callbacks[url]; - let args = status == 200 || status == 0 ? [data] : [status, data]; - for (let i = args.length - 1, n = callbacks.length; i < n; i += 2) - callbacks[i].apply(null, args); - } -}; - -// spine-core/src/Event.ts -var Event = class { - data; - intValue = 0; - floatValue = 0; - stringValue = null; - time = 0; - volume = 0; - balance = 0; - constructor(time, data) { - if (!data) - throw new Error("data cannot be null."); - this.time = time; - this.data = data; - } -}; - -// spine-core/src/EventData.ts -var EventData = class { - name; - intValue = 0; - floatValue = 0; - stringValue = null; - audioPath = null; - volume = 0; - balance = 0; - constructor(name) { - this.name = name; - } -}; - -// spine-core/src/IkConstraint.ts -var IkConstraint = class { - /** The IK constraint's setup pose data. */ - data; - /** The bones that will be modified by this IK constraint. */ - bones; - /** The bone that is the IK target. */ - target; - /** Controls the bend direction of the IK bones, either 1 or -1. */ - bendDirection = 0; - /** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */ - compress = false; - /** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained - * and the parent bone has local nonuniform scale, stretch is not applied. */ - stretch = false; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */ - mix = 1; - /** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */ - softness = 0; - active = false; - constructor(data, skeleton) { - if (!data) - throw new Error("data cannot be null."); - if (!skeleton) - throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = new Array(); - for (let i = 0; i < data.bones.length; i++) { - let bone = skeleton.findBone(data.bones[i].name); - if (!bone) - throw new Error(`Couldn't find bone ${data.bones[i].name}`); - this.bones.push(bone); - } - let target = skeleton.findBone(data.target.name); - if (!target) - throw new Error(`Couldn't find bone ${data.target.name}`); - this.target = target; - this.mix = data.mix; - this.softness = data.softness; - this.bendDirection = data.bendDirection; - this.compress = data.compress; - this.stretch = data.stretch; - } - isActive() { - return this.active; - } - setToSetupPose() { - const data = this.data; - this.mix = data.mix; - this.softness = data.softness; - this.bendDirection = data.bendDirection; - this.compress = data.compress; - this.stretch = data.stretch; - } - update(physics) { - if (this.mix == 0) - return; - let target = this.target; - let bones = this.bones; - switch (bones.length) { - case 1: - this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); - break; - case 2: - this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.data.uniform, this.softness, this.mix); - break; - } - } - /** Applies 1 bone IK. The target is specified in the world coordinate system. */ - apply1(bone, targetX, targetY, compress, stretch, uniform, alpha) { - let p = bone.parent; - if (!p) - throw new Error("IK bone must have parent."); - let pa = p.a, pb = p.b, pc = p.c, pd = p.d; - let rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0; - switch (bone.inherit) { - case 1 /* OnlyTranslation */: - tx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX); - ty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY); - break; - case 2 /* NoRotationOrReflection */: - let s = Math.abs(pa * pd - pb * pc) / Math.max(1e-4, pa * pa + pc * pc); - let sa = pa / bone.skeleton.scaleX; - let sc = pc / bone.skeleton.scaleY; - pb = -sc * s * bone.skeleton.scaleX; - pd = sa * s * bone.skeleton.scaleY; - rotationIK += Math.atan2(sc, sa) * MathUtils.radDeg; - default: - let x = targetX - p.worldX, y = targetY - p.worldY; - let d = pa * pd - pb * pc; - if (Math.abs(d) <= 1e-4) { - tx = 0; - ty = 0; - } else { - tx = (x * pd - y * pb) / d - bone.ax; - ty = (y * pa - x * pc) / d - bone.ay; - } - } - rotationIK += Math.atan2(ty, tx) * MathUtils.radDeg; - if (bone.ascaleX < 0) - rotationIK += 180; - if (rotationIK > 180) - rotationIK -= 360; - else if (rotationIK < -180) - rotationIK += 360; - let sx = bone.ascaleX, sy = bone.ascaleY; - if (compress || stretch) { - switch (bone.inherit) { - case 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: - tx = targetX - bone.worldX; - ty = targetY - bone.worldY; - } - const b = bone.data.length * sx; - if (b > 1e-4) { - const dd = tx * tx + ty * ty; - if (compress && dd < b * b || stretch && dd > b * b) { - const s = (Math.sqrt(dd) / b - 1) * alpha + 1; - sx *= s; - if (uniform) - sy *= s; - } - } - } - bone.updateWorldTransformWith( - bone.ax, - bone.ay, - bone.arotation + rotationIK * alpha, - sx, - sy, - bone.ashearX, - bone.ashearY - ); - } - /** Applies 2 bone IK. The target is specified in the world coordinate system. - * @param child A direct descendant of the parent bone. */ - apply2(parent, child, targetX, targetY, bendDir, stretch, uniform, softness, alpha) { - if (parent.inherit != 0 /* Normal */ || child.inherit != 0 /* Normal */) - return; - let px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX; - let os1 = 0, os2 = 0, s2 = 0; - if (psx < 0) { - psx = -psx; - os1 = 180; - s2 = -1; - } else { - os1 = 0; - s2 = 1; - } - if (psy < 0) { - psy = -psy; - s2 = -s2; - } - if (csx < 0) { - csx = -csx; - os2 = 180; - } else - os2 = 0; - let cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; - let u = Math.abs(psx - psy) <= 1e-4; - if (!u || stretch) { - cy = 0; - cwx = a * cx + parent.worldX; - cwy = c * cx + parent.worldY; - } else { - cy = child.ay; - cwx = a * cx + b * cy + parent.worldX; - cwy = c * cx + d * cy + parent.worldY; - } - let pp = parent.parent; - if (!pp) - throw new Error("IK parent must itself have a parent."); - a = pp.a; - b = pp.b; - c = pp.c; - d = pp.d; - let id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY; - id = Math.abs(id) <= 1e-4 ? 0 : 1 / id; - let dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; - let l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2; - if (l1 < 1e-4) { - this.apply1(parent, targetX, targetY, false, stretch, false, alpha); - child.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); - return; - } - x = targetX - pp.worldX; - y = targetY - pp.worldY; - let tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py; - let dd = tx * tx + ty * ty; - if (softness != 0) { - softness *= psx * (csx + 1) * 0.5; - let td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness; - if (sd > 0) { - let p = Math.min(1, sd / (softness * 2)) - 1; - p = (sd - softness * (1 - p * p)) / td; - tx -= p * tx; - ty -= p * ty; - dd = tx * tx + ty * ty; - } - } - outer: - if (u) { - l2 *= psx; - let cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); - if (cos < -1) { - cos = -1; - a2 = Math.PI * bendDir; - } else if (cos > 1) { - cos = 1; - a2 = 0; - if (stretch) { - a = (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; - sx *= a; - if (uniform) - sy *= a; - } - } else - a2 = Math.acos(cos) * bendDir; - a = l1 + l2 * cos; - b = l2 * Math.sin(a2); - a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); - } else { - a = psx * l2; - b = psy * l2; - let aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); - c = bb * l1 * l1 + aa * dd - aa * bb; - let c1 = -2 * bb * l1, c2 = bb - aa; - d = c1 * c1 - 4 * c2 * c; - if (d >= 0) { - let q = Math.sqrt(d); - if (c1 < 0) - q = -q; - q = -(c1 + q) * 0.5; - let r0 = q / c2, r1 = c / q; - let r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; - r0 = dd - r * r; - if (r0 >= 0) { - y = Math.sqrt(r0) * bendDir; - a1 = ta - Math.atan2(y, r); - a2 = Math.atan2(y / psy, (r - l1) / psx); - break outer; - } - } - let minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; - let maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; - c = -a * l1 / (aa - bb); - if (c >= -1 && c <= 1) { - c = Math.acos(c); - x = a * Math.cos(c) + l1; - y = b * Math.sin(c); - d = x * x + y * y; - if (d < minDist) { - minAngle = c; - minDist = d; - minX = x; - minY = y; - } - if (d > maxDist) { - maxAngle = c; - maxDist = d; - maxX = x; - maxY = y; - } - } - if (dd <= (minDist + maxDist) * 0.5) { - a1 = ta - Math.atan2(minY * bendDir, minX); - a2 = minAngle * bendDir; - } else { - a1 = ta - Math.atan2(maxY * bendDir, maxX); - a2 = maxAngle * bendDir; - } - } - let os = Math.atan2(cy, cx) * s2; - let rotation = parent.arotation; - a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation; - if (a1 > 180) - a1 -= 360; - else if (a1 < -180) - a1 += 360; - parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, sy, 0, 0); - rotation = child.arotation; - a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; - if (a2 > 180) - a2 -= 360; - else if (a2 < -180) - a2 += 360; - child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); - } -}; - -// spine-core/src/IkConstraintData.ts -var IkConstraintData = class extends ConstraintData { - /** The bones that are constrained by this IK constraint. */ - bones = new Array(); - /** The bone that is the IK target. */ - _target = null; - set target(boneData) { - this._target = boneData; - } - get target() { - if (!this._target) - throw new Error("BoneData not set."); - else - return this._target; - } - /** Controls the bend direction of the IK bones, either 1 or -1. */ - bendDirection = 0; - /** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */ - compress = false; - /** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained - * and the parent bone has local nonuniform scale, stretch is not applied. */ - stretch = false; - /** When true, only a single bone is being constrained, and {@link #getCompress()} or {@link #getStretch()} is used, the bone - * is scaled on both the X and Y axes. */ - uniform = false; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */ - mix = 0; - /** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */ - softness = 0; - constructor(name) { - super(name, 0, false); - } -}; - -// spine-core/src/PathConstraintData.ts -var PathConstraintData = class extends ConstraintData { - /** The bones that will be modified by this path constraint. */ - bones = new Array(); - /** The slot whose path attachment will be used to constrained the bones. */ - _target = null; - set target(slotData) { - this._target = slotData; - } - get target() { - if (!this._target) - throw new Error("SlotData not set."); - else - return this._target; - } - /** The mode for positioning the first bone on the path. */ - positionMode = PositionMode.Fixed; - /** The mode for positioning the bones after the first bone on the path. */ - spacingMode = SpacingMode.Fixed; - /** The mode for adjusting the rotation of the bones. */ - rotateMode = RotateMode.Chain; - /** An offset added to the constrained bone rotation. */ - offsetRotation = 0; - /** The position along the path. */ - position = 0; - /** The spacing between bones. */ - spacing = 0; - mixRotate = 0; - mixX = 0; - mixY = 0; - constructor(name) { - super(name, 0, false); - } -}; -var PositionMode = /* @__PURE__ */ ((PositionMode2) => { - PositionMode2[PositionMode2["Fixed"] = 0] = "Fixed"; - PositionMode2[PositionMode2["Percent"] = 1] = "Percent"; - return PositionMode2; -})(PositionMode || {}); -var SpacingMode = /* @__PURE__ */ ((SpacingMode2) => { - SpacingMode2[SpacingMode2["Length"] = 0] = "Length"; - SpacingMode2[SpacingMode2["Fixed"] = 1] = "Fixed"; - SpacingMode2[SpacingMode2["Percent"] = 2] = "Percent"; - SpacingMode2[SpacingMode2["Proportional"] = 3] = "Proportional"; - return SpacingMode2; -})(SpacingMode || {}); -var RotateMode = /* @__PURE__ */ ((RotateMode2) => { - RotateMode2[RotateMode2["Tangent"] = 0] = "Tangent"; - RotateMode2[RotateMode2["Chain"] = 1] = "Chain"; - RotateMode2[RotateMode2["ChainScale"] = 2] = "ChainScale"; - return RotateMode2; -})(RotateMode || {}); - -// spine-core/src/PathConstraint.ts -var _PathConstraint = class { - /** The path constraint's setup pose data. */ - data; - /** The bones that will be modified by this path constraint. */ - bones; - /** The slot whose path attachment will be used to constrained the bones. */ - target; - /** The position along the path. */ - position = 0; - /** The spacing between bones. */ - spacing = 0; - mixRotate = 0; - mixX = 0; - mixY = 0; - spaces = new Array(); - positions = new Array(); - world = new Array(); - curves = new Array(); - lengths = new Array(); - segments = new Array(); - active = false; - constructor(data, skeleton) { - if (!data) - throw new Error("data cannot be null."); - if (!skeleton) - throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = new Array(); - for (let i = 0, n = data.bones.length; i < n; i++) { - let bone = skeleton.findBone(data.bones[i].name); - if (!bone) - throw new Error(`Couldn't find bone ${data.bones[i].name}.`); - this.bones.push(bone); - } - let target = skeleton.findSlot(data.target.name); - if (!target) - throw new Error(`Couldn't find target bone ${data.target.name}`); - this.target = target; - this.position = data.position; - this.spacing = data.spacing; - this.mixRotate = data.mixRotate; - this.mixX = data.mixX; - this.mixY = data.mixY; - } - isActive() { - return this.active; - } - setToSetupPose() { - const data = this.data; - this.position = data.position; - this.spacing = data.spacing; - this.mixRotate = data.mixRotate; - this.mixX = data.mixX; - this.mixY = data.mixY; - } - update(physics) { - let attachment = this.target.getAttachment(); - if (!(attachment instanceof PathAttachment)) - return; - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY; - if (mixRotate == 0 && mixX == 0 && mixY == 0) - return; - let data = this.data; - let tangents = data.rotateMode == 0 /* Tangent */, scale = data.rotateMode == 2 /* ChainScale */; - let bones = this.bones; - let boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1; - let spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : []; - let spacing = this.spacing; - switch (data.spacingMode) { - case 2 /* Percent */: - if (scale) { - for (let i = 0, n = spacesCount - 1; i < n; i++) { - let bone = bones[i]; - let setupLength = bone.data.length; - let x = setupLength * bone.a, y = setupLength * bone.c; - lengths[i] = Math.sqrt(x * x + y * y); - } - } - Utils.arrayFill(spaces, 1, spacesCount, spacing); - break; - case 3 /* Proportional */: - let sum = 0; - for (let i = 0, n = spacesCount - 1; i < n; ) { - let bone = bones[i]; - let setupLength = bone.data.length; - if (setupLength < _PathConstraint.epsilon) { - if (scale) - lengths[i] = 0; - spaces[++i] = spacing; - } else { - let x = setupLength * bone.a, y = setupLength * bone.c; - let length = Math.sqrt(x * x + y * y); - if (scale) - lengths[i] = length; - spaces[++i] = length; - sum += length; - } - } - if (sum > 0) { - sum = spacesCount / sum * spacing; - for (let i = 1; i < spacesCount; i++) - spaces[i] *= sum; - } - break; - default: - let lengthSpacing = data.spacingMode == 0 /* Length */; - for (let i = 0, n = spacesCount - 1; i < n; ) { - let bone = bones[i]; - let setupLength = bone.data.length; - if (setupLength < _PathConstraint.epsilon) { - if (scale) - lengths[i] = 0; - spaces[++i] = spacing; - } else { - let x = setupLength * bone.a, y = setupLength * bone.c; - let length = Math.sqrt(x * x + y * y); - if (scale) - lengths[i] = length; - spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength; - } - } - } - let positions = this.computeWorldPositions(attachment, spacesCount, tangents); - let boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; - let tip = false; - if (offsetRotation == 0) - tip = data.rotateMode == 1 /* Chain */; - else { - tip = false; - let p = this.target.bone; - offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad; - } - for (let i = 0, p = 3; i < boneCount; i++, p += 3) { - let bone = bones[i]; - bone.worldX += (boneX - bone.worldX) * mixX; - bone.worldY += (boneY - bone.worldY) * mixY; - let x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; - if (scale) { - let length = lengths[i]; - if (length != 0) { - let s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * mixRotate + 1; - bone.a *= s; - bone.c *= s; - } - } - boneX = x; - boneY = y; - if (mixRotate > 0) { - let a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; - if (tangents) - r = positions[p - 1]; - else if (spaces[i + 1] == 0) - r = positions[p + 2]; - else - r = Math.atan2(dy, dx); - r -= Math.atan2(c, a); - if (tip) { - cos = Math.cos(r); - sin = Math.sin(r); - let length = bone.data.length; - boneX += (length * (cos * a - sin * c) - dx) * mixRotate; - boneY += (length * (sin * a + cos * c) - dy) * mixRotate; - } else { - r += offsetRotation; - } - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r *= mixRotate; - cos = Math.cos(r); - sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - } - bone.updateAppliedTransform(); - } - } - computeWorldPositions(path, spacesCount, tangents) { - let target = this.target; - let position = this.position; - let spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = this.world; - let closed2 = path.closed; - let verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = _PathConstraint.NONE; - if (!path.constantSpeed) { - let lengths = path.lengths; - curveCount -= closed2 ? 1 : 2; - let pathLength2 = lengths[curveCount]; - if (this.data.positionMode == 1 /* Percent */) - position *= pathLength2; - let multiplier2; - switch (this.data.spacingMode) { - case 2 /* Percent */: - multiplier2 = pathLength2; - break; - case 3 /* Proportional */: - multiplier2 = pathLength2 / spacesCount; - break; - default: - multiplier2 = 1; - } - world = Utils.setArraySize(this.world, 8); - for (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { - let space = spaces[i] * multiplier2; - position += space; - let p = position; - if (closed2) { - p %= pathLength2; - if (p < 0) - p += pathLength2; - curve = 0; - } else if (p < 0) { - if (prevCurve != _PathConstraint.BEFORE) { - prevCurve = _PathConstraint.BEFORE; - path.computeWorldVertices(target, 2, 4, world, 0, 2); - } - this.addBeforePosition(p, world, 0, out, o); - continue; - } else if (p > pathLength2) { - if (prevCurve != _PathConstraint.AFTER) { - prevCurve = _PathConstraint.AFTER; - path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); - } - this.addAfterPosition(p - pathLength2, world, 0, out, o); - continue; - } - for (; ; curve++) { - let length = lengths[curve]; - if (p > length) - continue; - if (curve == 0) - p /= length; - else { - let prev = lengths[curve - 1]; - p = (p - prev) / (length - prev); - } - break; - } - if (curve != prevCurve) { - prevCurve = curve; - if (closed2 && curve == curveCount) { - path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); - path.computeWorldVertices(target, 0, 4, world, 4, 2); - } else - path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); - } - this.addCurvePosition( - p, - world[0], - world[1], - world[2], - world[3], - world[4], - world[5], - world[6], - world[7], - out, - o, - tangents || i > 0 && space == 0 - ); - } - return out; - } - if (closed2) { - verticesLength += 2; - world = Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); - path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); - world[verticesLength - 2] = world[0]; - world[verticesLength - 1] = world[1]; - } else { - curveCount--; - verticesLength -= 4; - world = Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); - } - let curves = Utils.setArraySize(this.curves, curveCount); - let pathLength = 0; - let x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; - let tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; - for (let i = 0, w = 2; i < curveCount; i++, w += 6) { - cx1 = world[w]; - cy1 = world[w + 1]; - cx2 = world[w + 2]; - cy2 = world[w + 3]; - x2 = world[w + 4]; - y2 = world[w + 5]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; - tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; - dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - curves[i] = pathLength; - x1 = x2; - y1 = y2; - } - if (this.data.positionMode == 1 /* Percent */) - position *= pathLength; - let multiplier; - switch (this.data.spacingMode) { - case 2 /* Percent */: - multiplier = pathLength; - break; - case 3 /* Proportional */: - multiplier = pathLength / spacesCount; - break; - default: - multiplier = 1; - } - let segments = this.segments; - let curveLength = 0; - for (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { - let space = spaces[i] * multiplier; - position += space; - let p = position; - if (closed2) { - p %= pathLength; - if (p < 0) - p += pathLength; - curve = 0; - } else if (p < 0) { - this.addBeforePosition(p, world, 0, out, o); - continue; - } else if (p > pathLength) { - this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); - continue; - } - for (; ; curve++) { - let length = curves[curve]; - if (p > length) - continue; - if (curve == 0) - p /= length; - else { - let prev = curves[curve - 1]; - p = (p - prev) / (length - prev); - } - break; - } - if (curve != prevCurve) { - prevCurve = curve; - let ii = curve * 6; - x1 = world[ii]; - y1 = world[ii + 1]; - cx1 = world[ii + 2]; - cy1 = world[ii + 3]; - cx2 = world[ii + 4]; - cy2 = world[ii + 5]; - x2 = world[ii + 6]; - y2 = world[ii + 7]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.03; - tmpy = (y1 - cy1 * 2 + cy2) * 0.03; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 6e-3; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 6e-3; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; - dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; - curveLength = Math.sqrt(dfx * dfx + dfy * dfy); - segments[0] = curveLength; - for (ii = 1; ii < 8; ii++) { - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[ii] = curveLength; - } - dfx += ddfx; - dfy += ddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[8] = curveLength; - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[9] = curveLength; - segment = 0; - } - p *= curveLength; - for (; ; segment++) { - let length = segments[segment]; - if (p > length) - continue; - if (segment == 0) - p /= length; - else { - let prev = segments[segment - 1]; - p = segment + (p - prev) / (length - prev); - } - break; - } - this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || i > 0 && space == 0); - } - return out; - } - addBeforePosition(p, temp, i, out, o) { - let x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); - out[o] = x1 + p * Math.cos(r); - out[o + 1] = y1 + p * Math.sin(r); - out[o + 2] = r; - } - addAfterPosition(p, temp, i, out, o) { - let x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); - out[o] = x1 + p * Math.cos(r); - out[o + 1] = y1 + p * Math.sin(r); - out[o + 2] = r; - } - addCurvePosition(p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { - if (p == 0 || isNaN(p)) { - out[o] = x1; - out[o + 1] = y1; - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - return; - } - let tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; - let ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; - let x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; - out[o] = x; - out[o + 1] = y; - if (tangents) { - if (p < 1e-3) - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - else - out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); - } - } -}; -var PathConstraint = _PathConstraint; -__publicField(PathConstraint, "NONE", -1); -__publicField(PathConstraint, "BEFORE", -2); -__publicField(PathConstraint, "AFTER", -3); -__publicField(PathConstraint, "epsilon", 1e-5); - -// spine-core/src/PhysicsConstraint.ts -var PhysicsConstraint = class { - data; - _bone = null; - /** The bone constrained by this physics constraint. */ - set bone(bone) { - this._bone = bone; - } - get bone() { - if (!this._bone) - throw new Error("Bone not set."); - else - return this._bone; - } - inertia = 0; - strength = 0; - damping = 0; - massInverse = 0; - wind = 0; - gravity = 0; - mix = 0; - _reset = true; - ux = 0; - uy = 0; - cx = 0; - cy = 0; - tx = 0; - ty = 0; - xOffset = 0; - xVelocity = 0; - yOffset = 0; - yVelocity = 0; - rotateOffset = 0; - rotateVelocity = 0; - scaleOffset = 0; - scaleVelocity = 0; - active = false; - skeleton; - remaining = 0; - lastTime = 0; - constructor(data, skeleton) { - this.data = data; - this.skeleton = skeleton; - this.bone = skeleton.bones[data.bone.index]; - this.inertia = data.inertia; - this.strength = data.strength; - this.damping = data.damping; - this.massInverse = data.massInverse; - this.wind = data.wind; - this.gravity = data.gravity; - this.mix = data.mix; - } - reset() { - this.remaining = 0; - this.lastTime = this.skeleton.time; - this._reset = true; - this.xOffset = 0; - this.xVelocity = 0; - this.yOffset = 0; - this.yVelocity = 0; - this.rotateOffset = 0; - this.rotateVelocity = 0; - this.scaleOffset = 0; - this.scaleVelocity = 0; - } - setToSetupPose() { - const data = this.data; - this.inertia = data.inertia; - this.strength = data.strength; - this.damping = data.damping; - this.massInverse = data.massInverse; - this.wind = data.wind; - this.gravity = data.gravity; - this.mix = data.mix; - } - isActive() { - return this.active; - } - /** Applies the constraint to the constrained bones. */ - update(physics) { - const mix = this.mix; - if (mix == 0) - return; - const x = this.data.x > 0, y = this.data.y > 0, rotateOrShearX = this.data.rotate > 0 || this.data.shearX > 0, scaleX = this.data.scaleX > 0; - const bone = this.bone; - const l = bone.data.length; - switch (physics) { - case 0 /* none */: - return; - case 1 /* reset */: - this.reset(); - case 2 /* update */: - const skeleton = this.skeleton; - const delta = Math.max(this.skeleton.time - this.lastTime, 0); - this.remaining += delta; - this.lastTime = skeleton.time; - const bx = bone.worldX, by = bone.worldY; - if (this._reset) { - this._reset = false; - this.ux = bx; - this.uy = by; - } else { - let a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1; - let qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY); - qx *= Math.abs(skeleton.scaleX); - if (x || y) { - if (x) { - const u = (this.ux - bx) * i; - this.xOffset += u > qx ? qx : u < -qx ? -qx : u; - this.ux = bx; - } - if (y) { - const u = (this.uy - by) * i; - this.yOffset += u > qy ? qy : u < -qy ? -qy : u; - this.uy = by; - } - if (a >= t) { - d = Math.pow(this.damping, 60 * t); - const m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = this.gravity * f * skeleton.scaleY; - do { - if (x) { - this.xVelocity += (w - this.xOffset * e) * m; - this.xOffset += this.xVelocity * t; - this.xVelocity *= d; - } - if (y) { - this.yVelocity -= (g + this.yOffset * e) * m; - this.yOffset += this.yVelocity * t; - this.yVelocity *= d; - } - a -= t; - } while (a >= t); - } - if (x) - bone.worldX += this.xOffset * mix * this.data.x; - if (y) - bone.worldY += this.yOffset * mix * this.data.y; - } - if (rotateOrShearX || scaleX) { - let ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0; - let dx = this.cx - bone.worldX, dy = this.cy - bone.worldY; - if (dx > qx) - dx = qx; - else if (dx < -qx) - dx = -qx; - if (dy > qy) - dy = qy; - else if (dy < -qy) - dy = -qy; - if (rotateOrShearX) { - mr = (this.data.rotate + this.data.shearX) * mix; - let r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr; - this.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i; - r = this.rotateOffset * mr + ca; - c = Math.cos(r); - s = Math.sin(r); - if (scaleX) { - r = l * bone.getWorldScaleX(); - if (r > 0) - this.scaleOffset += (dx * c + dy * s) * i / r; - } - } else { - c = Math.cos(ca); - s = Math.sin(ca); - const r = l * bone.getWorldScaleX(); - if (r > 0) - this.scaleOffset += (dx * c + dy * s) * i / r; - } - a = this.remaining; - if (a >= t) { - if (d == -1) - d = Math.pow(this.damping, 60 * t); - const m = this.massInverse * t, e = this.strength, w = this.wind, g = Skeleton.yDown ? -this.gravity : this.gravity, h = l / f; - while (true) { - a -= t; - if (scaleX) { - this.scaleVelocity += (w * c - g * s - this.scaleOffset * e) * m; - this.scaleOffset += this.scaleVelocity * t; - this.scaleVelocity *= d; - } - if (rotateOrShearX) { - this.rotateVelocity -= ((w * s + g * c) * h + this.rotateOffset * e) * m; - this.rotateOffset += this.rotateVelocity * t; - this.rotateVelocity *= d; - if (a < t) - break; - const r = this.rotateOffset * mr + ca; - c = Math.cos(r); - s = Math.sin(r); - } else if (a < t) - break; - } - } - } - this.remaining = a; - } - this.cx = bone.worldX; - this.cy = bone.worldY; - break; - case 3 /* pose */: - if (x) - bone.worldX += this.xOffset * mix * this.data.x; - if (y) - bone.worldY += this.yOffset * mix * this.data.y; - } - if (rotateOrShearX) { - let o = this.rotateOffset * mix, s = 0, c = 0, a = 0; - if (this.data.shearX > 0) { - let r = 0; - if (this.data.rotate > 0) { - r = o * this.data.rotate; - s = Math.sin(r); - c = Math.cos(r); - a = bone.b; - bone.b = c * a - s * bone.d; - bone.d = s * a + c * bone.d; - } - r += o * this.data.shearX; - s = Math.sin(r); - c = Math.cos(r); - a = bone.a; - bone.a = c * a - s * bone.c; - bone.c = s * a + c * bone.c; - } else { - o *= this.data.rotate; - s = Math.sin(o); - c = Math.cos(o); - a = bone.a; - bone.a = c * a - s * bone.c; - bone.c = s * a + c * bone.c; - a = bone.b; - bone.b = c * a - s * bone.d; - bone.d = s * a + c * bone.d; - } - } - if (scaleX) { - const s = 1 + this.scaleOffset * mix * this.data.scaleX; - bone.a *= s; - bone.c *= s; - } - if (physics != 3 /* pose */) { - this.tx = l * bone.a; - this.ty = l * bone.c; - } - bone.updateAppliedTransform(); - } - /** Translates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone moved an additional - * amount in world space. */ - translate(x, y) { - this.ux -= x; - this.uy -= y; - this.cx -= x; - this.cy -= y; - } - /** Rotates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone rotated around the - * specified point in world space. */ - rotate(x, y, degrees) { - const r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r); - const dx = this.cx - x, dy = this.cy - y; - this.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy); - } -}; - -// spine-core/src/Slot.ts -var Slot = class { - /** The slot's setup pose data. */ - data; - /** The bone this slot belongs to. */ - bone; - /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two - * color tinting. */ - color; - /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark - * color's alpha is not used. */ - darkColor = null; - attachment = null; - attachmentState = 0; - /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the - * {@link Sequence#getSetupIndex()}. */ - sequenceIndex = -1; - /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a - * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions. - * - * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */ - deform = new Array(); - constructor(data, bone) { - if (!data) - throw new Error("data cannot be null."); - if (!bone) - throw new Error("bone cannot be null."); - this.data = data; - this.bone = bone; - this.color = new Color(); - this.darkColor = !data.darkColor ? null : new Color(); - this.setToSetupPose(); - } - /** The skeleton this slot belongs to. */ - getSkeleton() { - return this.bone.skeleton; - } - /** The current attachment for the slot, or null if the slot has no attachment. */ - getAttachment() { - return this.attachment; - } - /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}. - * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the - * specified attachment. */ - setAttachment(attachment) { - if (this.attachment == attachment) - return; - if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.timelineAttachment != this.attachment.timelineAttachment) { - this.deform.length = 0; - } - this.attachment = attachment; - this.sequenceIndex = -1; - } - /** Sets this slot to the setup pose. */ - setToSetupPose() { - this.color.setFromColor(this.data.color); - if (this.darkColor) - this.darkColor.setFromColor(this.data.darkColor); - if (!this.data.attachmentName) - this.attachment = null; - else { - this.attachment = null; - this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); - } - } -}; - -// spine-core/src/TransformConstraint.ts -var TransformConstraint = class { - /** The transform constraint's setup pose data. */ - data; - /** The bones that will be modified by this transform constraint. */ - bones; - /** The target bone whose world transform will be copied to the constrained bones. */ - target; - mixRotate = 0; - mixX = 0; - mixY = 0; - mixScaleX = 0; - mixScaleY = 0; - mixShearY = 0; - temp = new Vector2(); - active = false; - constructor(data, skeleton) { - if (!data) - throw new Error("data cannot be null."); - if (!skeleton) - throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = new Array(); - for (let i = 0; i < data.bones.length; i++) { - let bone = skeleton.findBone(data.bones[i].name); - if (!bone) - throw new Error(`Couldn't find bone ${data.bones[i].name}.`); - this.bones.push(bone); - } - let target = skeleton.findBone(data.target.name); - if (!target) - throw new Error(`Couldn't find target bone ${data.target.name}.`); - this.target = target; - this.mixRotate = data.mixRotate; - this.mixX = data.mixX; - this.mixY = data.mixY; - this.mixScaleX = data.mixScaleX; - this.mixScaleY = data.mixScaleY; - this.mixShearY = data.mixShearY; - } - isActive() { - return this.active; - } - setToSetupPose() { - const data = this.data; - this.mixRotate = data.mixRotate; - this.mixX = data.mixX; - this.mixY = data.mixY; - this.mixScaleX = data.mixScaleX; - this.mixScaleY = data.mixScaleY; - this.mixShearY = data.mixShearY; - } - update(physics) { - if (this.mixRotate == 0 && this.mixX == 0 && this.mixY == 0 && this.mixScaleX == 0 && this.mixScaleY == 0 && this.mixShearY == 0) - return; - if (this.data.local) { - if (this.data.relative) - this.applyRelativeLocal(); - else - this.applyAbsoluteLocal(); - } else { - if (this.data.relative) - this.applyRelativeWorld(); - else - this.applyAbsoluteWorld(); - } - } - applyAbsoluteWorld() { - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY; - let translate = mixX != 0 || mixY != 0; - let target = this.target; - let ta = target.a, tb = target.b, tc = target.c, td = target.d; - let degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad; - let offsetRotation = this.data.offsetRotation * degRadReflect; - let offsetShearY = this.data.offsetShearY * degRadReflect; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (mixRotate != 0) { - let a = bone.a, b = bone.b, c = bone.c, d = bone.d; - let r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r *= mixRotate; - let cos = Math.cos(r), sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - } - if (translate) { - let temp = this.temp; - target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - bone.worldX += (temp.x - bone.worldX) * mixX; - bone.worldY += (temp.y - bone.worldY) * mixY; - } - if (mixScaleX != 0) { - let s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); - if (s != 0) - s = (s + (Math.sqrt(ta * ta + tc * tc) - s + this.data.offsetScaleX) * mixScaleX) / s; - bone.a *= s; - bone.c *= s; - } - if (mixScaleY != 0) { - let s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); - if (s != 0) - s = (s + (Math.sqrt(tb * tb + td * td) - s + this.data.offsetScaleY) * mixScaleY) / s; - bone.b *= s; - bone.d *= s; - } - if (mixShearY > 0) { - let b = bone.b, d = bone.d; - let by = Math.atan2(d, b); - let r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r = by + (r + offsetShearY) * mixShearY; - let s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(r) * s; - bone.d = Math.sin(r) * s; - } - bone.updateAppliedTransform(); - } - } - applyRelativeWorld() { - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY; - let translate = mixX != 0 || mixY != 0; - let target = this.target; - let ta = target.a, tb = target.b, tc = target.c, td = target.d; - let degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad; - let offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (mixRotate != 0) { - let a = bone.a, b = bone.b, c = bone.c, d = bone.d; - let r = Math.atan2(tc, ta) + offsetRotation; - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r *= mixRotate; - let cos = Math.cos(r), sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - } - if (translate) { - let temp = this.temp; - target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - bone.worldX += temp.x * mixX; - bone.worldY += temp.y * mixY; - } - if (mixScaleX != 0) { - let s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * mixScaleX + 1; - bone.a *= s; - bone.c *= s; - } - if (mixScaleY != 0) { - let s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * mixScaleY + 1; - bone.b *= s; - bone.d *= s; - } - if (mixShearY > 0) { - let r = Math.atan2(td, tb) - Math.atan2(tc, ta); - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - let b = bone.b, d = bone.d; - r = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * mixShearY; - let s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(r) * s; - bone.d = Math.sin(r) * s; - } - bone.updateAppliedTransform(); - } - } - applyAbsoluteLocal() { - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY; - let target = this.target; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - let rotation = bone.arotation; - if (mixRotate != 0) - rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate; - let x = bone.ax, y = bone.ay; - x += (target.ax - x + this.data.offsetX) * mixX; - y += (target.ay - y + this.data.offsetY) * mixY; - let scaleX = bone.ascaleX, scaleY = bone.ascaleY; - if (mixScaleX != 0 && scaleX != 0) - scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * mixScaleX) / scaleX; - if (mixScaleY != 0 && scaleY != 0) - scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY; - let shearY = bone.ashearY; - if (mixShearY != 0) - shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY; - bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); - } - } - applyRelativeLocal() { - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY; - let target = this.target; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - let rotation = bone.arotation + (target.arotation + this.data.offsetRotation) * mixRotate; - let x = bone.ax + (target.ax + this.data.offsetX) * mixX; - let y = bone.ay + (target.ay + this.data.offsetY) * mixY; - let scaleX = bone.ascaleX * ((target.ascaleX - 1 + this.data.offsetScaleX) * mixScaleX + 1); - let scaleY = bone.ascaleY * ((target.ascaleY - 1 + this.data.offsetScaleY) * mixScaleY + 1); - let shearY = bone.ashearY + (target.ashearY + this.data.offsetShearY) * mixShearY; - bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); - } - } -}; - -// spine-core/src/Skeleton.ts -var _Skeleton = class { - /** The skeleton's setup pose data. */ - data; - /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ - bones; - /** The skeleton's slots in the setup pose draw order. */ - slots; - /** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */ - drawOrder; - /** The skeleton's IK constraints. */ - ikConstraints; - /** The skeleton's transform constraints. */ - transformConstraints; - /** The skeleton's path constraints. */ - pathConstraints; - /** The skeleton's physics constraints. */ - physicsConstraints; - /** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}. */ - _updateCache = new Array(); - /** The skeleton's current skin. May be null. */ - skin = null; - /** The color to tint all the skeleton's attachments. */ - color; - /** Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale - * inheritance. */ - scaleX = 1; - /** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale - * inheritance. */ - _scaleY = 1; - get scaleY() { - return _Skeleton.yDown ? -this._scaleY : this._scaleY; - } - set scaleY(scaleY) { - this._scaleY = scaleY; - } - /** Sets the skeleton X position, which is added to the root bone worldX position. */ - x = 0; - /** Sets the skeleton Y position, which is added to the root bone worldY position. */ - y = 0; - /** Returns the skeleton's time. This is used for time-based manipulations, such as {@link PhysicsConstraint}. - *

- * See {@link #update(float)}. */ - time = 0; - constructor(data) { - if (!data) - throw new Error("data cannot be null."); - this.data = data; - this.bones = new Array(); - for (let i = 0; i < data.bones.length; i++) { - let boneData = data.bones[i]; - let bone; - if (!boneData.parent) - bone = new Bone(boneData, this, null); - else { - let parent = this.bones[boneData.parent.index]; - bone = new Bone(boneData, this, parent); - parent.children.push(bone); - } - this.bones.push(bone); - } - this.slots = new Array(); - this.drawOrder = new Array(); - for (let i = 0; i < data.slots.length; i++) { - let slotData = data.slots[i]; - let bone = this.bones[slotData.boneData.index]; - let slot = new Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - this.ikConstraints = new Array(); - for (let i = 0; i < data.ikConstraints.length; i++) { - let ikConstraintData = data.ikConstraints[i]; - this.ikConstraints.push(new IkConstraint(ikConstraintData, this)); - } - this.transformConstraints = new Array(); - for (let i = 0; i < data.transformConstraints.length; i++) { - let transformConstraintData = data.transformConstraints[i]; - this.transformConstraints.push(new TransformConstraint(transformConstraintData, this)); - } - this.pathConstraints = new Array(); - for (let i = 0; i < data.pathConstraints.length; i++) { - let pathConstraintData = data.pathConstraints[i]; - this.pathConstraints.push(new PathConstraint(pathConstraintData, this)); - } - this.physicsConstraints = new Array(); - for (let i = 0; i < data.physicsConstraints.length; i++) { - let physicsConstraintData = data.physicsConstraints[i]; - this.physicsConstraints.push(new PhysicsConstraint(physicsConstraintData, this)); - } - this.color = new Color(1, 1, 1, 1); - this.updateCache(); - } - /** Caches information about bones and constraints. Must be called if the {@link #getSkin()} is modified or if bones, - * constraints, or weighted path attachments are added or removed. */ - updateCache() { - let updateCache = this._updateCache; - updateCache.length = 0; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - bone.sorted = bone.data.skinRequired; - bone.active = !bone.sorted; - } - if (this.skin) { - let skinBones = this.skin.bones; - for (let i = 0, n = this.skin.bones.length; i < n; i++) { - let bone = this.bones[skinBones[i].index]; - do { - bone.sorted = false; - bone.active = true; - bone = bone.parent; - } while (bone); - } - } - let ikConstraints = this.ikConstraints; - let transformConstraints = this.transformConstraints; - let pathConstraints = this.pathConstraints; - let physicsConstraints = this.physicsConstraints; - let ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length, physicsCount = this.physicsConstraints.length; - let constraintCount = ikCount + transformCount + pathCount + physicsCount; - outer: - for (let i = 0; i < constraintCount; i++) { - for (let ii = 0; ii < ikCount; ii++) { - let constraint = ikConstraints[ii]; - if (constraint.data.order == i) { - this.sortIkConstraint(constraint); - continue outer; - } - } - for (let ii = 0; ii < transformCount; ii++) { - let constraint = transformConstraints[ii]; - if (constraint.data.order == i) { - this.sortTransformConstraint(constraint); - continue outer; - } - } - for (let ii = 0; ii < pathCount; ii++) { - let constraint = pathConstraints[ii]; - if (constraint.data.order == i) { - this.sortPathConstraint(constraint); - continue outer; - } - } - for (let ii = 0; ii < physicsCount; ii++) { - const constraint = physicsConstraints[ii]; - if (constraint.data.order == i) { - this.sortPhysicsConstraint(constraint); - continue outer; - } - } - } - for (let i = 0, n = bones.length; i < n; i++) - this.sortBone(bones[i]); - } - sortIkConstraint(constraint) { - constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || this.skin && Utils.contains(this.skin.constraints, constraint.data, true)); - if (!constraint.active) - return; - let target = constraint.target; - this.sortBone(target); - let constrained = constraint.bones; - let parent = constrained[0]; - this.sortBone(parent); - if (constrained.length == 1) { - this._updateCache.push(constraint); - this.sortReset(parent.children); - } else { - let child = constrained[constrained.length - 1]; - this.sortBone(child); - this._updateCache.push(constraint); - this.sortReset(parent.children); - child.sorted = true; - } - } - sortPathConstraint(constraint) { - constraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || this.skin && Utils.contains(this.skin.constraints, constraint.data, true)); - if (!constraint.active) - return; - let slot = constraint.target; - let slotIndex = slot.data.index; - let slotBone = slot.bone; - if (this.skin) - this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); - if (this.data.defaultSkin && this.data.defaultSkin != this.skin) - this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); - for (let i = 0, n = this.data.skins.length; i < n; i++) - this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); - let attachment = slot.getAttachment(); - if (attachment instanceof PathAttachment) - this.sortPathConstraintAttachmentWith(attachment, slotBone); - let constrained = constraint.bones; - let boneCount = constrained.length; - for (let i = 0; i < boneCount; i++) - this.sortBone(constrained[i]); - this._updateCache.push(constraint); - for (let i = 0; i < boneCount; i++) - this.sortReset(constrained[i].children); - for (let i = 0; i < boneCount; i++) - constrained[i].sorted = true; - } - sortTransformConstraint(constraint) { - constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || this.skin && Utils.contains(this.skin.constraints, constraint.data, true)); - if (!constraint.active) - return; - this.sortBone(constraint.target); - let constrained = constraint.bones; - let boneCount = constrained.length; - if (constraint.data.local) { - for (let i = 0; i < boneCount; i++) { - let child = constrained[i]; - this.sortBone(child.parent); - this.sortBone(child); - } - } else { - for (let i = 0; i < boneCount; i++) { - this.sortBone(constrained[i]); - } - } - this._updateCache.push(constraint); - for (let i = 0; i < boneCount; i++) - this.sortReset(constrained[i].children); - for (let i = 0; i < boneCount; i++) - constrained[i].sorted = true; - } - sortPathConstraintAttachment(skin, slotIndex, slotBone) { - let attachments = skin.attachments[slotIndex]; - if (!attachments) - return; - for (let key in attachments) { - this.sortPathConstraintAttachmentWith(attachments[key], slotBone); - } - } - sortPathConstraintAttachmentWith(attachment, slotBone) { - if (!(attachment instanceof PathAttachment)) - return; - let pathBones = attachment.bones; - if (!pathBones) - this.sortBone(slotBone); - else { - let bones = this.bones; - for (let i = 0, n = pathBones.length; i < n; ) { - let nn = pathBones[i++]; - nn += i; - while (i < nn) - this.sortBone(bones[pathBones[i++]]); - } - } - } - sortPhysicsConstraint(constraint) { - const bone = constraint.bone; - constraint.active = bone.active && (!constraint.data.skinRequired || this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)); - if (!constraint.active) - return; - this.sortBone(bone); - this._updateCache.push(constraint); - this.sortReset(bone.children); - bone.sorted = true; - } - sortBone(bone) { - if (!bone) - return; - if (bone.sorted) - return; - let parent = bone.parent; - if (parent) - this.sortBone(parent); - bone.sorted = true; - this._updateCache.push(bone); - } - sortReset(bones) { - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (!bone.active) - continue; - if (bone.sorted) - this.sortReset(bone.children); - bone.sorted = false; - } - } - /** Updates the world transform for each bone and applies all constraints. - * - * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine - * Runtimes Guide. */ - updateWorldTransform(physics) { - if (physics === void 0 || physics === null) - throw new Error("physics is undefined"); - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - bone.ax = bone.x; - bone.ay = bone.y; - bone.arotation = bone.rotation; - bone.ascaleX = bone.scaleX; - bone.ascaleY = bone.scaleY; - bone.ashearX = bone.shearX; - bone.ashearY = bone.shearY; - } - let updateCache = this._updateCache; - for (let i = 0, n = updateCache.length; i < n; i++) - updateCache[i].update(physics); - } - updateWorldTransformWith(physics, parent) { - if (!parent) - throw new Error("parent cannot be null."); - let bones = this.bones; - for (let i = 1, n = bones.length; i < n; i++) { - let bone = bones[i]; - bone.ax = bone.x; - bone.ay = bone.y; - bone.arotation = bone.rotation; - bone.ascaleX = bone.scaleX; - bone.ascaleY = bone.scaleY; - bone.ashearX = bone.shearX; - bone.ashearY = bone.shearY; - } - let rootBone = this.getRootBone(); - if (!rootBone) - throw new Error("Root bone must not be null."); - let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - rootBone.worldX = pa * this.x + pb * this.y + parent.worldX; - rootBone.worldY = pc * this.x + pd * this.y + parent.worldY; - const rx = (rootBone.rotation + rootBone.shearX) * MathUtils.degRad; - const ry = (rootBone.rotation + 90 + rootBone.shearY) * MathUtils.degRad; - const la = Math.cos(rx) * rootBone.scaleX; - const lb = Math.cos(ry) * rootBone.scaleY; - const lc = Math.sin(rx) * rootBone.scaleX; - const ld = Math.sin(ry) * rootBone.scaleY; - rootBone.a = (pa * la + pb * lc) * this.scaleX; - rootBone.b = (pa * lb + pb * ld) * this.scaleX; - rootBone.c = (pc * la + pd * lc) * this.scaleY; - rootBone.d = (pc * lb + pd * ld) * this.scaleY; - let updateCache = this._updateCache; - for (let i = 0, n = updateCache.length; i < n; i++) { - let updatable = updateCache[i]; - if (updatable != rootBone) - updatable.update(physics); - } - } - /** Sets the bones, constraints, and slots to their setup pose values. */ - setToSetupPose() { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - } - /** Sets the bones and constraints to their setup pose values. */ - setBonesToSetupPose() { - for (const bone of this.bones) - bone.setToSetupPose(); - for (const constraint of this.ikConstraints) - constraint.setToSetupPose(); - for (const constraint of this.transformConstraints) - constraint.setToSetupPose(); - for (const constraint of this.pathConstraints) - constraint.setToSetupPose(); - for (const constraint of this.physicsConstraints) - constraint.setToSetupPose(); - } - /** Sets the slots and draw order to their setup pose values. */ - setSlotsToSetupPose() { - let slots = this.slots; - Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); - for (let i = 0, n = slots.length; i < n; i++) - slots[i].setToSetupPose(); - } - /** @returns May return null. */ - getRootBone() { - if (this.bones.length == 0) - return null; - return this.bones[0]; - } - /** @returns May be null. */ - findBone(boneName) { - if (!boneName) - throw new Error("boneName cannot be null."); - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (bone.data.name == boneName) - return bone; - } - return null; - } - /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it - * repeatedly. - * @returns May be null. */ - findSlot(slotName) { - if (!slotName) - throw new Error("slotName cannot be null."); - let slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (slot.data.name == slotName) - return slot; - } - return null; - } - /** Sets a skin by name. - * - * See {@link #setSkin()}. */ - setSkinByName(skinName) { - let skin = this.data.findSkin(skinName); - if (!skin) - throw new Error("Skin not found: " + skinName); - this.setSkin(skin); - } - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#defaultSkin default skin}. If the - * skin is changed, {@link #updateCache()} is called. - * - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no - * old skin, each slot's setup mode attachment is attached from the new skin. - * - * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling - * {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply()} is called before the next time the - * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin. - * @param newSkin May be null. */ - setSkin(newSkin) { - if (newSkin == this.skin) - return; - if (newSkin) { - if (this.skin) - newSkin.attachAll(this, this.skin); - else { - let slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - let name = slot.data.attachmentName; - if (name) { - let attachment = newSkin.getAttachment(i, name); - if (attachment) - slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - this.updateCache(); - } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment - * name. - * - * See {@link #getAttachment()}. - * @returns May be null. */ - getAttachmentByName(slotName, attachmentName) { - let slot = this.data.findSlot(slotName); - if (!slot) - throw new Error(`Can't find slot with name ${slotName}`); - return this.getAttachment(slot.index, attachmentName); - } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and - * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked. - * - * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. - * @returns May be null. */ - getAttachment(slotIndex, attachmentName) { - if (!attachmentName) - throw new Error("attachmentName cannot be null."); - if (this.skin) { - let attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) - return attachment; - } - if (this.data.defaultSkin) - return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - } - /** A convenience method to set an attachment by finding the slot with {@link #findSlot()}, finding the attachment with - * {@link #getAttachment()}, then setting the slot's {@link Slot#attachment}. - * @param attachmentName May be null to clear the slot's attachment. */ - setAttachment(slotName, attachmentName) { - if (!slotName) - throw new Error("slotName cannot be null."); - let slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (slot.data.name == slotName) { - let attachment = null; - if (attachmentName) { - attachment = this.getAttachment(i, attachmentName); - if (!attachment) - throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); - } - slot.setAttachment(attachment); - return; - } - } - throw new Error("Slot not found: " + slotName); - } - /** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method - * than to call it repeatedly. - * @return May be null. */ - findIkConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - return this.ikConstraints.find((constraint) => constraint.data.name == constraintName) ?? null; - } - /** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of - * this method than to call it repeatedly. - * @return May be null. */ - findTransformConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - return this.transformConstraints.find((constraint) => constraint.data.name == constraintName) ?? null; - } - /** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method - * than to call it repeatedly. - * @return May be null. */ - findPathConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - return this.pathConstraints.find((constraint) => constraint.data.name == constraintName) ?? null; - } - /** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this - * method than to call it repeatedly. */ - findPhysicsConstraint(constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - return this.physicsConstraints.find((constraint) => constraint.data.name == constraintName) ?? null; - } - /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`. - * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */ - getBoundsRect(clipper) { - let offset = new Vector2(); - let size = new Vector2(); - this.getBounds(offset, size, void 0, clipper); - return { x: offset.x, y: offset.y, width: size.x, height: size.y }; - } - /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. - * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB. - * @param size An output value, the width and height of the AABB. - * @param temp Working memory to temporarily store attachments' computed world vertices. - * @param clipper {@link SkeletonClipping} to use. If null, no clipping is applied. */ - getBounds(offset, size, temp = new Array(2), clipper = null) { - if (!offset) - throw new Error("offset cannot be null."); - if (!size) - throw new Error("size cannot be null."); - let drawOrder = this.drawOrder; - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - for (let i = 0, n = drawOrder.length; i < n; i++) { - let slot = drawOrder[i]; - if (!slot.bone.active) - continue; - let verticesLength = 0; - let vertices = null; - let triangles = null; - let attachment = slot.getAttachment(); - if (attachment instanceof RegionAttachment) { - verticesLength = 8; - vertices = Utils.setArraySize(temp, verticesLength, 0); - attachment.computeWorldVertices(slot, vertices, 0, 2); - triangles = _Skeleton.quadTriangles; - } else if (attachment instanceof MeshAttachment) { - let mesh = attachment; - verticesLength = mesh.worldVerticesLength; - vertices = Utils.setArraySize(temp, verticesLength, 0); - mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); - triangles = mesh.triangles; - } else if (attachment instanceof ClippingAttachment && clipper != null) { - clipper.clipStart(slot, attachment); - continue; - } - if (vertices && triangles) { - if (clipper != null && clipper.isClipping()) { - clipper.clipTriangles(vertices, triangles, triangles.length); - vertices = clipper.clippedVertices; - verticesLength = clipper.clippedVertices.length; - } - for (let ii = 0, nn = vertices.length; ii < nn; ii += 2) { - let x = vertices[ii], y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - if (clipper != null) - clipper.clipEndWithSlot(slot); - } - if (clipper != null) - clipper.clipEnd(); - offset.set(minX, minY); - size.set(maxX - minX, maxY - minY); - } - /** Increments the skeleton's {@link #time}. */ - update(delta) { - this.time += delta; - } - physicsTranslate(x, y) { - const physicsConstraints = this.physicsConstraints; - for (let i = 0, n = physicsConstraints.length; i < n; i++) - physicsConstraints[i].translate(x, y); - } - /** Calls {@link PhysicsConstraint#rotate(float, float, float)} for each physics constraint. */ - physicsRotate(x, y, degrees) { - const physicsConstraints = this.physicsConstraints; - for (let i = 0, n = physicsConstraints.length; i < n; i++) - physicsConstraints[i].rotate(x, y, degrees); - } -}; -var Skeleton = _Skeleton; -__publicField(Skeleton, "quadTriangles", [0, 1, 2, 2, 3, 0]); -__publicField(Skeleton, "yDown", false); -var Physics = /* @__PURE__ */ ((Physics2) => { - Physics2[Physics2["none"] = 0] = "none"; - Physics2[Physics2["reset"] = 1] = "reset"; - Physics2[Physics2["update"] = 2] = "update"; - Physics2[Physics2["pose"] = 3] = "pose"; - return Physics2; -})(Physics || {}); - -// spine-core/src/PhysicsConstraintData.ts -var PhysicsConstraintData = class extends ConstraintData { - _bone = null; - /** The bone constrained by this physics constraint. */ - set bone(boneData) { - this._bone = boneData; - } - get bone() { - if (!this._bone) - throw new Error("BoneData not set."); - else - return this._bone; - } - x = 0; - y = 0; - rotate = 0; - scaleX = 0; - shearX = 0; - limit = 0; - step = 0; - inertia = 0; - strength = 0; - damping = 0; - massInverse = 0; - wind = 0; - gravity = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */ - mix = 0; - inertiaGlobal = false; - strengthGlobal = false; - dampingGlobal = false; - massGlobal = false; - windGlobal = false; - gravityGlobal = false; - mixGlobal = false; - constructor(name) { - super(name, 0, false); - } -}; - -// spine-core/src/SkeletonData.ts -var SkeletonData = class { - /** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */ - name = null; - /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ - bones = new Array(); - // Ordered parents first. - /** The skeleton's slots in the setup pose draw order. */ - slots = new Array(); - // Setup pose draw order. - skins = new Array(); - /** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine. - * - * See {@link Skeleton#getAttachmentByName()}. - * May be null. */ - defaultSkin = null; - /** The skeleton's events. */ - events = new Array(); - /** The skeleton's animations. */ - animations = new Array(); - /** The skeleton's IK constraints. */ - ikConstraints = new Array(); - /** The skeleton's transform constraints. */ - transformConstraints = new Array(); - /** The skeleton's path constraints. */ - pathConstraints = new Array(); - /** The skeleton's physics constraints. */ - physicsConstraints = new Array(); - /** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */ - x = 0; - /** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */ - y = 0; - /** The width of the skeleton's axis aligned bounding box in the setup pose. */ - width = 0; - /** The height of the skeleton's axis aligned bounding box in the setup pose. */ - height = 0; - /** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default - * is 100. */ - referenceScale = 100; - /** The Spine version used to export the skeleton data, or null. */ - version = null; - /** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */ - hash = null; - // Nonessential - /** The dopesheet FPS in Spine. Available only when nonessential data was exported. */ - fps = 0; - /** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */ - imagesPath = null; - /** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */ - audioPath = null; - /** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it - * multiple times. - * @returns May be null. */ - findBone(boneName) { - if (!boneName) - throw new Error("boneName cannot be null."); - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (bone.name == boneName) - return bone; - } - return null; - } - /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it - * multiple times. - * @returns May be null. */ - findSlot(slotName) { - if (!slotName) - throw new Error("slotName cannot be null."); - let slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (slot.name == slotName) - return slot; - } - return null; - } - /** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it - * multiple times. - * @returns May be null. */ - findSkin(skinName) { - if (!skinName) - throw new Error("skinName cannot be null."); - let skins = this.skins; - for (let i = 0, n = skins.length; i < n; i++) { - let skin = skins[i]; - if (skin.name == skinName) - return skin; - } - return null; - } - /** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it - * multiple times. - * @returns May be null. */ - findEvent(eventDataName) { - if (!eventDataName) - throw new Error("eventDataName cannot be null."); - let events = this.events; - for (let i = 0, n = events.length; i < n; i++) { - let event = events[i]; - if (event.name == eventDataName) - return event; - } - return null; - } - /** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to - * call it multiple times. - * @returns May be null. */ - findAnimation(animationName) { - if (!animationName) - throw new Error("animationName cannot be null."); - let animations = this.animations; - for (let i = 0, n = animations.length; i < n; i++) { - let animation = animations[i]; - if (animation.name == animationName) - return animation; - } - return null; - } - /** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method - * than to call it multiple times. - * @return May be null. */ - findIkConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - const ikConstraints = this.ikConstraints; - for (let i = 0, n = ikConstraints.length; i < n; i++) { - const constraint = ikConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - } - /** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of - * this method than to call it multiple times. - * @return May be null. */ - findTransformConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - const transformConstraints = this.transformConstraints; - for (let i = 0, n = transformConstraints.length; i < n; i++) { - const constraint = transformConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - } - /** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method - * than to call it multiple times. - * @return May be null. */ - findPathConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - const pathConstraints = this.pathConstraints; - for (let i = 0, n = pathConstraints.length; i < n; i++) { - const constraint = pathConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - } - /** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this method - * than to call it multiple times. - * @return May be null. */ - findPhysicsConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - const physicsConstraints = this.physicsConstraints; - for (let i = 0, n = physicsConstraints.length; i < n; i++) { - const constraint = physicsConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - } -}; - -// spine-core/src/Skin.ts -var SkinEntry = class { - constructor(slotIndex = 0, name, attachment) { - this.slotIndex = slotIndex; - this.name = name; - this.attachment = attachment; - } -}; -var Skin = class { - /** The skin's name, which is unique across all skins in the skeleton. */ - name; - attachments = new Array(); - bones = Array(); - constraints = new Array(); - /** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */ - color = new Color(0.99607843, 0.61960787, 0.30980393, 1); - // fe9e4fff - constructor(name) { - if (!name) - throw new Error("name cannot be null."); - this.name = name; - } - /** Adds an attachment to the skin for the specified slot index and name. */ - setAttachment(slotIndex, name, attachment) { - if (!attachment) - throw new Error("attachment cannot be null."); - let attachments = this.attachments; - if (slotIndex >= attachments.length) - attachments.length = slotIndex + 1; - if (!attachments[slotIndex]) - attachments[slotIndex] = {}; - attachments[slotIndex][name] = attachment; - } - /** Adds all attachments, bones, and constraints from the specified skin to this skin. */ - addSkin(skin) { - for (let i = 0; i < skin.bones.length; i++) { - let bone = skin.bones[i]; - let contained = false; - for (let ii = 0; ii < this.bones.length; ii++) { - if (this.bones[ii] == bone) { - contained = true; - break; - } - } - if (!contained) - this.bones.push(bone); - } - for (let i = 0; i < skin.constraints.length; i++) { - let constraint = skin.constraints[i]; - let contained = false; - for (let ii = 0; ii < this.constraints.length; ii++) { - if (this.constraints[ii] == constraint) { - contained = true; - break; - } - } - if (!contained) - this.constraints.push(constraint); - } - let attachments = skin.getAttachments(); - for (let i = 0; i < attachments.length; i++) { - var attachment = attachments[i]; - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } - } - /** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not - * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */ - copySkin(skin) { - for (let i = 0; i < skin.bones.length; i++) { - let bone = skin.bones[i]; - let contained = false; - for (let ii = 0; ii < this.bones.length; ii++) { - if (this.bones[ii] == bone) { - contained = true; - break; - } - } - if (!contained) - this.bones.push(bone); - } - for (let i = 0; i < skin.constraints.length; i++) { - let constraint = skin.constraints[i]; - let contained = false; - for (let ii = 0; ii < this.constraints.length; ii++) { - if (this.constraints[ii] == constraint) { - contained = true; - break; - } - } - if (!contained) - this.constraints.push(constraint); - } - let attachments = skin.getAttachments(); - for (let i = 0; i < attachments.length; i++) { - var attachment = attachments[i]; - if (!attachment.attachment) - continue; - if (attachment.attachment instanceof MeshAttachment) { - attachment.attachment = attachment.attachment.newLinkedMesh(); - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } else { - attachment.attachment = attachment.attachment.copy(); - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } - } - } - /** Returns the attachment for the specified slot index and name, or null. */ - getAttachment(slotIndex, name) { - let dictionary = this.attachments[slotIndex]; - return dictionary ? dictionary[name] : null; - } - /** Removes the attachment in the skin for the specified slot index and name, if any. */ - removeAttachment(slotIndex, name) { - let dictionary = this.attachments[slotIndex]; - if (dictionary) - delete dictionary[name]; - } - /** Returns all attachments in this skin. */ - getAttachments() { - let entries = new Array(); - for (var i = 0; i < this.attachments.length; i++) { - let slotAttachments = this.attachments[i]; - if (slotAttachments) { - for (let name in slotAttachments) { - let attachment = slotAttachments[name]; - if (attachment) - entries.push(new SkinEntry(i, name, attachment)); - } - } - } - return entries; - } - /** Returns all attachments in this skin for the specified slot index. */ - getAttachmentsForSlot(slotIndex, attachments) { - let slotAttachments = this.attachments[slotIndex]; - if (slotAttachments) { - for (let name in slotAttachments) { - let attachment = slotAttachments[name]; - if (attachment) - attachments.push(new SkinEntry(slotIndex, name, attachment)); - } - } - } - /** Clears all attachments, bones, and constraints. */ - clear() { - this.attachments.length = 0; - this.bones.length = 0; - this.constraints.length = 0; - } - /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */ - attachAll(skeleton, oldSkin) { - let slotIndex = 0; - for (let i = 0; i < skeleton.slots.length; i++) { - let slot = skeleton.slots[i]; - let slotAttachment = slot.getAttachment(); - if (slotAttachment && slotIndex < oldSkin.attachments.length) { - let dictionary = oldSkin.attachments[slotIndex]; - for (let key in dictionary) { - let skinAttachment = dictionary[key]; - if (slotAttachment == skinAttachment) { - let attachment = this.getAttachment(slotIndex, key); - if (attachment) - slot.setAttachment(attachment); - break; - } - } - } - slotIndex++; - } - } -}; - -// spine-core/src/SlotData.ts -var SlotData = class { - /** The index of the slot in {@link Skeleton#getSlots()}. */ - index = 0; - /** The name of the slot, which is unique across all slots in the skeleton. */ - name; - /** The bone this slot belongs to. */ - boneData; - /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two - * color tinting. */ - color = new Color(1, 1, 1, 1); - /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark - * color's alpha is not used. */ - darkColor = null; - /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */ - attachmentName = null; - /** The blend mode for drawing the slot's attachment. */ - blendMode = BlendMode.Normal; - /** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */ - visible = true; - constructor(index, name, boneData) { - if (index < 0) - throw new Error("index must be >= 0."); - if (!name) - throw new Error("name cannot be null."); - if (!boneData) - throw new Error("boneData cannot be null."); - this.index = index; - this.name = name; - this.boneData = boneData; - } -}; -var BlendMode = /* @__PURE__ */ ((BlendMode4) => { - BlendMode4[BlendMode4["Normal"] = 0] = "Normal"; - BlendMode4[BlendMode4["Additive"] = 1] = "Additive"; - BlendMode4[BlendMode4["Multiply"] = 2] = "Multiply"; - BlendMode4[BlendMode4["Screen"] = 3] = "Screen"; - return BlendMode4; -})(BlendMode || {}); - -// spine-core/src/TransformConstraintData.ts -var TransformConstraintData = class extends ConstraintData { - /** The bones that will be modified by this transform constraint. */ - bones = new Array(); - /** The target bone whose world transform will be copied to the constrained bones. */ - _target = null; - set target(boneData) { - this._target = boneData; - } - get target() { - if (!this._target) - throw new Error("BoneData not set."); - else - return this._target; - } - mixRotate = 0; - mixX = 0; - mixY = 0; - mixScaleX = 0; - mixScaleY = 0; - mixShearY = 0; - /** An offset added to the constrained bone rotation. */ - offsetRotation = 0; - /** An offset added to the constrained bone X translation. */ - offsetX = 0; - /** An offset added to the constrained bone Y translation. */ - offsetY = 0; - /** An offset added to the constrained bone scaleX. */ - offsetScaleX = 0; - /** An offset added to the constrained bone scaleY. */ - offsetScaleY = 0; - /** An offset added to the constrained bone shearY. */ - offsetShearY = 0; - relative = false; - local = false; - constructor(name) { - super(name, 0, false); - } -}; - -// spine-core/src/SkeletonBinary.ts -var SkeletonBinary = class { - /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at - * runtime than were used in Spine. - * - * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */ - scale = 1; - attachmentLoader; - linkedMeshes = new Array(); - constructor(attachmentLoader) { - this.attachmentLoader = attachmentLoader; - } - readSkeletonData(binary) { - let scale = this.scale; - let skeletonData = new SkeletonData(); - skeletonData.name = ""; - let input = new BinaryInput(binary); - let lowHash = input.readInt32(); - let highHash = input.readInt32(); - skeletonData.hash = highHash == 0 && lowHash == 0 ? null : highHash.toString(16) + lowHash.toString(16); - skeletonData.version = input.readString(); - skeletonData.x = input.readFloat(); - skeletonData.y = input.readFloat(); - skeletonData.width = input.readFloat(); - skeletonData.height = input.readFloat(); - skeletonData.referenceScale = input.readFloat() * scale; - let nonessential = input.readBoolean(); - if (nonessential) { - skeletonData.fps = input.readFloat(); - skeletonData.imagesPath = input.readString(); - skeletonData.audioPath = input.readString(); - } - let n = 0; - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let str = input.readString(); - if (!str) - throw new Error("String in string table must not be null."); - input.strings.push(str); - } - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let name = input.readString(); - if (!name) - throw new Error("Bone name must not be null."); - let parent = i == 0 ? null : skeletonData.bones[input.readInt(true)]; - let data = new BoneData(i, name, parent); - data.rotation = input.readFloat(); - data.x = input.readFloat() * scale; - data.y = input.readFloat() * scale; - data.scaleX = input.readFloat(); - data.scaleY = input.readFloat(); - data.shearX = input.readFloat(); - data.shearY = input.readFloat(); - data.length = input.readFloat() * scale; - data.inherit = input.readByte(); - data.skinRequired = input.readBoolean(); - if (nonessential) { - Color.rgba8888ToColor(data.color, input.readInt32()); - data.icon = input.readString() ?? void 0; - data.visible = input.readBoolean(); - } - skeletonData.bones.push(data); - } - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let slotName = input.readString(); - if (!slotName) - throw new Error("Slot name must not be null."); - let boneData = skeletonData.bones[input.readInt(true)]; - let data = new SlotData(i, slotName, boneData); - Color.rgba8888ToColor(data.color, input.readInt32()); - let darkColor = input.readInt32(); - if (darkColor != -1) - Color.rgb888ToColor(data.darkColor = new Color(), darkColor); - data.attachmentName = input.readStringRef(); - data.blendMode = input.readInt(true); - if (nonessential) - data.visible = input.readBoolean(); - skeletonData.slots.push(data); - } - n = input.readInt(true); - for (let i = 0, nn; i < n; i++) { - let name = input.readString(); - if (!name) - throw new Error("IK constraint data name must not be null."); - let data = new IkConstraintData(name); - data.order = input.readInt(true); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(skeletonData.bones[input.readInt(true)]); - data.target = skeletonData.bones[input.readInt(true)]; - let flags = input.readByte(); - data.skinRequired = (flags & 1) != 0; - data.bendDirection = (flags & 2) != 0 ? 1 : -1; - data.compress = (flags & 4) != 0; - data.stretch = (flags & 8) != 0; - data.uniform = (flags & 16) != 0; - if ((flags & 32) != 0) - data.mix = (flags & 64) != 0 ? input.readFloat() : 1; - if ((flags & 128) != 0) - data.softness = input.readFloat() * scale; - skeletonData.ikConstraints.push(data); - } - n = input.readInt(true); - for (let i = 0, nn; i < n; i++) { - let name = input.readString(); - if (!name) - throw new Error("Transform constraint data name must not be null."); - let data = new TransformConstraintData(name); - data.order = input.readInt(true); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(skeletonData.bones[input.readInt(true)]); - data.target = skeletonData.bones[input.readInt(true)]; - let flags = input.readByte(); - data.skinRequired = (flags & 1) != 0; - data.local = (flags & 2) != 0; - data.relative = (flags & 4) != 0; - if ((flags & 8) != 0) - data.offsetRotation = input.readFloat(); - if ((flags & 16) != 0) - data.offsetX = input.readFloat() * scale; - if ((flags & 32) != 0) - data.offsetY = input.readFloat() * scale; - if ((flags & 64) != 0) - data.offsetScaleX = input.readFloat(); - if ((flags & 128) != 0) - data.offsetScaleY = input.readFloat(); - flags = input.readByte(); - if ((flags & 1) != 0) - data.offsetShearY = input.readFloat(); - if ((flags & 2) != 0) - data.mixRotate = input.readFloat(); - if ((flags & 4) != 0) - data.mixX = input.readFloat(); - if ((flags & 8) != 0) - data.mixY = input.readFloat(); - if ((flags & 16) != 0) - data.mixScaleX = input.readFloat(); - if ((flags & 32) != 0) - data.mixScaleY = input.readFloat(); - if ((flags & 64) != 0) - data.mixShearY = input.readFloat(); - skeletonData.transformConstraints.push(data); - } - n = input.readInt(true); - for (let i = 0, nn; i < n; i++) { - let name = input.readString(); - if (!name) - throw new Error("Path constraint data name must not be null."); - let data = new PathConstraintData(name); - data.order = input.readInt(true); - data.skinRequired = input.readBoolean(); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(skeletonData.bones[input.readInt(true)]); - data.target = skeletonData.slots[input.readInt(true)]; - const flags = input.readByte(); - data.positionMode = flags & 1; - data.spacingMode = flags >> 1 & 3; - data.rotateMode = flags >> 3 & 3; - if ((flags & 128) != 0) - data.offsetRotation = input.readFloat(); - data.position = input.readFloat(); - if (data.positionMode == 0 /* Fixed */) - data.position *= scale; - data.spacing = input.readFloat(); - if (data.spacingMode == 0 /* Length */ || data.spacingMode == 1 /* Fixed */) - data.spacing *= scale; - data.mixRotate = input.readFloat(); - data.mixX = input.readFloat(); - data.mixY = input.readFloat(); - skeletonData.pathConstraints.push(data); - } - n = input.readInt(true); - for (let i = 0, nn; i < n; i++) { - const name = input.readString(); - if (!name) - throw new Error("Physics constraint data name must not be null."); - const data = new PhysicsConstraintData(name); - data.order = input.readInt(true); - data.bone = skeletonData.bones[input.readInt(true)]; - let flags = input.readByte(); - data.skinRequired = (flags & 1) != 0; - if ((flags & 2) != 0) - data.x = input.readFloat(); - if ((flags & 4) != 0) - data.y = input.readFloat(); - if ((flags & 8) != 0) - data.rotate = input.readFloat(); - if ((flags & 16) != 0) - data.scaleX = input.readFloat(); - if ((flags & 32) != 0) - data.shearX = input.readFloat(); - data.limit = ((flags & 64) != 0 ? input.readFloat() : 5e3) * scale; - data.step = 1 / input.readUnsignedByte(); - data.inertia = input.readFloat(); - data.strength = input.readFloat(); - data.damping = input.readFloat(); - data.massInverse = (flags & 128) != 0 ? input.readFloat() : 1; - data.wind = input.readFloat(); - data.gravity = input.readFloat(); - flags = input.readByte(); - if ((flags & 1) != 0) - data.inertiaGlobal = true; - if ((flags & 2) != 0) - data.strengthGlobal = true; - if ((flags & 4) != 0) - data.dampingGlobal = true; - if ((flags & 8) != 0) - data.massGlobal = true; - if ((flags & 16) != 0) - data.windGlobal = true; - if ((flags & 32) != 0) - data.gravityGlobal = true; - if ((flags & 64) != 0) - data.mixGlobal = true; - data.mix = (flags & 128) != 0 ? input.readFloat() : 1; - skeletonData.physicsConstraints.push(data); - } - let defaultSkin = this.readSkin(input, skeletonData, true, nonessential); - if (defaultSkin) { - skeletonData.defaultSkin = defaultSkin; - skeletonData.skins.push(defaultSkin); - } - { - let i = skeletonData.skins.length; - Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true)); - for (; i < n; i++) { - let skin = this.readSkin(input, skeletonData, false, nonessential); - if (!skin) - throw new Error("readSkin() should not have returned null."); - skeletonData.skins[i] = skin; - } - } - n = this.linkedMeshes.length; - for (let i = 0; i < n; i++) { - let linkedMesh = this.linkedMeshes[i]; - const skin = skeletonData.skins[linkedMesh.skinIndex]; - if (!linkedMesh.parent) - throw new Error("Linked mesh parent must not be null"); - let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); - if (!parent) - throw new Error(`Parent mesh not found: ${linkedMesh.parent}`); - linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh; - linkedMesh.mesh.setParentMesh(parent); - if (linkedMesh.mesh.region != null) - linkedMesh.mesh.updateRegion(); - } - this.linkedMeshes.length = 0; - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let eventName = input.readString(); - if (!eventName) - throw new Error("Event data name must not be null"); - let data = new EventData(eventName); - data.intValue = input.readInt(false); - data.floatValue = input.readFloat(); - data.stringValue = input.readString(); - data.audioPath = input.readString(); - if (data.audioPath) { - data.volume = input.readFloat(); - data.balance = input.readFloat(); - } - skeletonData.events.push(data); - } - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let animationName = input.readString(); - if (!animationName) - throw new Error("Animatio name must not be null."); - skeletonData.animations.push(this.readAnimation(input, animationName, skeletonData)); - } - return skeletonData; - } - readSkin(input, skeletonData, defaultSkin, nonessential) { - let skin = null; - let slotCount = 0; - if (defaultSkin) { - slotCount = input.readInt(true); - if (slotCount == 0) - return null; - skin = new Skin("default"); - } else { - let skinName = input.readString(); - if (!skinName) - throw new Error("Skin name must not be null."); - skin = new Skin(skinName); - if (nonessential) - Color.rgba8888ToColor(skin.color, input.readInt32()); - skin.bones.length = input.readInt(true); - for (let i = 0, n = skin.bones.length; i < n; i++) - skin.bones[i] = skeletonData.bones[input.readInt(true)]; - for (let i = 0, n = input.readInt(true); i < n; i++) - skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]); - for (let i = 0, n = input.readInt(true); i < n; i++) - skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]); - for (let i = 0, n = input.readInt(true); i < n; i++) - skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]); - for (let i = 0, n = input.readInt(true); i < n; i++) - skin.constraints.push(skeletonData.physicsConstraints[input.readInt(true)]); - slotCount = input.readInt(true); - } - for (let i = 0; i < slotCount; i++) { - let slotIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - let name = input.readStringRef(); - if (!name) - throw new Error("Attachment name must not be null"); - let attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name, nonessential); - if (attachment) - skin.setAttachment(slotIndex, name, attachment); - } - } - return skin; - } - readAttachment(input, skeletonData, skin, slotIndex, attachmentName, nonessential) { - let scale = this.scale; - let flags = input.readByte(); - const name = (flags & 8) != 0 ? input.readStringRef() : attachmentName; - if (!name) - throw new Error("Attachment name must not be null"); - switch (flags & 7) { - case AttachmentType.Region: { - let path = (flags & 16) != 0 ? input.readStringRef() : null; - const color = (flags & 32) != 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) != 0 ? this.readSequence(input) : null; - let rotation = (flags & 128) != 0 ? input.readFloat() : 0; - let x = input.readFloat(); - let y = input.readFloat(); - let scaleX = input.readFloat(); - let scaleY = input.readFloat(); - let width = input.readFloat(); - let height = input.readFloat(); - if (!path) - path = name; - let region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence); - if (!region) - return null; - region.path = path; - region.x = x * scale; - region.y = y * scale; - region.scaleX = scaleX; - region.scaleY = scaleY; - region.rotation = rotation; - region.width = width * scale; - region.height = height * scale; - Color.rgba8888ToColor(region.color, color); - region.sequence = sequence; - if (sequence == null) - region.updateRegion(); - return region; - } - case AttachmentType.BoundingBox: { - let vertices = this.readVertices(input, (flags & 16) != 0); - let color = nonessential ? input.readInt32() : 0; - let box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - if (!box) - return null; - box.worldVerticesLength = vertices.length; - box.vertices = vertices.vertices; - box.bones = vertices.bones; - if (nonessential) - Color.rgba8888ToColor(box.color, color); - return box; - } - case AttachmentType.Mesh: { - let path = (flags & 16) != 0 ? input.readStringRef() : name; - const color = (flags & 32) != 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) != 0 ? this.readSequence(input) : null; - const hullLength = input.readInt(true); - const vertices = this.readVertices(input, (flags & 128) != 0); - const uvs = this.readFloatArray(input, vertices.length, 1); - const triangles = this.readShortArray(input, (vertices.length - hullLength - 2) * 3); - let edges = []; - let width = 0, height = 0; - if (nonessential) { - edges = this.readShortArray(input, input.readInt(true)); - width = input.readFloat(); - height = input.readFloat(); - } - if (!path) - path = name; - let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) - return null; - mesh.path = path; - Color.rgba8888ToColor(mesh.color, color); - mesh.bones = vertices.bones; - mesh.vertices = vertices.vertices; - mesh.worldVerticesLength = vertices.length; - mesh.triangles = triangles; - mesh.regionUVs = uvs; - if (sequence == null) - mesh.updateRegion(); - mesh.hullLength = hullLength << 1; - mesh.sequence = sequence; - if (nonessential) { - mesh.edges = edges; - mesh.width = width * scale; - mesh.height = height * scale; - } - return mesh; - } - case AttachmentType.LinkedMesh: { - const path = (flags & 16) != 0 ? input.readStringRef() : name; - if (path == null) - throw new Error("Path of linked mesh must not be null"); - const color = (flags & 32) != 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) != 0 ? this.readSequence(input) : null; - const inheritTimelines = (flags & 128) != 0; - const skinIndex = input.readInt(true); - const parent = input.readStringRef(); - let width = 0, height = 0; - if (nonessential) { - width = input.readFloat(); - height = input.readFloat(); - } - let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) - return null; - mesh.path = path; - Color.rgba8888ToColor(mesh.color, color); - mesh.sequence = sequence; - if (nonessential) { - mesh.width = width * scale; - mesh.height = height * scale; - } - this.linkedMeshes.push(new LinkedMesh(mesh, skinIndex, slotIndex, parent, inheritTimelines)); - return mesh; - } - case AttachmentType.Path: { - const closed2 = (flags & 16) != 0; - const constantSpeed = (flags & 32) != 0; - const vertices = this.readVertices(input, (flags & 64) != 0); - const lengths = Utils.newArray(vertices.length / 6, 0); - for (let i = 0, n = lengths.length; i < n; i++) - lengths[i] = input.readFloat() * scale; - const color = nonessential ? input.readInt32() : 0; - const path = this.attachmentLoader.newPathAttachment(skin, name); - if (!path) - return null; - path.closed = closed2; - path.constantSpeed = constantSpeed; - path.worldVerticesLength = vertices.length; - path.vertices = vertices.vertices; - path.bones = vertices.bones; - path.lengths = lengths; - if (nonessential) - Color.rgba8888ToColor(path.color, color); - return path; - } - case AttachmentType.Point: { - const rotation = input.readFloat(); - const x = input.readFloat(); - const y = input.readFloat(); - const color = nonessential ? input.readInt32() : 0; - const point = this.attachmentLoader.newPointAttachment(skin, name); - if (!point) - return null; - point.x = x * scale; - point.y = y * scale; - point.rotation = rotation; - if (nonessential) - Color.rgba8888ToColor(point.color, color); - return point; - } - case AttachmentType.Clipping: { - const endSlotIndex = input.readInt(true); - const vertices = this.readVertices(input, (flags & 16) != 0); - let color = nonessential ? input.readInt32() : 0; - let clip = this.attachmentLoader.newClippingAttachment(skin, name); - if (!clip) - return null; - clip.endSlot = skeletonData.slots[endSlotIndex]; - clip.worldVerticesLength = vertices.length; - clip.vertices = vertices.vertices; - clip.bones = vertices.bones; - if (nonessential) - Color.rgba8888ToColor(clip.color, color); - return clip; - } - } - return null; - } - readSequence(input) { - let sequence = new Sequence(input.readInt(true)); - sequence.start = input.readInt(true); - sequence.digits = input.readInt(true); - sequence.setupIndex = input.readInt(true); - return sequence; - } - readVertices(input, weighted) { - const scale = this.scale; - const vertexCount = input.readInt(true); - const vertices = new Vertices(); - vertices.length = vertexCount << 1; - if (!weighted) { - vertices.vertices = this.readFloatArray(input, vertices.length, scale); - return vertices; - } - let weights = new Array(); - let bonesArray = new Array(); - for (let i = 0; i < vertexCount; i++) { - let boneCount = input.readInt(true); - bonesArray.push(boneCount); - for (let ii = 0; ii < boneCount; ii++) { - bonesArray.push(input.readInt(true)); - weights.push(input.readFloat() * scale); - weights.push(input.readFloat() * scale); - weights.push(input.readFloat()); - } - } - vertices.vertices = Utils.toFloatArray(weights); - vertices.bones = bonesArray; - return vertices; - } - readFloatArray(input, n, scale) { - let array = new Array(n); - if (scale == 1) { - for (let i = 0; i < n; i++) - array[i] = input.readFloat(); - } else { - for (let i = 0; i < n; i++) - array[i] = input.readFloat() * scale; - } - return array; - } - readShortArray(input, n) { - let array = new Array(n); - for (let i = 0; i < n; i++) - array[i] = input.readInt(true); - return array; - } - readAnimation(input, name, skeletonData) { - input.readInt(true); - let timelines = new Array(); - let scale = this.scale; - for (let i = 0, n = input.readInt(true); i < n; i++) { - let slotIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - let timelineType = input.readByte(); - let frameCount = input.readInt(true); - let frameLast = frameCount - 1; - switch (timelineType) { - case SLOT_ATTACHMENT: { - let timeline = new AttachmentTimeline(frameCount, slotIndex); - for (let frame = 0; frame < frameCount; frame++) - timeline.setFrame(frame, input.readFloat(), input.readStringRef()); - timelines.push(timeline); - break; - } - case SLOT_RGBA: { - let bezierCount = input.readInt(true); - let timeline = new RGBATimeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let a = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, a); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - let a2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1); - } - time = time2; - r = r2; - g = g2; - b = b2; - a = a2; - } - timelines.push(timeline); - break; - } - case SLOT_RGB: { - let bezierCount = input.readInt(true); - let timeline = new RGBTimeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1); - } - time = time2; - r = r2; - g = g2; - b = b2; - } - timelines.push(timeline); - break; - } - case SLOT_RGBA2: { - let bezierCount = input.readInt(true); - let timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let a = input.readUnsignedByte() / 255; - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, a, r2, g2, b2); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let nr = input.readUnsignedByte() / 255; - let ng = input.readUnsignedByte() / 255; - let nb = input.readUnsignedByte() / 255; - let na = input.readUnsignedByte() / 255; - let nr2 = input.readUnsignedByte() / 255; - let ng2 = input.readUnsignedByte() / 255; - let nb2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1); - setBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1); - } - time = time2; - r = nr; - g = ng; - b = nb; - a = na; - r2 = nr2; - g2 = ng2; - b2 = nb2; - } - timelines.push(timeline); - break; - } - case SLOT_RGB2: { - let bezierCount = input.readInt(true); - let timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, r2, g2, b2); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let nr = input.readUnsignedByte() / 255; - let ng = input.readUnsignedByte() / 255; - let nb = input.readUnsignedByte() / 255; - let nr2 = input.readUnsignedByte() / 255; - let ng2 = input.readUnsignedByte() / 255; - let nb2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1); - } - time = time2; - r = nr; - g = ng; - b = nb; - r2 = nr2; - g2 = ng2; - b2 = nb2; - } - timelines.push(timeline); - break; - } - case SLOT_ALPHA: { - let timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex); - let time = input.readFloat(), a = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, a); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let a2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1); - } - time = time2; - a = a2; - } - timelines.push(timeline); - } - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let boneIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - let type = input.readByte(), frameCount = input.readInt(true); - if (type == BONE_INHERIT) { - let timeline = new InheritTimeline(frameCount, boneIndex); - for (let frame = 0; frame < frameCount; frame++) { - timeline.setFrame(frame, input.readFloat(), input.readByte()); - } - timelines.push(timeline); - continue; - } - let bezierCount = input.readInt(true); - switch (type) { - case BONE_ROTATE: - timelines.push(readTimeline1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_TRANSLATE: - timelines.push(readTimeline2(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale)); - break; - case BONE_TRANSLATEX: - timelines.push(readTimeline1(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale)); - break; - case BONE_TRANSLATEY: - timelines.push(readTimeline1(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale)); - break; - case BONE_SCALE: - timelines.push(readTimeline2(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SCALEX: - timelines.push(readTimeline1(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SCALEY: - timelines.push(readTimeline1(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SHEAR: - timelines.push(readTimeline2(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SHEARX: - timelines.push(readTimeline1(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SHEARY: - timelines.push(readTimeline1(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1)); - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1; - let timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index); - let flags = input.readByte(); - let time = input.readFloat(), mix = (flags & 1) != 0 ? (flags & 2) != 0 ? input.readFloat() : 1 : 0; - let softness = (flags & 4) != 0 ? input.readFloat() * scale : 0; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mix, softness, (flags & 8) != 0 ? 1 : -1, (flags & 16) != 0, (flags & 32) != 0); - if (frame == frameLast) - break; - flags = input.readByte(); - const time2 = input.readFloat(), mix2 = (flags & 1) != 0 ? (flags & 2) != 0 ? input.readFloat() : 1 : 0; - const softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0; - if ((flags & 64) != 0) { - timeline.setStepped(frame); - } else if ((flags & 128) != 0) { - setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale); - } - time = time2; - mix = mix2; - softness = softness2; - } - timelines.push(timeline); - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1; - let timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index); - let time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(), mixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat(); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY); - if (frame == frameLast) - break; - let time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(), mixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - mixScaleX = mixScaleX2; - mixScaleY = mixScaleY2; - mixShearY = mixShearY2; - } - timelines.push(timeline); - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let index = input.readInt(true); - let data = skeletonData.pathConstraints[index]; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true); - switch (type) { - case PATH_POSITION: - timelines.push(readTimeline1( - input, - new PathConstraintPositionTimeline(frameCount, bezierCount, index), - data.positionMode == 0 /* Fixed */ ? scale : 1 - )); - break; - case PATH_SPACING: - timelines.push(readTimeline1( - input, - new PathConstraintSpacingTimeline(frameCount, bezierCount, index), - data.spacingMode == 0 /* Length */ || data.spacingMode == 1 /* Fixed */ ? scale : 1 - )); - break; - case PATH_MIX: - let timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index); - let time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(); - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY); - if (frame == frameLast) - break; - let time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - } - timelines.push(timeline); - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const index = input.readInt(true) - 1; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const type = input.readByte(), frameCount = input.readInt(true); - if (type == PHYSICS_RESET) { - const timeline = new PhysicsConstraintResetTimeline(frameCount, index); - for (let frame = 0; frame < frameCount; frame++) - timeline.setFrame(frame, input.readFloat()); - timelines.push(timeline); - continue; - } - const bezierCount = input.readInt(true); - switch (type) { - case PHYSICS_INERTIA: - timelines.push(readTimeline1(input, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_STRENGTH: - timelines.push(readTimeline1(input, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_DAMPING: - timelines.push(readTimeline1(input, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_MASS: - timelines.push(readTimeline1(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_WIND: - timelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_GRAVITY: - timelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_MIX: - timelines.push(readTimeline1(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1)); - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let skin = skeletonData.skins[input.readInt(true)]; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - let slotIndex = input.readInt(true); - for (let iii = 0, nnn = input.readInt(true); iii < nnn; iii++) { - let attachmentName = input.readStringRef(); - if (!attachmentName) - throw new Error("attachmentName must not be null."); - let attachment = skin.getAttachment(slotIndex, attachmentName); - let timelineType = input.readByte(); - let frameCount = input.readInt(true); - let frameLast = frameCount - 1; - switch (timelineType) { - case ATTACHMENT_DEFORM: { - let vertexAttachment = attachment; - let weighted = vertexAttachment.bones; - let vertices = vertexAttachment.vertices; - let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; - let bezierCount = input.readInt(true); - let timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment); - let time = input.readFloat(); - for (let frame = 0, bezier = 0; ; frame++) { - let deform; - let end = input.readInt(true); - if (end == 0) - deform = weighted ? Utils.newFloatArray(deformLength) : vertices; - else { - deform = Utils.newFloatArray(deformLength); - let start = input.readInt(true); - end += start; - if (scale == 1) { - for (let v = start; v < end; v++) - deform[v] = input.readFloat(); - } else { - for (let v = start; v < end; v++) - deform[v] = input.readFloat() * scale; - } - if (!weighted) { - for (let v = 0, vn = deform.length; v < vn; v++) - deform[v] += vertices[v]; - } - } - timeline.setFrame(frame, time, deform); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1); - } - time = time2; - } - timelines.push(timeline); - break; - } - case ATTACHMENT_SEQUENCE: { - let timeline = new SequenceTimeline(frameCount, slotIndex, attachment); - for (let frame = 0; frame < frameCount; frame++) { - let time = input.readFloat(); - let modeAndIndex = input.readInt32(); - timeline.setFrame( - frame, - time, - SequenceModeValues[modeAndIndex & 15], - modeAndIndex >> 4, - input.readFloat() - ); - } - timelines.push(timeline); - break; - } - } - } - } - } - let drawOrderCount = input.readInt(true); - if (drawOrderCount > 0) { - let timeline = new DrawOrderTimeline(drawOrderCount); - let slotCount = skeletonData.slots.length; - for (let i = 0; i < drawOrderCount; i++) { - let time = input.readFloat(); - let offsetCount = input.readInt(true); - let drawOrder = Utils.newArray(slotCount, 0); - for (let ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - let unchanged = Utils.newArray(slotCount - offsetCount, 0); - let originalIndex = 0, unchangedIndex = 0; - for (let ii = 0; ii < offsetCount; ii++) { - let slotIndex = input.readInt(true); - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - drawOrder[originalIndex + input.readInt(true)] = originalIndex++; - } - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - for (let ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) - drawOrder[ii] = unchanged[--unchangedIndex]; - timeline.setFrame(i, time, drawOrder); - } - timelines.push(timeline); - } - let eventCount = input.readInt(true); - if (eventCount > 0) { - let timeline = new EventTimeline(eventCount); - for (let i = 0; i < eventCount; i++) { - let time = input.readFloat(); - let eventData = skeletonData.events[input.readInt(true)]; - let event = new Event(time, eventData); - event.intValue = input.readInt(false); - event.floatValue = input.readFloat(); - event.stringValue = input.readString(); - if (event.stringValue == null) - event.stringValue = eventData.stringValue; - if (event.data.audioPath) { - event.volume = input.readFloat(); - event.balance = input.readFloat(); - } - timeline.setFrame(i, event); - } - timelines.push(timeline); - } - let duration = 0; - for (let i = 0, n = timelines.length; i < n; i++) - duration = Math.max(duration, timelines[i].getDuration()); - return new Animation(name, timelines, duration); - } -}; -var BinaryInput = class { - constructor(data, strings = new Array(), index = 0, buffer = new DataView(data instanceof ArrayBuffer ? data : data.buffer)) { - this.strings = strings; - this.index = index; - this.buffer = buffer; - } - readByte() { - return this.buffer.getInt8(this.index++); - } - readUnsignedByte() { - return this.buffer.getUint8(this.index++); - } - readShort() { - let value = this.buffer.getInt16(this.index); - this.index += 2; - return value; - } - readInt32() { - let value = this.buffer.getInt32(this.index); - this.index += 4; - return value; - } - readInt(optimizePositive) { - let b = this.readByte(); - let result = b & 127; - if ((b & 128) != 0) { - b = this.readByte(); - result |= (b & 127) << 7; - if ((b & 128) != 0) { - b = this.readByte(); - result |= (b & 127) << 14; - if ((b & 128) != 0) { - b = this.readByte(); - result |= (b & 127) << 21; - if ((b & 128) != 0) { - b = this.readByte(); - result |= (b & 127) << 28; - } - } - } - } - return optimizePositive ? result : result >>> 1 ^ -(result & 1); - } - readStringRef() { - let index = this.readInt(true); - return index == 0 ? null : this.strings[index - 1]; - } - readString() { - let byteCount = this.readInt(true); - switch (byteCount) { - case 0: - return null; - case 1: - return ""; - } - byteCount--; - let chars = ""; - let charCount = 0; - for (let i = 0; i < byteCount; ) { - let b = this.readUnsignedByte(); - switch (b >> 4) { - case 12: - case 13: - chars += String.fromCharCode((b & 31) << 6 | this.readByte() & 63); - i += 2; - break; - case 14: - chars += String.fromCharCode((b & 15) << 12 | (this.readByte() & 63) << 6 | this.readByte() & 63); - i += 3; - break; - default: - chars += String.fromCharCode(b); - i++; - } - } - return chars; - } - readFloat() { - let value = this.buffer.getFloat32(this.index); - this.index += 4; - return value; - } - readBoolean() { - return this.readByte() != 0; - } -}; -var LinkedMesh = class { - parent; - skinIndex; - slotIndex; - mesh; - inheritTimeline; - constructor(mesh, skinIndex, slotIndex, parent, inheritDeform) { - this.mesh = mesh; - this.skinIndex = skinIndex; - this.slotIndex = slotIndex; - this.parent = parent; - this.inheritTimeline = inheritDeform; - } -}; -var Vertices = class { - constructor(bones = null, vertices = null, length = 0) { - this.bones = bones; - this.vertices = vertices; - this.length = length; - } -}; -var AttachmentType = /* @__PURE__ */ ((AttachmentType2) => { - AttachmentType2[AttachmentType2["Region"] = 0] = "Region"; - AttachmentType2[AttachmentType2["BoundingBox"] = 1] = "BoundingBox"; - AttachmentType2[AttachmentType2["Mesh"] = 2] = "Mesh"; - AttachmentType2[AttachmentType2["LinkedMesh"] = 3] = "LinkedMesh"; - AttachmentType2[AttachmentType2["Path"] = 4] = "Path"; - AttachmentType2[AttachmentType2["Point"] = 5] = "Point"; - AttachmentType2[AttachmentType2["Clipping"] = 6] = "Clipping"; - return AttachmentType2; -})(AttachmentType || {}); -function readTimeline1(input, timeline, scale) { - let time = input.readFloat(), value = input.readFloat() * scale; - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, value); - if (frame == frameLast) - break; - let time2 = input.readFloat(), value2 = input.readFloat() * scale; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale); - } - time = time2; - value = value2; - } - return timeline; -} -function readTimeline2(input, timeline, scale) { - let time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale; - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, value1, value2); - if (frame == frameLast) - break; - let time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale); - setBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale); - } - time = time2; - value1 = nvalue1; - value2 = nvalue2; - } - return timeline; -} -function setBezier(input, timeline, bezier, frame, value, time1, time2, value1, value2, scale) { - timeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2); -} -var BONE_ROTATE = 0; -var BONE_TRANSLATE = 1; -var BONE_TRANSLATEX = 2; -var BONE_TRANSLATEY = 3; -var BONE_SCALE = 4; -var BONE_SCALEX = 5; -var BONE_SCALEY = 6; -var BONE_SHEAR = 7; -var BONE_SHEARX = 8; -var BONE_SHEARY = 9; -var BONE_INHERIT = 10; -var SLOT_ATTACHMENT = 0; -var SLOT_RGBA = 1; -var SLOT_RGB = 2; -var SLOT_RGBA2 = 3; -var SLOT_RGB2 = 4; -var SLOT_ALPHA = 5; -var ATTACHMENT_DEFORM = 0; -var ATTACHMENT_SEQUENCE = 1; -var PATH_POSITION = 0; -var PATH_SPACING = 1; -var PATH_MIX = 2; -var PHYSICS_INERTIA = 0; -var PHYSICS_STRENGTH = 1; -var PHYSICS_DAMPING = 2; -var PHYSICS_MASS = 4; -var PHYSICS_WIND = 5; -var PHYSICS_GRAVITY = 6; -var PHYSICS_MIX = 7; -var PHYSICS_RESET = 8; -var CURVE_STEPPED = 1; -var CURVE_BEZIER = 2; - -// spine-core/src/SkeletonBounds.ts -var SkeletonBounds = class { - /** The left edge of the axis aligned bounding box. */ - minX = 0; - /** The bottom edge of the axis aligned bounding box. */ - minY = 0; - /** The right edge of the axis aligned bounding box. */ - maxX = 0; - /** The top edge of the axis aligned bounding box. */ - maxY = 0; - /** The visible bounding boxes. */ - boundingBoxes = new Array(); - /** The world vertices for the bounding box polygons. */ - polygons = new Array(); - polygonPool = new Pool(() => { - return Utils.newFloatArray(16); - }); - /** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding - * box's polygon. - * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the - * SkeletonBounds AABB methods will always return true. */ - update(skeleton, updateAabb) { - if (!skeleton) - throw new Error("skeleton cannot be null."); - let boundingBoxes = this.boundingBoxes; - let polygons = this.polygons; - let polygonPool = this.polygonPool; - let slots = skeleton.slots; - let slotCount = slots.length; - boundingBoxes.length = 0; - polygonPool.freeAll(polygons); - polygons.length = 0; - for (let i = 0; i < slotCount; i++) { - let slot = slots[i]; - if (!slot.bone.active) - continue; - let attachment = slot.getAttachment(); - if (attachment instanceof BoundingBoxAttachment) { - let boundingBox = attachment; - boundingBoxes.push(boundingBox); - let polygon = polygonPool.obtain(); - if (polygon.length != boundingBox.worldVerticesLength) { - polygon = Utils.newFloatArray(boundingBox.worldVerticesLength); - } - polygons.push(polygon); - boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); - } - } - if (updateAabb) { - this.aabbCompute(); - } else { - this.minX = Number.POSITIVE_INFINITY; - this.minY = Number.POSITIVE_INFINITY; - this.maxX = Number.NEGATIVE_INFINITY; - this.maxY = Number.NEGATIVE_INFINITY; - } - } - aabbCompute() { - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - let polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) { - let polygon = polygons[i]; - let vertices = polygon; - for (let ii = 0, nn = polygon.length; ii < nn; ii += 2) { - let x = vertices[ii]; - let y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - } - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint(x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - } - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment(x1, y1, x2, y2) { - let minX = this.minX; - let minY = this.minY; - let maxX = this.maxX; - let maxY = this.maxY; - if (x1 <= minX && x2 <= minX || y1 <= minY && y2 <= minY || x1 >= maxX && x2 >= maxX || y1 >= maxY && y2 >= maxY) - return false; - let m = (y2 - y1) / (x2 - x1); - let y = m * (minX - x1) + y1; - if (y > minY && y < maxY) - return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) - return true; - let x = (minY - y1) / m + x1; - if (x > minX && x < maxX) - return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) - return true; - return false; - } - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton(bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - } - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint(x, y) { - let polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) - if (this.containsPointPolygon(polygons[i], x, y)) - return this.boundingBoxes[i]; - return null; - } - /** Returns true if the polygon contains the point. */ - containsPointPolygon(polygon, x, y) { - let vertices = polygon; - let nn = polygon.length; - let prevIndex = nn - 2; - let inside = false; - for (let ii = 0; ii < nn; ii += 2) { - let vertexY = vertices[ii + 1]; - let prevY = vertices[prevIndex + 1]; - if (vertexY < y && prevY >= y || prevY < y && vertexY >= y) { - let vertexX = vertices[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) - inside = !inside; - } - prevIndex = ii; - } - return inside; - } - /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it - * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns - * true. */ - intersectsSegment(x1, y1, x2, y2) { - let polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) - if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) - return this.boundingBoxes[i]; - return null; - } - /** Returns true if the polygon contains any part of the line segment. */ - intersectsSegmentPolygon(polygon, x1, y1, x2, y2) { - let vertices = polygon; - let nn = polygon.length; - let width12 = x1 - x2, height12 = y1 - y2; - let det1 = x1 * y2 - y1 * x2; - let x3 = vertices[nn - 2], y3 = vertices[nn - 1]; - for (let ii = 0; ii < nn; ii += 2) { - let x4 = vertices[ii], y4 = vertices[ii + 1]; - let det2 = x3 * y4 - y3 * x4; - let width34 = x3 - x4, height34 = y3 - y4; - let det3 = width12 * height34 - height12 * width34; - let x = (det1 * width34 - width12 * det2) / det3; - if ((x >= x3 && x <= x4 || x >= x4 && x <= x3) && (x >= x1 && x <= x2 || x >= x2 && x <= x1)) { - let y = (det1 * height34 - height12 * det2) / det3; - if ((y >= y3 && y <= y4 || y >= y4 && y <= y3) && (y >= y1 && y <= y2 || y >= y2 && y <= y1)) - return true; - } - x3 = x4; - y3 = y4; - } - return false; - } - /** Returns the polygon for the specified bounding box, or null. */ - getPolygon(boundingBox) { - if (!boundingBox) - throw new Error("boundingBox cannot be null."); - let index = this.boundingBoxes.indexOf(boundingBox); - return index == -1 ? null : this.polygons[index]; - } - /** The width of the axis aligned bounding box. */ - getWidth() { - return this.maxX - this.minX; - } - /** The height of the axis aligned bounding box. */ - getHeight() { - return this.maxY - this.minY; - } -}; - -// spine-core/src/Triangulator.ts -var Triangulator = class { - convexPolygons = new Array(); - convexPolygonsIndices = new Array(); - indicesArray = new Array(); - isConcaveArray = new Array(); - triangles = new Array(); - polygonPool = new Pool(() => { - return new Array(); - }); - polygonIndicesPool = new Pool(() => { - return new Array(); - }); - triangulate(verticesArray) { - let vertices = verticesArray; - let vertexCount = verticesArray.length >> 1; - let indices = this.indicesArray; - indices.length = 0; - for (let i = 0; i < vertexCount; i++) - indices[i] = i; - let isConcave = this.isConcaveArray; - isConcave.length = 0; - for (let i = 0, n = vertexCount; i < n; ++i) - isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); - let triangles = this.triangles; - triangles.length = 0; - while (vertexCount > 3) { - let previous = vertexCount - 1, i = 0, next = 1; - while (true) { - outer: - if (!isConcave[i]) { - let p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; - let p1x = vertices[p1], p1y = vertices[p1 + 1]; - let p2x = vertices[p2], p2y = vertices[p2 + 1]; - let p3x = vertices[p3], p3y = vertices[p3 + 1]; - for (let ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { - if (!isConcave[ii]) - continue; - let v = indices[ii] << 1; - let vx = vertices[v], vy = vertices[v + 1]; - if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { - if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { - if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) - break outer; - } - } - } - break; - } - if (next == 0) { - do { - if (!isConcave[i]) - break; - i--; - } while (i > 0); - break; - } - previous = i; - i = next; - next = (next + 1) % vertexCount; - } - triangles.push(indices[(vertexCount + i - 1) % vertexCount]); - triangles.push(indices[i]); - triangles.push(indices[(i + 1) % vertexCount]); - indices.splice(i, 1); - isConcave.splice(i, 1); - vertexCount--; - let previousIndex = (vertexCount + i - 1) % vertexCount; - let nextIndex = i == vertexCount ? 0 : i; - isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); - isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); - } - if (vertexCount == 3) { - triangles.push(indices[2]); - triangles.push(indices[0]); - triangles.push(indices[1]); - } - return triangles; - } - decompose(verticesArray, triangles) { - let vertices = verticesArray; - let convexPolygons = this.convexPolygons; - this.polygonPool.freeAll(convexPolygons); - convexPolygons.length = 0; - let convexPolygonsIndices = this.convexPolygonsIndices; - this.polygonIndicesPool.freeAll(convexPolygonsIndices); - convexPolygonsIndices.length = 0; - let polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - let polygon = this.polygonPool.obtain(); - polygon.length = 0; - let fanBaseIndex = -1, lastWinding = 0; - for (let i = 0, n = triangles.length; i < n; i += 3) { - let t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; - let x1 = vertices[t1], y1 = vertices[t1 + 1]; - let x2 = vertices[t2], y2 = vertices[t2 + 1]; - let x3 = vertices[t3], y3 = vertices[t3 + 1]; - let merged = false; - if (fanBaseIndex == t1) { - let o = polygon.length - 4; - let winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); - let winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); - if (winding1 == lastWinding && winding2 == lastWinding) { - polygon.push(x3); - polygon.push(y3); - polygonIndices.push(t3); - merged = true; - } - } - if (!merged) { - if (polygon.length > 0) { - convexPolygons.push(polygon); - convexPolygonsIndices.push(polygonIndices); - } else { - this.polygonPool.free(polygon); - this.polygonIndicesPool.free(polygonIndices); - } - polygon = this.polygonPool.obtain(); - polygon.length = 0; - polygon.push(x1); - polygon.push(y1); - polygon.push(x2); - polygon.push(y2); - polygon.push(x3); - polygon.push(y3); - polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - polygonIndices.push(t1); - polygonIndices.push(t2); - polygonIndices.push(t3); - lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); - fanBaseIndex = t1; - } - } - if (polygon.length > 0) { - convexPolygons.push(polygon); - convexPolygonsIndices.push(polygonIndices); - } - for (let i = 0, n = convexPolygons.length; i < n; i++) { - polygonIndices = convexPolygonsIndices[i]; - if (polygonIndices.length == 0) - continue; - let firstIndex = polygonIndices[0]; - let lastIndex = polygonIndices[polygonIndices.length - 1]; - polygon = convexPolygons[i]; - let o = polygon.length - 4; - let prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; - let prevX = polygon[o + 2], prevY = polygon[o + 3]; - let firstX = polygon[0], firstY = polygon[1]; - let secondX = polygon[2], secondY = polygon[3]; - let winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); - for (let ii = 0; ii < n; ii++) { - if (ii == i) - continue; - let otherIndices = convexPolygonsIndices[ii]; - if (otherIndices.length != 3) - continue; - let otherFirstIndex = otherIndices[0]; - let otherSecondIndex = otherIndices[1]; - let otherLastIndex = otherIndices[2]; - let otherPoly = convexPolygons[ii]; - let x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; - if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) - continue; - let winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); - let winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); - if (winding1 == winding && winding2 == winding) { - otherPoly.length = 0; - otherIndices.length = 0; - polygon.push(x3); - polygon.push(y3); - polygonIndices.push(otherLastIndex); - prevPrevX = prevX; - prevPrevY = prevY; - prevX = x3; - prevY = y3; - ii = 0; - } - } - } - for (let i = convexPolygons.length - 1; i >= 0; i--) { - polygon = convexPolygons[i]; - if (polygon.length == 0) { - convexPolygons.splice(i, 1); - this.polygonPool.free(polygon); - polygonIndices = convexPolygonsIndices[i]; - convexPolygonsIndices.splice(i, 1); - this.polygonIndicesPool.free(polygonIndices); - } - } - return convexPolygons; - } - static isConcave(index, vertexCount, vertices, indices) { - let previous = indices[(vertexCount + index - 1) % vertexCount] << 1; - let current = indices[index] << 1; - let next = indices[(index + 1) % vertexCount] << 1; - return !this.positiveArea( - vertices[previous], - vertices[previous + 1], - vertices[current], - vertices[current + 1], - vertices[next], - vertices[next + 1] - ); - } - static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y) { - return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; - } - static winding(p1x, p1y, p2x, p2y, p3x, p3y) { - let px = p2x - p1x, py = p2y - p1y; - return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; - } -}; - -// spine-core/src/SkeletonClipping.ts -var SkeletonClipping = class { - triangulator = new Triangulator(); - clippingPolygon = new Array(); - clipOutput = new Array(); - clippedVertices = new Array(); - clippedUVs = new Array(); - clippedTriangles = new Array(); - scratch = new Array(); - clipAttachment = null; - clippingPolygons = null; - clipStart(slot, clip) { - if (this.clipAttachment) - return 0; - this.clipAttachment = clip; - let n = clip.worldVerticesLength; - let vertices = Utils.setArraySize(this.clippingPolygon, n); - clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); - let clippingPolygon = this.clippingPolygon; - SkeletonClipping.makeClockwise(clippingPolygon); - let clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); - for (let i = 0, n2 = clippingPolygons.length; i < n2; i++) { - let polygon = clippingPolygons[i]; - SkeletonClipping.makeClockwise(polygon); - polygon.push(polygon[0]); - polygon.push(polygon[1]); - } - return clippingPolygons.length; - } - clipEndWithSlot(slot) { - if (this.clipAttachment && this.clipAttachment.endSlot == slot.data) - this.clipEnd(); - } - clipEnd() { - if (!this.clipAttachment) - return; - this.clipAttachment = null; - this.clippingPolygons = null; - this.clippedVertices.length = 0; - this.clippedTriangles.length = 0; - this.clippingPolygon.length = 0; - } - isClipping() { - return this.clipAttachment != null; - } - clipTriangles(vertices, verticesLengthOrTriangles, trianglesOrTrianglesLength, trianglesLengthOrUvs, uvsOrLight, lightOrDark, darkOrTwoColor, twoColorParam) { - let triangles; - let trianglesLength; - let uvs; - let light; - let dark; - let twoColor; - if (typeof verticesLengthOrTriangles === "number") { - triangles = trianglesOrTrianglesLength; - trianglesLength = trianglesLengthOrUvs; - uvs = uvsOrLight; - light = lightOrDark; - dark = darkOrTwoColor; - twoColor = twoColorParam; - } else { - triangles = verticesLengthOrTriangles; - trianglesLength = trianglesOrTrianglesLength; - uvs = trianglesLengthOrUvs; - light = uvsOrLight; - dark = lightOrDark; - twoColor = darkOrTwoColor; - } - if (uvs && light && dark && typeof twoColor === "boolean") - this.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor); - else - this.clipTrianglesNoRender(vertices, triangles, trianglesLength); - } - clipTrianglesNoRender(vertices, triangles, trianglesLength) { - let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; - let clippedTriangles = this.clippedTriangles; - let polygons = this.clippingPolygons; - let polygonsCount = polygons.length; - let index = 0; - clippedVertices.length = 0; - clippedTriangles.length = 0; - for (let i = 0; i < trianglesLength; i += 3) { - let vertexOffset = triangles[i] << 1; - let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - vertexOffset = triangles[i + 1] << 1; - let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - vertexOffset = triangles[i + 2] << 1; - let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - let clipOutputLength = clipOutput.length; - if (clipOutputLength == 0) - continue; - let clipOutputCount = clipOutputLength >> 1; - let clipOutputItems = this.clipOutput; - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2); - for (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) { - let x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - } - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = x2; - clippedVerticesItems[s + 3] = y2; - clippedVerticesItems[s + 4] = x3; - clippedVerticesItems[s + 5] = y3; - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + 1; - clippedTrianglesItems[s + 2] = index + 2; - index += 3; - break; - } - } - } - } - clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor) { - let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; - let clippedTriangles = this.clippedTriangles; - let polygons = this.clippingPolygons; - let polygonsCount = polygons.length; - let vertexSize = twoColor ? 12 : 8; - let index = 0; - clippedVertices.length = 0; - clippedTriangles.length = 0; - for (let i = 0; i < trianglesLength; i += 3) { - let vertexOffset = triangles[i] << 1; - let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - let u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 1] << 1; - let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - let u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 2] << 1; - let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - let u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - let clipOutputLength = clipOutput.length; - if (clipOutputLength == 0) - continue; - let d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - let d = 1 / (d0 * d2 + d1 * (y1 - y3)); - let clipOutputCount = clipOutputLength >> 1; - let clipOutputItems = this.clipOutput; - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); - for (let ii = 0; ii < clipOutputLength; ii += 2, s += vertexSize) { - let x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - clippedVerticesItems[s + 2] = light.r; - clippedVerticesItems[s + 3] = light.g; - clippedVerticesItems[s + 4] = light.b; - clippedVerticesItems[s + 5] = light.a; - let c0 = x - x3, c1 = y - y3; - let a = (d0 * c0 + d1 * c1) * d; - let b = (d4 * c0 + d2 * c1) * d; - let c = 1 - a - b; - clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; - clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; - if (twoColor) { - clippedVerticesItems[s + 8] = dark.r; - clippedVerticesItems[s + 9] = dark.g; - clippedVerticesItems[s + 10] = dark.b; - clippedVerticesItems[s + 11] = dark.a; - } - } - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = light.r; - clippedVerticesItems[s + 3] = light.g; - clippedVerticesItems[s + 4] = light.b; - clippedVerticesItems[s + 5] = light.a; - if (!twoColor) { - clippedVerticesItems[s + 6] = u1; - clippedVerticesItems[s + 7] = v1; - clippedVerticesItems[s + 8] = x2; - clippedVerticesItems[s + 9] = y2; - clippedVerticesItems[s + 10] = light.r; - clippedVerticesItems[s + 11] = light.g; - clippedVerticesItems[s + 12] = light.b; - clippedVerticesItems[s + 13] = light.a; - clippedVerticesItems[s + 14] = u2; - clippedVerticesItems[s + 15] = v2; - clippedVerticesItems[s + 16] = x3; - clippedVerticesItems[s + 17] = y3; - clippedVerticesItems[s + 18] = light.r; - clippedVerticesItems[s + 19] = light.g; - clippedVerticesItems[s + 20] = light.b; - clippedVerticesItems[s + 21] = light.a; - clippedVerticesItems[s + 22] = u3; - clippedVerticesItems[s + 23] = v3; - } else { - clippedVerticesItems[s + 6] = u1; - clippedVerticesItems[s + 7] = v1; - clippedVerticesItems[s + 8] = dark.r; - clippedVerticesItems[s + 9] = dark.g; - clippedVerticesItems[s + 10] = dark.b; - clippedVerticesItems[s + 11] = dark.a; - clippedVerticesItems[s + 12] = x2; - clippedVerticesItems[s + 13] = y2; - clippedVerticesItems[s + 14] = light.r; - clippedVerticesItems[s + 15] = light.g; - clippedVerticesItems[s + 16] = light.b; - clippedVerticesItems[s + 17] = light.a; - clippedVerticesItems[s + 18] = u2; - clippedVerticesItems[s + 19] = v2; - clippedVerticesItems[s + 20] = dark.r; - clippedVerticesItems[s + 21] = dark.g; - clippedVerticesItems[s + 22] = dark.b; - clippedVerticesItems[s + 23] = dark.a; - clippedVerticesItems[s + 24] = x3; - clippedVerticesItems[s + 25] = y3; - clippedVerticesItems[s + 26] = light.r; - clippedVerticesItems[s + 27] = light.g; - clippedVerticesItems[s + 28] = light.b; - clippedVerticesItems[s + 29] = light.a; - clippedVerticesItems[s + 30] = u3; - clippedVerticesItems[s + 31] = v3; - clippedVerticesItems[s + 32] = dark.r; - clippedVerticesItems[s + 33] = dark.g; - clippedVerticesItems[s + 34] = dark.b; - clippedVerticesItems[s + 35] = dark.a; - } - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + 1; - clippedTrianglesItems[s + 2] = index + 2; - index += 3; - break; - } - } - } - } - clipTrianglesUnpacked(vertices, triangles, trianglesLength, uvs) { - let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices, clippedUVs = this.clippedUVs; - let clippedTriangles = this.clippedTriangles; - let polygons = this.clippingPolygons; - let polygonsCount = polygons.length; - let index = 0; - clippedVertices.length = 0; - clippedUVs.length = 0; - clippedTriangles.length = 0; - for (let i = 0; i < trianglesLength; i += 3) { - let vertexOffset = triangles[i] << 1; - let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - let u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 1] << 1; - let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - let u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 2] << 1; - let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - let u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - let clipOutputLength = clipOutput.length; - if (clipOutputLength == 0) - continue; - let d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - let d = 1 / (d0 * d2 + d1 * (y1 - y3)); - let clipOutputCount = clipOutputLength >> 1; - let clipOutputItems = this.clipOutput; - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2); - let clippedUVsItems = Utils.setArraySize(clippedUVs, s + clipOutputCount * 2); - for (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) { - let x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - let c0 = x - x3, c1 = y - y3; - let a = (d0 * c0 + d1 * c1) * d; - let b = (d4 * c0 + d2 * c1) * d; - let c = 1 - a - b; - clippedUVsItems[s] = u1 * a + u2 * b + u3 * c; - clippedUVsItems[s + 1] = v1 * a + v2 * b + v3 * c; - } - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = x2; - clippedVerticesItems[s + 3] = y2; - clippedVerticesItems[s + 4] = x3; - clippedVerticesItems[s + 5] = y3; - let clippedUVSItems = Utils.setArraySize(clippedUVs, s + 3 * 2); - clippedUVSItems[s] = u1; - clippedUVSItems[s + 1] = v1; - clippedUVSItems[s + 2] = u2; - clippedUVSItems[s + 3] = v2; - clippedUVSItems[s + 4] = u3; - clippedUVSItems[s + 5] = v3; - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + 1; - clippedTrianglesItems[s + 2] = index + 2; - index += 3; - break; - } - } - } - } - /** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping - * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */ - clip(x1, y1, x2, y2, x3, y3, clippingArea, output) { - let originalOutput = output; - let clipped = false; - let input; - if (clippingArea.length % 4 >= 2) { - input = output; - output = this.scratch; - } else - input = this.scratch; - input.length = 0; - input.push(x1); - input.push(y1); - input.push(x2); - input.push(y2); - input.push(x3); - input.push(y3); - input.push(x1); - input.push(y1); - output.length = 0; - let clippingVerticesLast = clippingArea.length - 4; - let clippingVertices = clippingArea; - for (let i = 0; ; i += 2) { - let edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; - let ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3]; - let outputStart = output.length; - let inputVertices = input; - for (let ii = 0, nn = input.length - 2; ii < nn; ) { - let inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; - ii += 2; - let inputX2 = inputVertices[ii], inputY2 = inputVertices[ii + 1]; - let s2 = ey * (edgeX - inputX2) > ex * (edgeY - inputY2); - let s1 = ey * (edgeX - inputX) - ex * (edgeY - inputY); - if (s1 > 0) { - if (s2) { - output.push(inputX2); - output.push(inputY2); - continue; - } - let ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex); - if (t >= 0 && t <= 1) { - output.push(inputX + ix * t); - output.push(inputY + iy * t); - } else { - output.push(inputX2); - output.push(inputY2); - continue; - } - } else if (s2) { - let ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex); - if (t >= 0 && t <= 1) { - output.push(inputX + ix * t); - output.push(inputY + iy * t); - output.push(inputX2); - output.push(inputY2); - } else { - output.push(inputX2); - output.push(inputY2); - continue; - } - } - clipped = true; - } - if (outputStart == output.length) { - originalOutput.length = 0; - return true; - } - output.push(output[0]); - output.push(output[1]); - if (i == clippingVerticesLast) - break; - let temp = output; - output = input; - output.length = 0; - input = temp; - } - if (originalOutput != output) { - originalOutput.length = 0; - for (let i = 0, n = output.length - 2; i < n; i++) - originalOutput[i] = output[i]; - } else - originalOutput.length = originalOutput.length - 2; - return clipped; - } - static makeClockwise(polygon) { - let vertices = polygon; - let verticeslength = polygon.length; - let area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; - for (let i = 0, n = verticeslength - 3; i < n; i += 2) { - p1x = vertices[i]; - p1y = vertices[i + 1]; - p2x = vertices[i + 2]; - p2y = vertices[i + 3]; - area += p1x * p2y - p2x * p1y; - } - if (area < 0) - return; - for (let i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { - let x = vertices[i], y = vertices[i + 1]; - let other = lastX - i; - vertices[i] = vertices[other]; - vertices[i + 1] = vertices[other + 1]; - vertices[other] = x; - vertices[other + 1] = y; - } - } -}; - -// spine-core/src/SkeletonJson.ts -var SkeletonJson = class { - attachmentLoader; - /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at - * runtime than were used in Spine. - * - * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */ - scale = 1; - linkedMeshes = new Array(); - constructor(attachmentLoader) { - this.attachmentLoader = attachmentLoader; - } - readSkeletonData(json) { - let scale = this.scale; - let skeletonData = new SkeletonData(); - let root = typeof json === "string" ? JSON.parse(json) : json; - let skeletonMap = root.skeleton; - if (skeletonMap) { - skeletonData.hash = skeletonMap.hash; - skeletonData.version = skeletonMap.spine; - skeletonData.x = skeletonMap.x; - skeletonData.y = skeletonMap.y; - skeletonData.width = skeletonMap.width; - skeletonData.height = skeletonMap.height; - skeletonData.referenceScale = getValue(skeletonMap, "referenceScale", 100) * scale; - skeletonData.fps = skeletonMap.fps; - skeletonData.imagesPath = skeletonMap.images ?? null; - skeletonData.audioPath = skeletonMap.audio ?? null; - } - if (root.bones) { - for (let i = 0; i < root.bones.length; i++) { - let boneMap = root.bones[i]; - let parent = null; - let parentName = getValue(boneMap, "parent", null); - if (parentName) - parent = skeletonData.findBone(parentName); - let data = new BoneData(skeletonData.bones.length, boneMap.name, parent); - data.length = getValue(boneMap, "length", 0) * scale; - data.x = getValue(boneMap, "x", 0) * scale; - data.y = getValue(boneMap, "y", 0) * scale; - data.rotation = getValue(boneMap, "rotation", 0); - data.scaleX = getValue(boneMap, "scaleX", 1); - data.scaleY = getValue(boneMap, "scaleY", 1); - data.shearX = getValue(boneMap, "shearX", 0); - data.shearY = getValue(boneMap, "shearY", 0); - data.inherit = Utils.enumValue(Inherit, getValue(boneMap, "inherit", "Normal")); - data.skinRequired = getValue(boneMap, "skin", false); - let color = getValue(boneMap, "color", null); - if (color) - data.color.setFromString(color); - skeletonData.bones.push(data); - } - } - if (root.slots) { - for (let i = 0; i < root.slots.length; i++) { - let slotMap = root.slots[i]; - let slotName = slotMap.name; - let boneData = skeletonData.findBone(slotMap.bone); - if (!boneData) - throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`); - let data = new SlotData(skeletonData.slots.length, slotName, boneData); - let color = getValue(slotMap, "color", null); - if (color) - data.color.setFromString(color); - let dark = getValue(slotMap, "dark", null); - if (dark) - data.darkColor = Color.fromString(dark); - data.attachmentName = getValue(slotMap, "attachment", null); - data.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, "blend", "normal")); - data.visible = getValue(slotMap, "visible", true); - skeletonData.slots.push(data); - } - } - if (root.ik) { - for (let i = 0; i < root.ik.length; i++) { - let constraintMap = root.ik[i]; - let data = new IkConstraintData(constraintMap.name); - data.order = getValue(constraintMap, "order", 0); - data.skinRequired = getValue(constraintMap, "skin", false); - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - let bone = skeletonData.findBone(constraintMap.bones[ii]); - if (!bone) - throw new Error(`Couldn't find bone ${constraintMap.bones[ii]} for IK constraint ${constraintMap.name}.`); - data.bones.push(bone); - } - let target = skeletonData.findBone(constraintMap.target); - ; - if (!target) - throw new Error(`Couldn't find target bone ${constraintMap.target} for IK constraint ${constraintMap.name}.`); - data.target = target; - data.mix = getValue(constraintMap, "mix", 1); - data.softness = getValue(constraintMap, "softness", 0) * scale; - data.bendDirection = getValue(constraintMap, "bendPositive", true) ? 1 : -1; - data.compress = getValue(constraintMap, "compress", false); - data.stretch = getValue(constraintMap, "stretch", false); - data.uniform = getValue(constraintMap, "uniform", false); - skeletonData.ikConstraints.push(data); - } - } - if (root.transform) { - for (let i = 0; i < root.transform.length; i++) { - let constraintMap = root.transform[i]; - let data = new TransformConstraintData(constraintMap.name); - data.order = getValue(constraintMap, "order", 0); - data.skinRequired = getValue(constraintMap, "skin", false); - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - let boneName = constraintMap.bones[ii]; - let bone = skeletonData.findBone(boneName); - if (!bone) - throw new Error(`Couldn't find bone ${boneName} for transform constraint ${constraintMap.name}.`); - data.bones.push(bone); - } - let targetName = constraintMap.target; - let target = skeletonData.findBone(targetName); - if (!target) - throw new Error(`Couldn't find target bone ${targetName} for transform constraint ${constraintMap.name}.`); - data.target = target; - data.local = getValue(constraintMap, "local", false); - data.relative = getValue(constraintMap, "relative", false); - data.offsetRotation = getValue(constraintMap, "rotation", 0); - data.offsetX = getValue(constraintMap, "x", 0) * scale; - data.offsetY = getValue(constraintMap, "y", 0) * scale; - data.offsetScaleX = getValue(constraintMap, "scaleX", 0); - data.offsetScaleY = getValue(constraintMap, "scaleY", 0); - data.offsetShearY = getValue(constraintMap, "shearY", 0); - data.mixRotate = getValue(constraintMap, "mixRotate", 1); - data.mixX = getValue(constraintMap, "mixX", 1); - data.mixY = getValue(constraintMap, "mixY", data.mixX); - data.mixScaleX = getValue(constraintMap, "mixScaleX", 1); - data.mixScaleY = getValue(constraintMap, "mixScaleY", data.mixScaleX); - data.mixShearY = getValue(constraintMap, "mixShearY", 1); - skeletonData.transformConstraints.push(data); - } - } - if (root.path) { - for (let i = 0; i < root.path.length; i++) { - let constraintMap = root.path[i]; - let data = new PathConstraintData(constraintMap.name); - data.order = getValue(constraintMap, "order", 0); - data.skinRequired = getValue(constraintMap, "skin", false); - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - let boneName = constraintMap.bones[ii]; - let bone = skeletonData.findBone(boneName); - if (!bone) - throw new Error(`Couldn't find bone ${boneName} for path constraint ${constraintMap.name}.`); - data.bones.push(bone); - } - let targetName = constraintMap.target; - let target = skeletonData.findSlot(targetName); - if (!target) - throw new Error(`Couldn't find target slot ${targetName} for path constraint ${constraintMap.name}.`); - data.target = target; - data.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, "positionMode", "Percent")); - data.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, "spacingMode", "Length")); - data.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, "rotateMode", "Tangent")); - data.offsetRotation = getValue(constraintMap, "rotation", 0); - data.position = getValue(constraintMap, "position", 0); - if (data.positionMode == 0 /* Fixed */) - data.position *= scale; - data.spacing = getValue(constraintMap, "spacing", 0); - if (data.spacingMode == 0 /* Length */ || data.spacingMode == 1 /* Fixed */) - data.spacing *= scale; - data.mixRotate = getValue(constraintMap, "mixRotate", 1); - data.mixX = getValue(constraintMap, "mixX", 1); - data.mixY = getValue(constraintMap, "mixY", data.mixX); - skeletonData.pathConstraints.push(data); - } - } - if (root.physics) { - for (let i = 0; i < root.physics.length; i++) { - const constraintMap = root.physics[i]; - const data = new PhysicsConstraintData(constraintMap.name); - data.order = getValue(constraintMap, "order", 0); - data.skinRequired = getValue(constraintMap, "skin", false); - const boneName = constraintMap.bone; - const bone = skeletonData.findBone(boneName); - if (bone == null) - throw new Error("Physics bone not found: " + boneName); - data.bone = bone; - data.x = getValue(constraintMap, "x", 0); - data.y = getValue(constraintMap, "y", 0); - data.rotate = getValue(constraintMap, "rotate", 0); - data.scaleX = getValue(constraintMap, "scaleX", 0); - data.shearX = getValue(constraintMap, "shearX", 0); - data.limit = getValue(constraintMap, "limit", 5e3) * scale; - data.step = 1 / getValue(constraintMap, "fps", 60); - data.inertia = getValue(constraintMap, "inertia", 1); - data.strength = getValue(constraintMap, "strength", 100); - data.damping = getValue(constraintMap, "damping", 1); - data.massInverse = 1 / getValue(constraintMap, "mass", 1); - data.wind = getValue(constraintMap, "wind", 0); - data.gravity = getValue(constraintMap, "gravity", 0); - data.mix = getValue(constraintMap, "mix", 1); - data.inertiaGlobal = getValue(constraintMap, "inertiaGlobal", false); - data.strengthGlobal = getValue(constraintMap, "strengthGlobal", false); - data.dampingGlobal = getValue(constraintMap, "dampingGlobal", false); - data.massGlobal = getValue(constraintMap, "massGlobal", false); - data.windGlobal = getValue(constraintMap, "windGlobal", false); - data.gravityGlobal = getValue(constraintMap, "gravityGlobal", false); - data.mixGlobal = getValue(constraintMap, "mixGlobal", false); - skeletonData.physicsConstraints.push(data); - } - } - if (root.skins) { - for (let i = 0; i < root.skins.length; i++) { - let skinMap = root.skins[i]; - let skin = new Skin(skinMap.name); - if (skinMap.bones) { - for (let ii = 0; ii < skinMap.bones.length; ii++) { - let boneName = skinMap.bones[ii]; - let bone = skeletonData.findBone(boneName); - if (!bone) - throw new Error(`Couldn't find bone ${boneName} for skin ${skinMap.name}.`); - skin.bones.push(bone); - } - } - if (skinMap.ik) { - for (let ii = 0; ii < skinMap.ik.length; ii++) { - let constraintName = skinMap.ik[ii]; - let constraint = skeletonData.findIkConstraint(constraintName); - if (!constraint) - throw new Error(`Couldn't find IK constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.transform) { - for (let ii = 0; ii < skinMap.transform.length; ii++) { - let constraintName = skinMap.transform[ii]; - let constraint = skeletonData.findTransformConstraint(constraintName); - if (!constraint) - throw new Error(`Couldn't find transform constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.path) { - for (let ii = 0; ii < skinMap.path.length; ii++) { - let constraintName = skinMap.path[ii]; - let constraint = skeletonData.findPathConstraint(constraintName); - if (!constraint) - throw new Error(`Couldn't find path constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.physics) { - for (let ii = 0; ii < skinMap.physics.length; ii++) { - let constraintName = skinMap.physics[ii]; - let constraint = skeletonData.findPhysicsConstraint(constraintName); - if (!constraint) - throw new Error(`Couldn't find physics constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - for (let slotName in skinMap.attachments) { - let slot = skeletonData.findSlot(slotName); - if (!slot) - throw new Error(`Couldn't find slot ${slotName} for skin ${skinMap.name}.`); - let slotMap = skinMap.attachments[slotName]; - for (let entryName in slotMap) { - let attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData); - if (attachment) - skin.setAttachment(slot.index, entryName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") - skeletonData.defaultSkin = skin; - } - } - for (let i = 0, n = this.linkedMeshes.length; i < n; i++) { - let linkedMesh = this.linkedMeshes[i]; - let skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); - if (!skin) - throw new Error(`Skin not found: ${linkedMesh.skin}`); - let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); - if (!parent) - throw new Error(`Parent mesh not found: ${linkedMesh.parent}`); - linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh; - linkedMesh.mesh.setParentMesh(parent); - if (linkedMesh.mesh.region != null) - linkedMesh.mesh.updateRegion(); - } - this.linkedMeshes.length = 0; - if (root.events) { - for (let eventName in root.events) { - let eventMap = root.events[eventName]; - let data = new EventData(eventName); - data.intValue = getValue(eventMap, "int", 0); - data.floatValue = getValue(eventMap, "float", 0); - data.stringValue = getValue(eventMap, "string", ""); - data.audioPath = getValue(eventMap, "audio", null); - if (data.audioPath) { - data.volume = getValue(eventMap, "volume", 1); - data.balance = getValue(eventMap, "balance", 0); - } - skeletonData.events.push(data); - } - } - if (root.animations) { - for (let animationName in root.animations) { - let animationMap = root.animations[animationName]; - this.readAnimation(animationMap, animationName, skeletonData); - } - } - return skeletonData; - } - readAttachment(map, skin, slotIndex, name, skeletonData) { - let scale = this.scale; - name = getValue(map, "name", name); - switch (getValue(map, "type", "region")) { - case "region": { - let path = getValue(map, "path", name); - let sequence = this.readSequence(getValue(map, "sequence", null)); - let region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence); - if (!region) - return null; - region.path = path; - region.x = getValue(map, "x", 0) * scale; - region.y = getValue(map, "y", 0) * scale; - region.scaleX = getValue(map, "scaleX", 1); - region.scaleY = getValue(map, "scaleY", 1); - region.rotation = getValue(map, "rotation", 0); - region.width = map.width * scale; - region.height = map.height * scale; - region.sequence = sequence; - let color = getValue(map, "color", null); - if (color) - region.color.setFromString(color); - if (region.region != null) - region.updateRegion(); - return region; - } - case "boundingbox": { - let box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - if (!box) - return null; - this.readVertices(map, box, map.vertexCount << 1); - let color = getValue(map, "color", null); - if (color) - box.color.setFromString(color); - return box; - } - case "mesh": - case "linkedmesh": { - let path = getValue(map, "path", name); - let sequence = this.readSequence(getValue(map, "sequence", null)); - let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) - return null; - mesh.path = path; - let color = getValue(map, "color", null); - if (color) - mesh.color.setFromString(color); - mesh.width = getValue(map, "width", 0) * scale; - mesh.height = getValue(map, "height", 0) * scale; - mesh.sequence = sequence; - let parent = getValue(map, "parent", null); - if (parent) { - this.linkedMeshes.push(new LinkedMesh2(mesh, getValue(map, "skin", null), slotIndex, parent, getValue(map, "timelines", true))); - return mesh; - } - let uvs = map.uvs; - this.readVertices(map, mesh, uvs.length); - mesh.triangles = map.triangles; - mesh.regionUVs = uvs; - if (mesh.region != null) - mesh.updateRegion(); - mesh.edges = getValue(map, "edges", null); - mesh.hullLength = getValue(map, "hull", 0) * 2; - return mesh; - } - case "path": { - let path = this.attachmentLoader.newPathAttachment(skin, name); - if (!path) - return null; - path.closed = getValue(map, "closed", false); - path.constantSpeed = getValue(map, "constantSpeed", true); - let vertexCount = map.vertexCount; - this.readVertices(map, path, vertexCount << 1); - let lengths = Utils.newArray(vertexCount / 3, 0); - for (let i = 0; i < map.lengths.length; i++) - lengths[i] = map.lengths[i] * scale; - path.lengths = lengths; - let color = getValue(map, "color", null); - if (color) - path.color.setFromString(color); - return path; - } - case "point": { - let point = this.attachmentLoader.newPointAttachment(skin, name); - if (!point) - return null; - point.x = getValue(map, "x", 0) * scale; - point.y = getValue(map, "y", 0) * scale; - point.rotation = getValue(map, "rotation", 0); - let color = getValue(map, "color", null); - if (color) - point.color.setFromString(color); - return point; - } - case "clipping": { - let clip = this.attachmentLoader.newClippingAttachment(skin, name); - if (!clip) - return null; - let end = getValue(map, "end", null); - if (end) - clip.endSlot = skeletonData.findSlot(end); - let vertexCount = map.vertexCount; - this.readVertices(map, clip, vertexCount << 1); - let color = getValue(map, "color", null); - if (color) - clip.color.setFromString(color); - return clip; - } - } - return null; - } - readSequence(map) { - if (map == null) - return null; - let sequence = new Sequence(getValue(map, "count", 0)); - sequence.start = getValue(map, "start", 1); - sequence.digits = getValue(map, "digits", 0); - sequence.setupIndex = getValue(map, "setup", 0); - return sequence; - } - readVertices(map, attachment, verticesLength) { - let scale = this.scale; - attachment.worldVerticesLength = verticesLength; - let vertices = map.vertices; - if (verticesLength == vertices.length) { - let scaledVertices = Utils.toFloatArray(vertices); - if (scale != 1) { - for (let i = 0, n = vertices.length; i < n; i++) - scaledVertices[i] *= scale; - } - attachment.vertices = scaledVertices; - return; - } - let weights = new Array(); - let bones = new Array(); - for (let i = 0, n = vertices.length; i < n; ) { - let boneCount = vertices[i++]; - bones.push(boneCount); - for (let nn = i + boneCount * 4; i < nn; i += 4) { - bones.push(vertices[i]); - weights.push(vertices[i + 1] * scale); - weights.push(vertices[i + 2] * scale); - weights.push(vertices[i + 3]); - } - } - attachment.bones = bones; - attachment.vertices = Utils.toFloatArray(weights); - } - readAnimation(map, name, skeletonData) { - let scale = this.scale; - let timelines = new Array(); - if (map.slots) { - for (let slotName in map.slots) { - let slotMap = map.slots[slotName]; - let slot = skeletonData.findSlot(slotName); - if (!slot) - throw new Error("Slot not found: " + slotName); - let slotIndex = slot.index; - for (let timelineName in slotMap) { - let timelineMap = slotMap[timelineName]; - if (!timelineMap) - continue; - let frames = timelineMap.length; - if (timelineName == "attachment") { - let timeline = new AttachmentTimeline(frames, slotIndex); - for (let frame = 0; frame < frames; frame++) { - let keyMap = timelineMap[frame]; - timeline.setFrame(frame, getValue(keyMap, "time", 0), getValue(keyMap, "name", null)); - } - timelines.push(timeline); - } else if (timelineName == "rgba") { - let timeline = new RGBATimeline(frames, frames << 2, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.color); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color.a); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let newColor = Color.fromString(nextMap.color); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1); - } - time = time2; - color = newColor; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineName == "rgb") { - let timeline = new RGBTimeline(frames, frames * 3, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.color); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let newColor = Color.fromString(nextMap.color); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - } - time = time2; - color = newColor; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineName == "alpha") { - timelines.push(readTimeline12(timelineMap, new AlphaTimeline(frames, frames, slotIndex), 0, 1)); - } else if (timelineName == "rgba2") { - let timeline = new RGBA2Timeline(frames, frames * 7, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.light); - let color2 = Color.fromString(keyMap.dark); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let newColor = Color.fromString(nextMap.light); - let newColor2 = Color.fromString(nextMap.dark); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1); - } - time = time2; - color = newColor; - color2 = newColor2; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineName == "rgb2") { - let timeline = new RGB2Timeline(frames, frames * 6, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.light); - let color2 = Color.fromString(keyMap.dark); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let newColor = Color.fromString(nextMap.light); - let newColor2 = Color.fromString(nextMap.dark); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1); - } - time = time2; - color = newColor; - color2 = newColor2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - } - } - if (map.bones) { - for (let boneName in map.bones) { - let boneMap = map.bones[boneName]; - let bone = skeletonData.findBone(boneName); - if (!bone) - throw new Error("Bone not found: " + boneName); - let boneIndex = bone.index; - for (let timelineName in boneMap) { - let timelineMap = boneMap[timelineName]; - let frames = timelineMap.length; - if (frames == 0) - continue; - if (timelineName === "rotate") { - timelines.push(readTimeline12(timelineMap, new RotateTimeline(frames, frames, boneIndex), 0, 1)); - } else if (timelineName === "translate") { - let timeline = new TranslateTimeline(frames, frames << 1, boneIndex); - timelines.push(readTimeline22(timelineMap, timeline, "x", "y", 0, scale)); - } else if (timelineName === "translatex") { - let timeline = new TranslateXTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, scale)); - } else if (timelineName === "translatey") { - let timeline = new TranslateYTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, scale)); - } else if (timelineName === "scale") { - let timeline = new ScaleTimeline(frames, frames << 1, boneIndex); - timelines.push(readTimeline22(timelineMap, timeline, "x", "y", 1, 1)); - } else if (timelineName === "scalex") { - let timeline = new ScaleXTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 1, 1)); - } else if (timelineName === "scaley") { - let timeline = new ScaleYTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 1, 1)); - } else if (timelineName === "shear") { - let timeline = new ShearTimeline(frames, frames << 1, boneIndex); - timelines.push(readTimeline22(timelineMap, timeline, "x", "y", 0, 1)); - } else if (timelineName === "shearx") { - let timeline = new ShearXTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, 1)); - } else if (timelineName === "sheary") { - let timeline = new ShearYTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, 1)); - } else if (timelineName === "inherit") { - let timeline = new InheritTimeline(frames, bone.index); - for (let frame = 0; frame < timelineMap.length; frame++) { - let aFrame = timelineMap[frame]; - timeline.setFrame(frame, getValue(aFrame, "time", 0), Utils.enumValue(Inherit, getValue(aFrame, "inherit", "Normal"))); - } - timelines.push(timeline); - } - } - } - } - if (map.ik) { - for (let constraintName in map.ik) { - let constraintMap = map.ik[constraintName]; - let keyMap = constraintMap[0]; - if (!keyMap) - continue; - let constraint = skeletonData.findIkConstraint(constraintName); - if (!constraint) - throw new Error("IK Constraint not found: " + constraintName); - let constraintIndex = skeletonData.ikConstraints.indexOf(constraint); - let timeline = new IkConstraintTimeline(constraintMap.length, constraintMap.length << 1, constraintIndex); - let time = getValue(keyMap, "time", 0); - let mix = getValue(keyMap, "mix", 1); - let softness = getValue(keyMap, "softness", 0) * scale; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mix, softness, getValue(keyMap, "bendPositive", true) ? 1 : -1, getValue(keyMap, "compress", false), getValue(keyMap, "stretch", false)); - let nextMap = constraintMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let mix2 = getValue(nextMap, "mix", 1); - let softness2 = getValue(nextMap, "softness", 0) * scale; - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale); - } - time = time2; - mix = mix2; - softness = softness2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - if (map.transform) { - for (let constraintName in map.transform) { - let timelineMap = map.transform[constraintName]; - let keyMap = timelineMap[0]; - if (!keyMap) - continue; - let constraint = skeletonData.findTransformConstraint(constraintName); - if (!constraint) - throw new Error("Transform constraint not found: " + constraintName); - let constraintIndex = skeletonData.transformConstraints.indexOf(constraint); - let timeline = new TransformConstraintTimeline(timelineMap.length, timelineMap.length * 6, constraintIndex); - let time = getValue(keyMap, "time", 0); - let mixRotate = getValue(keyMap, "mixRotate", 1); - let mixX = getValue(keyMap, "mixX", 1); - let mixY = getValue(keyMap, "mixY", mixX); - let mixScaleX = getValue(keyMap, "mixScaleX", 1); - let mixScaleY = getValue(keyMap, "mixScaleY", mixScaleX); - let mixShearY = getValue(keyMap, "mixShearY", 1); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let mixRotate2 = getValue(nextMap, "mixRotate", 1); - let mixX2 = getValue(nextMap, "mixX", 1); - let mixY2 = getValue(nextMap, "mixY", mixX2); - let mixScaleX2 = getValue(nextMap, "mixScaleX", 1); - let mixScaleY2 = getValue(nextMap, "mixScaleY", mixScaleX2); - let mixShearY2 = getValue(nextMap, "mixShearY", 1); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - mixScaleX = mixScaleX2; - mixScaleY = mixScaleY2; - mixScaleX = mixScaleX2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - if (map.path) { - for (let constraintName in map.path) { - let constraintMap = map.path[constraintName]; - let constraint = skeletonData.findPathConstraint(constraintName); - if (!constraint) - throw new Error("Path constraint not found: " + constraintName); - let constraintIndex = skeletonData.pathConstraints.indexOf(constraint); - for (let timelineName in constraintMap) { - let timelineMap = constraintMap[timelineName]; - let keyMap = timelineMap[0]; - if (!keyMap) - continue; - let frames = timelineMap.length; - if (timelineName === "position") { - let timeline = new PathConstraintPositionTimeline(frames, frames, constraintIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, constraint.positionMode == 0 /* Fixed */ ? scale : 1)); - } else if (timelineName === "spacing") { - let timeline = new PathConstraintSpacingTimeline(frames, frames, constraintIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, constraint.spacingMode == 0 /* Length */ || constraint.spacingMode == 1 /* Fixed */ ? scale : 1)); - } else if (timelineName === "mix") { - let timeline = new PathConstraintMixTimeline(frames, frames * 3, constraintIndex); - let time = getValue(keyMap, "time", 0); - let mixRotate = getValue(keyMap, "mixRotate", 1); - let mixX = getValue(keyMap, "mixX", 1); - let mixY = getValue(keyMap, "mixY", mixX); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let mixRotate2 = getValue(nextMap, "mixRotate", 1); - let mixX2 = getValue(nextMap, "mixX", 1); - let mixY2 = getValue(nextMap, "mixY", mixX2); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - } - } - if (map.physics) { - for (let constraintName in map.physics) { - let constraintMap = map.physics[constraintName]; - let constraintIndex = -1; - if (constraintName.length > 0) { - let constraint = skeletonData.findPhysicsConstraint(constraintName); - if (!constraint) - throw new Error("Physics constraint not found: " + constraintName); - constraintIndex = skeletonData.physicsConstraints.indexOf(constraint); - } - for (let timelineName in constraintMap) { - let timelineMap = constraintMap[timelineName]; - let keyMap = timelineMap[0]; - if (!keyMap) - continue; - let frames = timelineMap.length; - if (timelineName == "reset") { - const timeline2 = new PhysicsConstraintResetTimeline(frames, constraintIndex); - for (let frame = 0; keyMap != null; keyMap = timelineMap[frame + 1], frame++) - timeline2.setFrame(frame, getValue(keyMap, "time", 0)); - timelines.push(timeline2); - continue; - } - let timeline; - if (timelineName == "inertia") - timeline = new PhysicsConstraintInertiaTimeline(frames, frames, constraintIndex); - else if (timelineName == "strength") - timeline = new PhysicsConstraintStrengthTimeline(frames, frames, constraintIndex); - else if (timelineName == "damping") - timeline = new PhysicsConstraintDampingTimeline(frames, frames, constraintIndex); - else if (timelineName == "mass") - timeline = new PhysicsConstraintMassTimeline(frames, frames, constraintIndex); - else if (timelineName == "wind") - timeline = new PhysicsConstraintWindTimeline(frames, frames, constraintIndex); - else if (timelineName == "gravity") - timeline = new PhysicsConstraintGravityTimeline(frames, frames, constraintIndex); - else if (timelineName == "mix") - timeline = new PhysicsConstraintMixTimeline(frames, frames, constraintIndex); - else - continue; - timelines.push(readTimeline12(timelineMap, timeline, 0, 1)); - } - } - } - if (map.attachments) { - for (let attachmentsName in map.attachments) { - let attachmentsMap = map.attachments[attachmentsName]; - let skin = skeletonData.findSkin(attachmentsName); - if (!skin) - throw new Error("Skin not found: " + attachmentsName); - for (let slotMapName in attachmentsMap) { - let slotMap = attachmentsMap[slotMapName]; - let slot = skeletonData.findSlot(slotMapName); - if (!slot) - throw new Error("Slot not found: " + slotMapName); - let slotIndex = slot.index; - for (let attachmentMapName in slotMap) { - let attachmentMap = slotMap[attachmentMapName]; - let attachment = skin.getAttachment(slotIndex, attachmentMapName); - for (let timelineMapName in attachmentMap) { - let timelineMap = attachmentMap[timelineMapName]; - let keyMap = timelineMap[0]; - if (!keyMap) - continue; - if (timelineMapName == "deform") { - let weighted = attachment.bones; - let vertices = attachment.vertices; - let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; - let timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment); - let time = getValue(keyMap, "time", 0); - for (let frame = 0, bezier = 0; ; frame++) { - let deform; - let verticesValue = getValue(keyMap, "vertices", null); - if (!verticesValue) - deform = weighted ? Utils.newFloatArray(deformLength) : vertices; - else { - deform = Utils.newFloatArray(deformLength); - let start = getValue(keyMap, "offset", 0); - Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); - if (scale != 1) { - for (let i = start, n = i + verticesValue.length; i < n; i++) - deform[i] *= scale; - } - if (!weighted) { - for (let i = 0; i < deformLength; i++) - deform[i] += vertices[i]; - } - } - timeline.setFrame(frame, time, deform); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let curve = keyMap.curve; - if (curve) - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1); - time = time2; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineMapName == "sequence") { - let timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment); - let lastDelay = 0; - for (let frame = 0; frame < timelineMap.length; frame++) { - let delay = getValue(keyMap, "delay", lastDelay); - let time = getValue(keyMap, "time", 0); - let mode = SequenceMode[getValue(keyMap, "mode", "hold")]; - let index = getValue(keyMap, "index", 0); - timeline.setFrame(frame, time, mode, index, delay); - lastDelay = delay; - keyMap = timelineMap[frame + 1]; - } - timelines.push(timeline); - } - } - } - } - } - } - if (map.drawOrder) { - let timeline = new DrawOrderTimeline(map.drawOrder.length); - let slotCount = skeletonData.slots.length; - let frame = 0; - for (let i = 0; i < map.drawOrder.length; i++, frame++) { - let drawOrderMap = map.drawOrder[i]; - let drawOrder = null; - let offsets = getValue(drawOrderMap, "offsets", null); - if (offsets) { - drawOrder = Utils.newArray(slotCount, -1); - let unchanged = Utils.newArray(slotCount - offsets.length, 0); - let originalIndex = 0, unchangedIndex = 0; - for (let ii = 0; ii < offsets.length; ii++) { - let offsetMap = offsets[ii]; - let slot = skeletonData.findSlot(offsetMap.slot); - if (!slot) - throw new Error("Slot not found: " + slot); - let slotIndex = slot.index; - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - drawOrder[originalIndex + offsetMap.offset] = originalIndex++; - } - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - for (let ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) - drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frame, getValue(drawOrderMap, "time", 0), drawOrder); - } - timelines.push(timeline); - } - if (map.events) { - let timeline = new EventTimeline(map.events.length); - let frame = 0; - for (let i = 0; i < map.events.length; i++, frame++) { - let eventMap = map.events[i]; - let eventData = skeletonData.findEvent(eventMap.name); - if (!eventData) - throw new Error("Event not found: " + eventMap.name); - let event = new Event(Utils.toSinglePrecision(getValue(eventMap, "time", 0)), eventData); - event.intValue = getValue(eventMap, "int", eventData.intValue); - event.floatValue = getValue(eventMap, "float", eventData.floatValue); - event.stringValue = getValue(eventMap, "string", eventData.stringValue); - if (event.data.audioPath) { - event.volume = getValue(eventMap, "volume", 1); - event.balance = getValue(eventMap, "balance", 0); - } - timeline.setFrame(frame, event); - } - timelines.push(timeline); - } - let duration = 0; - for (let i = 0, n = timelines.length; i < n; i++) - duration = Math.max(duration, timelines[i].getDuration()); - skeletonData.animations.push(new Animation(name, timelines, duration)); - } -}; -var LinkedMesh2 = class { - parent; - skin; - slotIndex; - mesh; - inheritTimeline; - constructor(mesh, skin, slotIndex, parent, inheritDeform) { - this.mesh = mesh; - this.skin = skin; - this.slotIndex = slotIndex; - this.parent = parent; - this.inheritTimeline = inheritDeform; - } -}; -function readTimeline12(keys, timeline, defaultValue, scale) { - let keyMap = keys[0]; - let time = getValue(keyMap, "time", 0); - let value = getValue(keyMap, "value", defaultValue) * scale; - let bezier = 0; - for (let frame = 0; ; frame++) { - timeline.setFrame(frame, time, value); - let nextMap = keys[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - return timeline; - } - let time2 = getValue(nextMap, "time", 0); - let value2 = getValue(nextMap, "value", defaultValue) * scale; - if (keyMap.curve) - bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale); - time = time2; - value = value2; - keyMap = nextMap; - } -} -function readTimeline22(keys, timeline, name1, name2, defaultValue, scale) { - let keyMap = keys[0]; - let time = getValue(keyMap, "time", 0); - let value1 = getValue(keyMap, name1, defaultValue) * scale; - let value2 = getValue(keyMap, name2, defaultValue) * scale; - let bezier = 0; - for (let frame = 0; ; frame++) { - timeline.setFrame(frame, time, value1, value2); - let nextMap = keys[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - return timeline; - } - let time2 = getValue(nextMap, "time", 0); - let nvalue1 = getValue(nextMap, name1, defaultValue) * scale; - let nvalue2 = getValue(nextMap, name2, defaultValue) * scale; - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale); - } - time = time2; - value1 = nvalue1; - value2 = nvalue2; - keyMap = nextMap; - } -} -function readCurve(curve, timeline, bezier, frame, value, time1, time2, value1, value2, scale) { - if (curve == "stepped") { - timeline.setStepped(frame); - return bezier; - } - let i = value << 2; - let cx1 = curve[i]; - let cy1 = curve[i + 1] * scale; - let cx2 = curve[i + 2]; - let cy2 = curve[i + 3] * scale; - timeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); - return bezier + 1; -} -function getValue(map, property, defaultValue) { - return map[property] !== void 0 ? map[property] : defaultValue; -} - -// spine-core/src/polyfills.ts -(() => { - if (typeof Math.fround === "undefined") { - Math.fround = function(array) { - return function(x) { - return array[0] = x, array[0]; - }; - }(new Float32Array(1)); - } -})(); - -// spine-webgl/src/WebGL.ts -var ManagedWebGLRenderingContext = class { - canvas; - gl; - restorables = new Array(); - constructor(canvasOrContext, contextConfig = { alpha: "true" }) { - if (!(canvasOrContext instanceof WebGLRenderingContext || typeof WebGL2RenderingContext !== "undefined" && canvasOrContext instanceof WebGL2RenderingContext)) { - let canvas = canvasOrContext; - this.gl = canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig); - this.canvas = canvas; - canvas.addEventListener("webglcontextlost", (e) => { - let event = e; - if (e) - e.preventDefault(); - }); - canvas.addEventListener("webglcontextrestored", (e) => { - for (let i = 0, n = this.restorables.length; i < n; i++) - this.restorables[i].restore(); - }); - } else { - this.gl = canvasOrContext; - this.canvas = this.gl.canvas; - } - } - addRestorable(restorable) { - this.restorables.push(restorable); - } - removeRestorable(restorable) { - let index = this.restorables.indexOf(restorable); - if (index > -1) - this.restorables.splice(index, 1); - } -}; - -// spine-webgl/src/GLTexture.ts -var _GLTexture = class extends Texture { - context; - texture = null; - boundUnit = 0; - useMipMaps = false; - constructor(context, image, useMipMaps = false) { - super(image); - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.useMipMaps = useMipMaps; - this.restore(); - this.context.addRestorable(this); - } - setFilters(minFilter, magFilter) { - let gl = this.context.gl; - this.bind(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, _GLTexture.validateMagFilter(magFilter)); - this.useMipMaps = _GLTexture.usesMipMaps(minFilter); - if (this.useMipMaps) - gl.generateMipmap(gl.TEXTURE_2D); - } - static validateMagFilter(magFilter) { - switch (magFilter) { - case 9987 /* MipMapLinearLinear */: - case 9985 /* MipMapLinearNearest */: - case 9986 /* MipMapNearestLinear */: - case 9984 /* MipMapNearestNearest */: - return 9729 /* Linear */; - default: - return magFilter; - } - } - static usesMipMaps(filter) { - switch (filter) { - case 9987 /* MipMapLinearLinear */: - case 9985 /* MipMapLinearNearest */: - case 9986 /* MipMapNearestLinear */: - case 9984 /* MipMapNearestNearest */: - return true; - default: - return false; - } - } - setWraps(uWrap, vWrap) { - let gl = this.context.gl; - this.bind(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); - } - update(useMipMaps) { - let gl = this.context.gl; - if (!this.texture) - this.texture = this.context.gl.createTexture(); - this.bind(); - if (_GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL) - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - if (useMipMaps) - gl.generateMipmap(gl.TEXTURE_2D); - } - restore() { - this.texture = null; - this.update(this.useMipMaps); - } - bind(unit = 0) { - let gl = this.context.gl; - this.boundUnit = unit; - gl.activeTexture(gl.TEXTURE0 + unit); - gl.bindTexture(gl.TEXTURE_2D, this.texture); - } - unbind() { - let gl = this.context.gl; - gl.activeTexture(gl.TEXTURE0 + this.boundUnit); - gl.bindTexture(gl.TEXTURE_2D, null); - } - dispose() { - this.context.removeRestorable(this); - let gl = this.context.gl; - gl.deleteTexture(this.texture); - } -}; -var GLTexture = _GLTexture; -__publicField(GLTexture, "DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL", false); - -// spine-webgl/src/AssetManager.ts -var AssetManager = class extends AssetManagerBase { - constructor(context, pathPrefix = "", downloader = new Downloader()) { - super((image) => { - return new GLTexture(context, image); - }, pathPrefix, downloader); - } -}; - -// spine-webgl/src/Vector3.ts -var Vector3 = class { - x = 0; - y = 0; - z = 0; - constructor(x = 0, y = 0, z = 0) { - this.x = x; - this.y = y; - this.z = z; - } - setFrom(v) { - this.x = v.x; - this.y = v.y; - this.z = v.z; - return this; - } - set(x, y, z) { - this.x = x; - this.y = y; - this.z = z; - return this; - } - add(v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - return this; - } - sub(v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - return this; - } - scale(s) { - this.x *= s; - this.y *= s; - this.z *= s; - return this; - } - normalize() { - let len = this.length(); - if (len == 0) - return this; - len = 1 / len; - this.x *= len; - this.y *= len; - this.z *= len; - return this; - } - cross(v) { - return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); - } - multiply(matrix) { - let l_mat = matrix.values; - return this.set( - this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03], - this.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13], - this.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23] - ); - } - project(matrix) { - let l_mat = matrix.values; - let l_w = 1 / (this.x * l_mat[M30] + this.y * l_mat[M31] + this.z * l_mat[M32] + l_mat[M33]); - return this.set( - (this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03]) * l_w, - (this.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13]) * l_w, - (this.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23]) * l_w - ); - } - dot(v) { - return this.x * v.x + this.y * v.y + this.z * v.z; - } - length() { - return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); - } - distance(v) { - let a = v.x - this.x; - let b = v.y - this.y; - let c = v.z - this.z; - return Math.sqrt(a * a + b * b + c * c); - } -}; - -// spine-webgl/src/Matrix4.ts -var M00 = 0; -var M01 = 4; -var M02 = 8; -var M03 = 12; -var M10 = 1; -var M11 = 5; -var M12 = 9; -var M13 = 13; -var M20 = 2; -var M21 = 6; -var M22 = 10; -var M23 = 14; -var M30 = 3; -var M31 = 7; -var M32 = 11; -var M33 = 15; -var _Matrix4 = class { - temp = new Float32Array(16); - values = new Float32Array(16); - constructor() { - let v = this.values; - v[M00] = 1; - v[M11] = 1; - v[M22] = 1; - v[M33] = 1; - } - set(values) { - this.values.set(values); - return this; - } - transpose() { - let t = this.temp; - let v = this.values; - t[M00] = v[M00]; - t[M01] = v[M10]; - t[M02] = v[M20]; - t[M03] = v[M30]; - t[M10] = v[M01]; - t[M11] = v[M11]; - t[M12] = v[M21]; - t[M13] = v[M31]; - t[M20] = v[M02]; - t[M21] = v[M12]; - t[M22] = v[M22]; - t[M23] = v[M32]; - t[M30] = v[M03]; - t[M31] = v[M13]; - t[M32] = v[M23]; - t[M33] = v[M33]; - return this.set(t); - } - identity() { - let v = this.values; - v[M00] = 1; - v[M01] = 0; - v[M02] = 0; - v[M03] = 0; - v[M10] = 0; - v[M11] = 1; - v[M12] = 0; - v[M13] = 0; - v[M20] = 0; - v[M21] = 0; - v[M22] = 1; - v[M23] = 0; - v[M30] = 0; - v[M31] = 0; - v[M32] = 0; - v[M33] = 1; - return this; - } - invert() { - let v = this.values; - let t = this.temp; - let l_det = v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03] + v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03] - v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13] - v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13] + v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23] + v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23] - v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33] - v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33]; - if (l_det == 0) - throw new Error("non-invertible matrix"); - let inv_det = 1 / l_det; - t[M00] = v[M12] * v[M23] * v[M31] - v[M13] * v[M22] * v[M31] + v[M13] * v[M21] * v[M32] - v[M11] * v[M23] * v[M32] - v[M12] * v[M21] * v[M33] + v[M11] * v[M22] * v[M33]; - t[M01] = v[M03] * v[M22] * v[M31] - v[M02] * v[M23] * v[M31] - v[M03] * v[M21] * v[M32] + v[M01] * v[M23] * v[M32] + v[M02] * v[M21] * v[M33] - v[M01] * v[M22] * v[M33]; - t[M02] = v[M02] * v[M13] * v[M31] - v[M03] * v[M12] * v[M31] + v[M03] * v[M11] * v[M32] - v[M01] * v[M13] * v[M32] - v[M02] * v[M11] * v[M33] + v[M01] * v[M12] * v[M33]; - t[M03] = v[M03] * v[M12] * v[M21] - v[M02] * v[M13] * v[M21] - v[M03] * v[M11] * v[M22] + v[M01] * v[M13] * v[M22] + v[M02] * v[M11] * v[M23] - v[M01] * v[M12] * v[M23]; - t[M10] = v[M13] * v[M22] * v[M30] - v[M12] * v[M23] * v[M30] - v[M13] * v[M20] * v[M32] + v[M10] * v[M23] * v[M32] + v[M12] * v[M20] * v[M33] - v[M10] * v[M22] * v[M33]; - t[M11] = v[M02] * v[M23] * v[M30] - v[M03] * v[M22] * v[M30] + v[M03] * v[M20] * v[M32] - v[M00] * v[M23] * v[M32] - v[M02] * v[M20] * v[M33] + v[M00] * v[M22] * v[M33]; - t[M12] = v[M03] * v[M12] * v[M30] - v[M02] * v[M13] * v[M30] - v[M03] * v[M10] * v[M32] + v[M00] * v[M13] * v[M32] + v[M02] * v[M10] * v[M33] - v[M00] * v[M12] * v[M33]; - t[M13] = v[M02] * v[M13] * v[M20] - v[M03] * v[M12] * v[M20] + v[M03] * v[M10] * v[M22] - v[M00] * v[M13] * v[M22] - v[M02] * v[M10] * v[M23] + v[M00] * v[M12] * v[M23]; - t[M20] = v[M11] * v[M23] * v[M30] - v[M13] * v[M21] * v[M30] + v[M13] * v[M20] * v[M31] - v[M10] * v[M23] * v[M31] - v[M11] * v[M20] * v[M33] + v[M10] * v[M21] * v[M33]; - t[M21] = v[M03] * v[M21] * v[M30] - v[M01] * v[M23] * v[M30] - v[M03] * v[M20] * v[M31] + v[M00] * v[M23] * v[M31] + v[M01] * v[M20] * v[M33] - v[M00] * v[M21] * v[M33]; - t[M22] = v[M01] * v[M13] * v[M30] - v[M03] * v[M11] * v[M30] + v[M03] * v[M10] * v[M31] - v[M00] * v[M13] * v[M31] - v[M01] * v[M10] * v[M33] + v[M00] * v[M11] * v[M33]; - t[M23] = v[M03] * v[M11] * v[M20] - v[M01] * v[M13] * v[M20] - v[M03] * v[M10] * v[M21] + v[M00] * v[M13] * v[M21] + v[M01] * v[M10] * v[M23] - v[M00] * v[M11] * v[M23]; - t[M30] = v[M12] * v[M21] * v[M30] - v[M11] * v[M22] * v[M30] - v[M12] * v[M20] * v[M31] + v[M10] * v[M22] * v[M31] + v[M11] * v[M20] * v[M32] - v[M10] * v[M21] * v[M32]; - t[M31] = v[M01] * v[M22] * v[M30] - v[M02] * v[M21] * v[M30] + v[M02] * v[M20] * v[M31] - v[M00] * v[M22] * v[M31] - v[M01] * v[M20] * v[M32] + v[M00] * v[M21] * v[M32]; - t[M32] = v[M02] * v[M11] * v[M30] - v[M01] * v[M12] * v[M30] - v[M02] * v[M10] * v[M31] + v[M00] * v[M12] * v[M31] + v[M01] * v[M10] * v[M32] - v[M00] * v[M11] * v[M32]; - t[M33] = v[M01] * v[M12] * v[M20] - v[M02] * v[M11] * v[M20] + v[M02] * v[M10] * v[M21] - v[M00] * v[M12] * v[M21] - v[M01] * v[M10] * v[M22] + v[M00] * v[M11] * v[M22]; - v[M00] = t[M00] * inv_det; - v[M01] = t[M01] * inv_det; - v[M02] = t[M02] * inv_det; - v[M03] = t[M03] * inv_det; - v[M10] = t[M10] * inv_det; - v[M11] = t[M11] * inv_det; - v[M12] = t[M12] * inv_det; - v[M13] = t[M13] * inv_det; - v[M20] = t[M20] * inv_det; - v[M21] = t[M21] * inv_det; - v[M22] = t[M22] * inv_det; - v[M23] = t[M23] * inv_det; - v[M30] = t[M30] * inv_det; - v[M31] = t[M31] * inv_det; - v[M32] = t[M32] * inv_det; - v[M33] = t[M33] * inv_det; - return this; - } - determinant() { - let v = this.values; - return v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03] + v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03] - v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13] - v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13] + v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23] + v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23] - v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33] - v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33]; - } - translate(x, y, z) { - let v = this.values; - v[M03] += x; - v[M13] += y; - v[M23] += z; - return this; - } - copy() { - return new _Matrix4().set(this.values); - } - projection(near, far, fovy, aspectRatio) { - this.identity(); - let l_fd = 1 / Math.tan(fovy * (Math.PI / 180) / 2); - let l_a1 = (far + near) / (near - far); - let l_a2 = 2 * far * near / (near - far); - let v = this.values; - v[M00] = l_fd / aspectRatio; - v[M10] = 0; - v[M20] = 0; - v[M30] = 0; - v[M01] = 0; - v[M11] = l_fd; - v[M21] = 0; - v[M31] = 0; - v[M02] = 0; - v[M12] = 0; - v[M22] = l_a1; - v[M32] = -1; - v[M03] = 0; - v[M13] = 0; - v[M23] = l_a2; - v[M33] = 0; - return this; - } - ortho2d(x, y, width, height) { - return this.ortho(x, x + width, y, y + height, 0, 1); - } - ortho(left, right, bottom, top, near, far) { - this.identity(); - let x_orth = 2 / (right - left); - let y_orth = 2 / (top - bottom); - let z_orth = -2 / (far - near); - let tx = -(right + left) / (right - left); - let ty = -(top + bottom) / (top - bottom); - let tz = -(far + near) / (far - near); - let v = this.values; - v[M00] = x_orth; - v[M10] = 0; - v[M20] = 0; - v[M30] = 0; - v[M01] = 0; - v[M11] = y_orth; - v[M21] = 0; - v[M31] = 0; - v[M02] = 0; - v[M12] = 0; - v[M22] = z_orth; - v[M32] = 0; - v[M03] = tx; - v[M13] = ty; - v[M23] = tz; - v[M33] = 1; - return this; - } - multiply(matrix) { - let t = this.temp; - let v = this.values; - let m = matrix.values; - t[M00] = v[M00] * m[M00] + v[M01] * m[M10] + v[M02] * m[M20] + v[M03] * m[M30]; - t[M01] = v[M00] * m[M01] + v[M01] * m[M11] + v[M02] * m[M21] + v[M03] * m[M31]; - t[M02] = v[M00] * m[M02] + v[M01] * m[M12] + v[M02] * m[M22] + v[M03] * m[M32]; - t[M03] = v[M00] * m[M03] + v[M01] * m[M13] + v[M02] * m[M23] + v[M03] * m[M33]; - t[M10] = v[M10] * m[M00] + v[M11] * m[M10] + v[M12] * m[M20] + v[M13] * m[M30]; - t[M11] = v[M10] * m[M01] + v[M11] * m[M11] + v[M12] * m[M21] + v[M13] * m[M31]; - t[M12] = v[M10] * m[M02] + v[M11] * m[M12] + v[M12] * m[M22] + v[M13] * m[M32]; - t[M13] = v[M10] * m[M03] + v[M11] * m[M13] + v[M12] * m[M23] + v[M13] * m[M33]; - t[M20] = v[M20] * m[M00] + v[M21] * m[M10] + v[M22] * m[M20] + v[M23] * m[M30]; - t[M21] = v[M20] * m[M01] + v[M21] * m[M11] + v[M22] * m[M21] + v[M23] * m[M31]; - t[M22] = v[M20] * m[M02] + v[M21] * m[M12] + v[M22] * m[M22] + v[M23] * m[M32]; - t[M23] = v[M20] * m[M03] + v[M21] * m[M13] + v[M22] * m[M23] + v[M23] * m[M33]; - t[M30] = v[M30] * m[M00] + v[M31] * m[M10] + v[M32] * m[M20] + v[M33] * m[M30]; - t[M31] = v[M30] * m[M01] + v[M31] * m[M11] + v[M32] * m[M21] + v[M33] * m[M31]; - t[M32] = v[M30] * m[M02] + v[M31] * m[M12] + v[M32] * m[M22] + v[M33] * m[M32]; - t[M33] = v[M30] * m[M03] + v[M31] * m[M13] + v[M32] * m[M23] + v[M33] * m[M33]; - return this.set(this.temp); - } - multiplyLeft(matrix) { - let t = this.temp; - let v = this.values; - let m = matrix.values; - t[M00] = m[M00] * v[M00] + m[M01] * v[M10] + m[M02] * v[M20] + m[M03] * v[M30]; - t[M01] = m[M00] * v[M01] + m[M01] * v[M11] + m[M02] * v[M21] + m[M03] * v[M31]; - t[M02] = m[M00] * v[M02] + m[M01] * v[M12] + m[M02] * v[M22] + m[M03] * v[M32]; - t[M03] = m[M00] * v[M03] + m[M01] * v[M13] + m[M02] * v[M23] + m[M03] * v[M33]; - t[M10] = m[M10] * v[M00] + m[M11] * v[M10] + m[M12] * v[M20] + m[M13] * v[M30]; - t[M11] = m[M10] * v[M01] + m[M11] * v[M11] + m[M12] * v[M21] + m[M13] * v[M31]; - t[M12] = m[M10] * v[M02] + m[M11] * v[M12] + m[M12] * v[M22] + m[M13] * v[M32]; - t[M13] = m[M10] * v[M03] + m[M11] * v[M13] + m[M12] * v[M23] + m[M13] * v[M33]; - t[M20] = m[M20] * v[M00] + m[M21] * v[M10] + m[M22] * v[M20] + m[M23] * v[M30]; - t[M21] = m[M20] * v[M01] + m[M21] * v[M11] + m[M22] * v[M21] + m[M23] * v[M31]; - t[M22] = m[M20] * v[M02] + m[M21] * v[M12] + m[M22] * v[M22] + m[M23] * v[M32]; - t[M23] = m[M20] * v[M03] + m[M21] * v[M13] + m[M22] * v[M23] + m[M23] * v[M33]; - t[M30] = m[M30] * v[M00] + m[M31] * v[M10] + m[M32] * v[M20] + m[M33] * v[M30]; - t[M31] = m[M30] * v[M01] + m[M31] * v[M11] + m[M32] * v[M21] + m[M33] * v[M31]; - t[M32] = m[M30] * v[M02] + m[M31] * v[M12] + m[M32] * v[M22] + m[M33] * v[M32]; - t[M33] = m[M30] * v[M03] + m[M31] * v[M13] + m[M32] * v[M23] + m[M33] * v[M33]; - return this.set(this.temp); - } - lookAt(position, direction, up) { - let xAxis = _Matrix4.xAxis, yAxis = _Matrix4.yAxis, zAxis = _Matrix4.zAxis; - zAxis.setFrom(direction).normalize(); - xAxis.setFrom(direction).normalize(); - xAxis.cross(up).normalize(); - yAxis.setFrom(xAxis).cross(zAxis).normalize(); - this.identity(); - let val = this.values; - val[M00] = xAxis.x; - val[M01] = xAxis.y; - val[M02] = xAxis.z; - val[M10] = yAxis.x; - val[M11] = yAxis.y; - val[M12] = yAxis.z; - val[M20] = -zAxis.x; - val[M21] = -zAxis.y; - val[M22] = -zAxis.z; - _Matrix4.tmpMatrix.identity(); - _Matrix4.tmpMatrix.values[M03] = -position.x; - _Matrix4.tmpMatrix.values[M13] = -position.y; - _Matrix4.tmpMatrix.values[M23] = -position.z; - this.multiply(_Matrix4.tmpMatrix); - return this; - } -}; -var Matrix42 = _Matrix4; -__publicField(Matrix42, "xAxis", new Vector3()); -__publicField(Matrix42, "yAxis", new Vector3()); -__publicField(Matrix42, "zAxis", new Vector3()); -__publicField(Matrix42, "tmpMatrix", new _Matrix4()); - -// spine-webgl/src/Camera.ts -var OrthoCamera = class { - position = new Vector3(0, 0, 0); - direction = new Vector3(0, 0, -1); - up = new Vector3(0, 1, 0); - near = 0; - far = 100; - zoom = 1; - viewportWidth = 0; - viewportHeight = 0; - projectionView = new Matrix42(); - inverseProjectionView = new Matrix42(); - projection = new Matrix42(); - view = new Matrix42(); - constructor(viewportWidth, viewportHeight) { - this.viewportWidth = viewportWidth; - this.viewportHeight = viewportHeight; - this.update(); - } - update() { - let projection = this.projection; - let view = this.view; - let projectionView = this.projectionView; - let inverseProjectionView = this.inverseProjectionView; - let zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; - projection.ortho( - zoom * (-viewportWidth / 2), - zoom * (viewportWidth / 2), - zoom * (-viewportHeight / 2), - zoom * (viewportHeight / 2), - this.near, - this.far - ); - view.lookAt(this.position, this.direction, this.up); - projectionView.set(projection.values); - projectionView.multiply(view); - inverseProjectionView.set(projectionView.values).invert(); - } - screenToWorld(screenCoords, screenWidth, screenHeight) { - let x = screenCoords.x, y = screenHeight - screenCoords.y - 1; - screenCoords.x = 2 * x / screenWidth - 1; - screenCoords.y = 2 * y / screenHeight - 1; - screenCoords.z = 2 * screenCoords.z - 1; - screenCoords.project(this.inverseProjectionView); - return screenCoords; - } - worldToScreen(worldCoords, screenWidth, screenHeight) { - worldCoords.project(this.projectionView); - worldCoords.x = screenWidth * (worldCoords.x + 1) / 2; - worldCoords.y = screenHeight * (worldCoords.y + 1) / 2; - worldCoords.z = (worldCoords.z + 1) / 2; - return worldCoords; - } - setViewport(viewportWidth, viewportHeight) { - this.viewportWidth = viewportWidth; - this.viewportHeight = viewportHeight; - } -}; - -// spine-webgl/src/Input.ts -var Input = class { - element; - mouseX = 0; - mouseY = 0; - buttonDown = false; - touch0 = null; - touch1 = null; - initialPinchDistance = 0; - listeners = new Array(); - eventListeners = []; - constructor(element) { - this.element = element; - this.setupCallbacks(element); - } - setupCallbacks(element) { - let mouseDown = (ev) => { - if (ev instanceof MouseEvent) { - let rect = element.getBoundingClientRect(); - this.mouseX = ev.clientX - rect.left; - ; - this.mouseY = ev.clientY - rect.top; - this.buttonDown = true; - this.listeners.map((listener) => { - if (listener.down) - listener.down(this.mouseX, this.mouseY); - }); - document.addEventListener("mousemove", mouseMove); - document.addEventListener("mouseup", mouseUp); - } - }; - let mouseMove = (ev) => { - if (ev instanceof MouseEvent) { - let rect = element.getBoundingClientRect(); - this.mouseX = ev.clientX - rect.left; - ; - this.mouseY = ev.clientY - rect.top; - this.listeners.map((listener) => { - if (this.buttonDown) { - if (listener.dragged) - listener.dragged(this.mouseX, this.mouseY); - } else { - if (listener.moved) - listener.moved(this.mouseX, this.mouseY); - } - }); - } - }; - let mouseUp = (ev) => { - if (ev instanceof MouseEvent) { - let rect = element.getBoundingClientRect(); - this.mouseX = ev.clientX - rect.left; - ; - this.mouseY = ev.clientY - rect.top; - this.buttonDown = false; - this.listeners.map((listener) => { - if (listener.up) - listener.up(this.mouseX, this.mouseY); - }); - document.removeEventListener("mousemove", mouseMove); - document.removeEventListener("mouseup", mouseUp); - } - }; - let mouseWheel = (e) => { - e.preventDefault(); - let deltaY = e.deltaY; - if (e.deltaMode == WheelEvent.DOM_DELTA_LINE) - deltaY *= 8; - if (e.deltaMode == WheelEvent.DOM_DELTA_PAGE) - deltaY *= 24; - this.listeners.map((listener) => { - if (listener.wheel) - listener.wheel(e.deltaY); - }); - }; - element.addEventListener("mousedown", mouseDown, true); - element.addEventListener("mousemove", mouseMove, true); - element.addEventListener("mouseup", mouseUp, true); - element.addEventListener("wheel", mouseWheel, true); - element.addEventListener("touchstart", (ev) => { - if (!this.touch0 || !this.touch1) { - var touches = ev.changedTouches; - let nativeTouch = touches.item(0); - if (!nativeTouch) - return; - let rect = element.getBoundingClientRect(); - let x = nativeTouch.clientX - rect.left; - let y = nativeTouch.clientY - rect.top; - let touch = new Touch(nativeTouch.identifier, x, y); - this.mouseX = x; - this.mouseY = y; - this.buttonDown = true; - if (!this.touch0) { - this.touch0 = touch; - this.listeners.map((listener) => { - if (listener.down) - listener.down(touch.x, touch.y); - }); - } else if (!this.touch1) { - this.touch1 = touch; - let dx = this.touch1.x - this.touch0.x; - let dy = this.touch1.x - this.touch0.x; - this.initialPinchDistance = Math.sqrt(dx * dx + dy * dy); - this.listeners.map((listener) => { - if (listener.zoom) - listener.zoom(this.initialPinchDistance, this.initialPinchDistance); - }); - } - } - ev.preventDefault(); - }, false); - element.addEventListener("touchmove", (ev) => { - if (this.touch0) { - var touches = ev.changedTouches; - let rect = element.getBoundingClientRect(); - for (var i = 0; i < touches.length; i++) { - var nativeTouch = touches[i]; - let x = nativeTouch.clientX - rect.left; - let y = nativeTouch.clientY - rect.top; - if (this.touch0.identifier === nativeTouch.identifier) { - this.touch0.x = this.mouseX = x; - this.touch0.y = this.mouseY = y; - this.listeners.map((listener) => { - if (listener.dragged) - listener.dragged(x, y); - }); - } - if (this.touch1 && this.touch1.identifier === nativeTouch.identifier) { - this.touch1.x = this.mouseX = x; - this.touch1.y = this.mouseY = y; - } - } - if (this.touch0 && this.touch1) { - let dx = this.touch1.x - this.touch0.x; - let dy = this.touch1.x - this.touch0.x; - let distance = Math.sqrt(dx * dx + dy * dy); - this.listeners.map((listener) => { - if (listener.zoom) - listener.zoom(this.initialPinchDistance, distance); - }); - } - } - ev.preventDefault(); - }, false); - let touchEnd = (ev) => { - if (this.touch0) { - var touches = ev.changedTouches; - let rect = element.getBoundingClientRect(); - for (var i = 0; i < touches.length; i++) { - var nativeTouch = touches[i]; - let x = nativeTouch.clientX - rect.left; - let y = nativeTouch.clientY - rect.top; - if (this.touch0.identifier === nativeTouch.identifier) { - this.touch0 = null; - this.mouseX = x; - this.mouseY = y; - this.listeners.map((listener) => { - if (listener.up) - listener.up(x, y); - }); - if (!this.touch1) { - this.buttonDown = false; - break; - } else { - this.touch0 = this.touch1; - this.touch1 = null; - this.mouseX = this.touch0.x; - this.mouseX = this.touch0.x; - this.buttonDown = true; - this.listeners.map((listener) => { - if (listener.down) - listener.down(this.touch0.x, this.touch0.y); - }); - } - } - if (this.touch1 && this.touch1.identifier) { - this.touch1 = null; - } - } - } - ev.preventDefault(); - }; - element.addEventListener("touchend", touchEnd, false); - element.addEventListener("touchcancel", touchEnd); - } - addListener(listener) { - this.listeners.push(listener); - } - removeListener(listener) { - let idx = this.listeners.indexOf(listener); - if (idx > -1) { - this.listeners.splice(idx, 1); - } - } -}; -var Touch = class { - constructor(identifier, x, y) { - this.identifier = identifier; - this.x = x; - this.y = y; - } -}; - -// spine-webgl/src/CameraController.ts -var CameraController = class { - constructor(canvas, camera) { - this.canvas = canvas; - this.camera = camera; - let cameraX = 0, cameraY = 0, cameraZoom = 0; - let mouseX = 0, mouseY = 0; - let lastX = 0, lastY = 0; - let initialZoom = 0; - new Input(canvas).addListener({ - down: (x, y) => { - cameraX = camera.position.x; - cameraY = camera.position.y; - mouseX = lastX = x; - mouseY = lastY = y; - initialZoom = camera.zoom; - }, - dragged: (x, y) => { - let deltaX = x - mouseX; - let deltaY = y - mouseY; - let originWorld = camera.screenToWorld(new Vector3(0, 0), canvas.clientWidth, canvas.clientHeight); - let deltaWorld = camera.screenToWorld(new Vector3(deltaX, deltaY), canvas.clientWidth, canvas.clientHeight).sub(originWorld); - camera.position.set(cameraX - deltaWorld.x, cameraY - deltaWorld.y, 0); - camera.update(); - lastX = x; - lastY = y; - }, - wheel: (delta) => { - let zoomAmount = delta / 200 * camera.zoom; - let newZoom = camera.zoom + zoomAmount; - if (newZoom > 0) { - let x = 0, y = 0; - if (delta < 0) { - x = lastX; - y = lastY; - } else { - let viewCenter = new Vector3(canvas.clientWidth / 2 + 15, canvas.clientHeight / 2); - let mouseToCenterX = lastX - viewCenter.x; - let mouseToCenterY = canvas.clientHeight - 1 - lastY - viewCenter.y; - x = viewCenter.x - mouseToCenterX; - y = canvas.clientHeight - 1 - viewCenter.y + mouseToCenterY; - } - let oldDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight); - camera.zoom = newZoom; - camera.update(); - let newDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight); - camera.position.add(oldDistance.sub(newDistance)); - camera.update(); - } - }, - zoom: (initialDistance, distance) => { - let newZoom = initialDistance / distance; - camera.zoom = initialZoom * newZoom; - }, - up: (x, y) => { - lastX = x; - lastY = y; - }, - moved: (x, y) => { - lastX = x; - lastY = y; - } - }); - } -}; - -// spine-webgl/src/Shader.ts -var _Shader = class { - constructor(context, vertexShader, fragmentShader) { - this.vertexShader = vertexShader; - this.fragmentShader = fragmentShader; - this.vsSource = vertexShader; - this.fsSource = fragmentShader; - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.context.addRestorable(this); - this.compile(); - } - context; - vs = null; - vsSource; - fs = null; - fsSource; - program = null; - tmp2x2 = new Float32Array(2 * 2); - tmp3x3 = new Float32Array(3 * 3); - tmp4x4 = new Float32Array(4 * 4); - getProgram() { - return this.program; - } - getVertexShader() { - return this.vertexShader; - } - getFragmentShader() { - return this.fragmentShader; - } - getVertexShaderSource() { - return this.vsSource; - } - getFragmentSource() { - return this.fsSource; - } - compile() { - let gl = this.context.gl; - try { - this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); - if (!this.vs) - throw new Error("Couldn't compile vertex shader."); - this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); - if (!this.fs) - throw new Error("Couldn#t compile fragment shader."); - this.program = this.compileProgram(this.vs, this.fs); - } catch (e) { - this.dispose(); - throw e; - } - } - compileShader(type, source) { - let gl = this.context.gl; - let shader = gl.createShader(type); - if (!shader) - throw new Error("Couldn't create shader."); - gl.shaderSource(shader, source); - gl.compileShader(shader); - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { - let error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); - gl.deleteShader(shader); - if (!gl.isContextLost()) - throw new Error(error); - } - return shader; - } - compileProgram(vs, fs) { - let gl = this.context.gl; - let program = gl.createProgram(); - if (!program) - throw new Error("Couldn't compile program."); - gl.attachShader(program, vs); - gl.attachShader(program, fs); - gl.linkProgram(program); - if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { - let error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); - gl.deleteProgram(program); - if (!gl.isContextLost()) - throw new Error(error); - } - return program; - } - restore() { - this.compile(); - } - bind() { - this.context.gl.useProgram(this.program); - } - unbind() { - this.context.gl.useProgram(null); - } - setUniformi(uniform, value) { - this.context.gl.uniform1i(this.getUniformLocation(uniform), value); - } - setUniformf(uniform, value) { - this.context.gl.uniform1f(this.getUniformLocation(uniform), value); - } - setUniform2f(uniform, value, value2) { - this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); - } - setUniform3f(uniform, value, value2, value3) { - this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); - } - setUniform4f(uniform, value, value2, value3, value4) { - this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); - } - setUniform2x2f(uniform, value) { - let gl = this.context.gl; - this.tmp2x2.set(value); - gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); - } - setUniform3x3f(uniform, value) { - let gl = this.context.gl; - this.tmp3x3.set(value); - gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); - } - setUniform4x4f(uniform, value) { - let gl = this.context.gl; - this.tmp4x4.set(value); - gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); - } - getUniformLocation(uniform) { - let gl = this.context.gl; - if (!this.program) - throw new Error("Shader not compiled."); - let location = gl.getUniformLocation(this.program, uniform); - if (!location && !gl.isContextLost()) - throw new Error(`Couldn't find location for uniform ${uniform}`); - return location; - } - getAttributeLocation(attribute) { - let gl = this.context.gl; - if (!this.program) - throw new Error("Shader not compiled."); - let location = gl.getAttribLocation(this.program, attribute); - if (location == -1 && !gl.isContextLost()) - throw new Error(`Couldn't find location for attribute ${attribute}`); - return location; - } - dispose() { - this.context.removeRestorable(this); - let gl = this.context.gl; - if (this.vs) { - gl.deleteShader(this.vs); - this.vs = null; - } - if (this.fs) { - gl.deleteShader(this.fs); - this.fs = null; - } - if (this.program) { - gl.deleteProgram(this.program); - this.program = null; - } - } - static newColoredTextured(context) { - let vs = ` -attribute vec4 ${_Shader.POSITION}; -attribute vec4 ${_Shader.COLOR}; -attribute vec2 ${_Shader.TEXCOORDS}; -uniform mat4 ${_Shader.MVP_MATRIX}; -varying vec4 v_color; -varying vec2 v_texCoords; - -void main () { - v_color = ${_Shader.COLOR}; - v_texCoords = ${_Shader.TEXCOORDS}; - gl_Position = ${_Shader.MVP_MATRIX} * ${_Shader.POSITION}; -} -`; - let fs = ` -#ifdef GL_ES - #define LOWP lowp - precision mediump float; -#else - #define LOWP -#endif -varying LOWP vec4 v_color; -varying vec2 v_texCoords; -uniform sampler2D u_texture; - -void main () { - gl_FragColor = v_color * texture2D(u_texture, v_texCoords); -} -`; - return new _Shader(context, vs, fs); - } - static newTwoColoredTextured(context) { - let vs = ` -attribute vec4 ${_Shader.POSITION}; -attribute vec4 ${_Shader.COLOR}; -attribute vec4 ${_Shader.COLOR2}; -attribute vec2 ${_Shader.TEXCOORDS}; -uniform mat4 ${_Shader.MVP_MATRIX}; -varying vec4 v_light; -varying vec4 v_dark; -varying vec2 v_texCoords; - -void main () { - v_light = ${_Shader.COLOR}; - v_dark = ${_Shader.COLOR2}; - v_texCoords = ${_Shader.TEXCOORDS}; - gl_Position = ${_Shader.MVP_MATRIX} * ${_Shader.POSITION}; -} -`; - let fs = ` -#ifdef GL_ES - #define LOWP lowp - precision mediump float; -#else - #define LOWP -#endif -varying LOWP vec4 v_light; -varying LOWP vec4 v_dark; -varying vec2 v_texCoords; -uniform sampler2D u_texture; - -void main () { - vec4 texColor = texture2D(u_texture, v_texCoords); - gl_FragColor.a = texColor.a * v_light.a; - gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb; -} -`; - return new _Shader(context, vs, fs); - } - static newColored(context) { - let vs = ` -attribute vec4 ${_Shader.POSITION}; -attribute vec4 ${_Shader.COLOR}; -uniform mat4 ${_Shader.MVP_MATRIX}; -varying vec4 v_color; - -void main () { - v_color = ${_Shader.COLOR}; - gl_Position = ${_Shader.MVP_MATRIX} * ${_Shader.POSITION}; -} -`; - let fs = ` -#ifdef GL_ES - #define LOWP lowp - precision mediump float; -#else - #define LOWP -#endif -varying LOWP vec4 v_color; - -void main () { - gl_FragColor = v_color; -} -`; - return new _Shader(context, vs, fs); - } -}; -var Shader = _Shader; -__publicField(Shader, "MVP_MATRIX", "u_projTrans"); -__publicField(Shader, "POSITION", "a_position"); -__publicField(Shader, "COLOR", "a_color"); -__publicField(Shader, "COLOR2", "a_color2"); -__publicField(Shader, "TEXCOORDS", "a_texCoords"); -__publicField(Shader, "SAMPLER", "u_texture"); - -// spine-webgl/src/Mesh.ts -var Mesh = class { - constructor(context, attributes, maxVertices, maxIndices) { - this.attributes = attributes; - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.elementsPerVertex = 0; - for (let i = 0; i < attributes.length; i++) { - this.elementsPerVertex += attributes[i].numElements; - } - this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); - this.indices = new Uint16Array(maxIndices); - this.context.addRestorable(this); - } - context; - vertices; - verticesBuffer = null; - verticesLength = 0; - dirtyVertices = false; - indices; - indicesBuffer = null; - indicesLength = 0; - dirtyIndices = false; - elementsPerVertex = 0; - getAttributes() { - return this.attributes; - } - maxVertices() { - return this.vertices.length / this.elementsPerVertex; - } - numVertices() { - return this.verticesLength / this.elementsPerVertex; - } - setVerticesLength(length) { - this.dirtyVertices = true; - this.verticesLength = length; - } - getVertices() { - return this.vertices; - } - maxIndices() { - return this.indices.length; - } - numIndices() { - return this.indicesLength; - } - setIndicesLength(length) { - this.dirtyIndices = true; - this.indicesLength = length; - } - getIndices() { - return this.indices; - } - getVertexSizeInFloats() { - let size = 0; - for (var i = 0; i < this.attributes.length; i++) { - let attribute = this.attributes[i]; - size += attribute.numElements; - } - return size; - } - setVertices(vertices) { - this.dirtyVertices = true; - if (vertices.length > this.vertices.length) - throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); - this.vertices.set(vertices, 0); - this.verticesLength = vertices.length; - } - setIndices(indices) { - this.dirtyIndices = true; - if (indices.length > this.indices.length) - throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); - this.indices.set(indices, 0); - this.indicesLength = indices.length; - } - draw(shader, primitiveType) { - this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); - } - drawWithOffset(shader, primitiveType, offset, count) { - let gl = this.context.gl; - if (this.dirtyVertices || this.dirtyIndices) - this.update(); - this.bind(shader); - if (this.indicesLength > 0) { - gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); - } else { - gl.drawArrays(primitiveType, offset, count); - } - this.unbind(shader); - } - bind(shader) { - let gl = this.context.gl; - gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); - let offset = 0; - for (let i = 0; i < this.attributes.length; i++) { - let attrib = this.attributes[i]; - let location = shader.getAttributeLocation(attrib.name); - gl.enableVertexAttribArray(location); - gl.vertexAttribPointer(location, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); - offset += attrib.numElements; - } - if (this.indicesLength > 0) - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); - } - unbind(shader) { - let gl = this.context.gl; - for (let i = 0; i < this.attributes.length; i++) { - let attrib = this.attributes[i]; - let location = shader.getAttributeLocation(attrib.name); - gl.disableVertexAttribArray(location); - } - gl.bindBuffer(gl.ARRAY_BUFFER, null); - if (this.indicesLength > 0) - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); - } - update() { - let gl = this.context.gl; - if (this.dirtyVertices) { - if (!this.verticesBuffer) { - this.verticesBuffer = gl.createBuffer(); - } - gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); - this.dirtyVertices = false; - } - if (this.dirtyIndices) { - if (!this.indicesBuffer) { - this.indicesBuffer = gl.createBuffer(); - } - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); - this.dirtyIndices = false; - } - } - restore() { - this.verticesBuffer = null; - this.indicesBuffer = null; - this.update(); - } - dispose() { - this.context.removeRestorable(this); - let gl = this.context.gl; - gl.deleteBuffer(this.verticesBuffer); - gl.deleteBuffer(this.indicesBuffer); - } -}; -var VertexAttribute = class { - constructor(name, type, numElements) { - this.name = name; - this.type = type; - this.numElements = numElements; - } -}; -var Position2Attribute = class extends VertexAttribute { - constructor() { - super(Shader.POSITION, VertexAttributeType.Float, 2); - } -}; -var Position3Attribute = class extends VertexAttribute { - constructor() { - super(Shader.POSITION, VertexAttributeType.Float, 3); - } -}; -var TexCoordAttribute = class extends VertexAttribute { - constructor(unit = 0) { - super(Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2); - } -}; -var ColorAttribute = class extends VertexAttribute { - constructor() { - super(Shader.COLOR, VertexAttributeType.Float, 4); - } -}; -var Color2Attribute = class extends VertexAttribute { - constructor() { - super(Shader.COLOR2, VertexAttributeType.Float, 4); - } -}; -var VertexAttributeType = /* @__PURE__ */ ((VertexAttributeType2) => { - VertexAttributeType2[VertexAttributeType2["Float"] = 0] = "Float"; - return VertexAttributeType2; -})(VertexAttributeType || {}); - -// spine-webgl/src/PolygonBatcher.ts -var GL_ONE = 1; -var GL_ONE_MINUS_SRC_COLOR = 769; -var GL_SRC_ALPHA = 770; -var GL_ONE_MINUS_SRC_ALPHA = 771; -var GL_DST_COLOR = 774; -var _PolygonBatcher = class { - context; - drawCalls = 0; - isDrawing = false; - mesh; - shader = null; - lastTexture = null; - verticesLength = 0; - indicesLength = 0; - srcColorBlend; - srcAlphaBlend; - dstBlend; - cullWasEnabled = false; - constructor(context, twoColorTint = true, maxVertices = 10920) { - if (maxVertices > 10920) - throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - let attributes = twoColorTint ? [new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute(), new Color2Attribute()] : [new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute()]; - this.mesh = new Mesh(context, attributes, maxVertices, maxVertices * 3); - let gl = this.context.gl; - this.srcColorBlend = gl.SRC_ALPHA; - this.srcAlphaBlend = gl.ONE; - this.dstBlend = gl.ONE_MINUS_SRC_ALPHA; - } - begin(shader) { - if (this.isDrawing) - throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()"); - this.drawCalls = 0; - this.shader = shader; - this.lastTexture = null; - this.isDrawing = true; - let gl = this.context.gl; - gl.enable(gl.BLEND); - gl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend); - if (_PolygonBatcher.disableCulling) { - this.cullWasEnabled = gl.isEnabled(gl.CULL_FACE); - if (this.cullWasEnabled) - gl.disable(gl.CULL_FACE); - } - } - setBlendMode(blendMode, premultipliedAlpha) { - const blendModeGL = _PolygonBatcher.blendModesGL[blendMode]; - const srcColorBlend = premultipliedAlpha ? blendModeGL.srcRgbPma : blendModeGL.srcRgb; - const srcAlphaBlend = blendModeGL.srcAlpha; - const dstBlend = blendModeGL.dstRgb; - if (this.srcColorBlend == srcColorBlend && this.srcAlphaBlend == srcAlphaBlend && this.dstBlend == dstBlend) - return; - this.srcColorBlend = srcColorBlend; - this.srcAlphaBlend = srcAlphaBlend; - this.dstBlend = dstBlend; - if (this.isDrawing) { - this.flush(); - } - let gl = this.context.gl; - gl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend); - } - draw(texture, vertices, indices) { - if (texture != this.lastTexture) { - this.flush(); - this.lastTexture = texture; - } else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || this.indicesLength + indices.length > this.mesh.getIndices().length) { - this.flush(); - } - let indexStart = this.mesh.numVertices(); - this.mesh.getVertices().set(vertices, this.verticesLength); - this.verticesLength += vertices.length; - this.mesh.setVerticesLength(this.verticesLength); - let indicesArray = this.mesh.getIndices(); - for (let i = this.indicesLength, j = 0; j < indices.length; i++, j++) - indicesArray[i] = indices[j] + indexStart; - this.indicesLength += indices.length; - this.mesh.setIndicesLength(this.indicesLength); - } - flush() { - if (this.verticesLength == 0) - return; - if (!this.lastTexture) - throw new Error("No texture set."); - if (!this.shader) - throw new Error("No shader set."); - this.lastTexture.bind(); - this.mesh.draw(this.shader, this.context.gl.TRIANGLES); - this.verticesLength = 0; - this.indicesLength = 0; - this.mesh.setVerticesLength(0); - this.mesh.setIndicesLength(0); - this.drawCalls++; - _PolygonBatcher.globalDrawCalls++; - } - end() { - if (!this.isDrawing) - throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); - if (this.verticesLength > 0 || this.indicesLength > 0) - this.flush(); - this.shader = null; - this.lastTexture = null; - this.isDrawing = false; - let gl = this.context.gl; - gl.disable(gl.BLEND); - if (_PolygonBatcher.disableCulling) { - if (this.cullWasEnabled) - gl.enable(gl.CULL_FACE); - } - } - getDrawCalls() { - return this.drawCalls; - } - static getAndResetGlobalDrawCalls() { - let result = _PolygonBatcher.globalDrawCalls; - _PolygonBatcher.globalDrawCalls = 0; - return result; - } - dispose() { - this.mesh.dispose(); - } -}; -var PolygonBatcher = _PolygonBatcher; -__publicField(PolygonBatcher, "disableCulling", false); -__publicField(PolygonBatcher, "globalDrawCalls", 0); -__publicField(PolygonBatcher, "blendModesGL", [ - { srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE }, - { srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE, srcAlpha: GL_ONE }, - { srcRgb: GL_DST_COLOR, srcRgbPma: GL_DST_COLOR, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE }, - { srcRgb: GL_ONE, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_COLOR, srcAlpha: GL_ONE } -]); - -// spine-webgl/src/ShapeRenderer.ts -var ShapeRenderer = class { - context; - isDrawing = false; - mesh; - shapeType = ShapeType.Filled; - color = new Color(1, 1, 1, 1); - shader = null; - vertexIndex = 0; - tmp = new Vector2(); - srcColorBlend; - srcAlphaBlend; - dstBlend; - constructor(context, maxVertices = 10920) { - if (maxVertices > 10920) - throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.mesh = new Mesh(context, [new Position2Attribute(), new ColorAttribute()], maxVertices, 0); - let gl = this.context.gl; - this.srcColorBlend = gl.SRC_ALPHA; - this.srcAlphaBlend = gl.ONE; - this.dstBlend = gl.ONE_MINUS_SRC_ALPHA; - } - begin(shader) { - if (this.isDrawing) - throw new Error("ShapeRenderer.begin() has already been called"); - this.shader = shader; - this.vertexIndex = 0; - this.isDrawing = true; - let gl = this.context.gl; - gl.enable(gl.BLEND); - gl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend); - } - setBlendMode(srcColorBlend, srcAlphaBlend, dstBlend) { - this.srcColorBlend = srcColorBlend; - this.srcAlphaBlend = srcAlphaBlend; - this.dstBlend = dstBlend; - if (this.isDrawing) { - this.flush(); - let gl = this.context.gl; - gl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend); - } - } - setColor(color) { - this.color.setFromColor(color); - } - setColorWith(r, g, b, a) { - this.color.set(r, g, b, a); - } - point(x, y, color) { - this.check(ShapeType.Point, 1); - if (!color) - color = this.color; - this.vertex(x, y, color); - } - line(x, y, x2, y2, color) { - this.check(ShapeType.Line, 2); - let vertices = this.mesh.getVertices(); - let idx = this.vertexIndex; - if (!color) - color = this.color; - this.vertex(x, y, color); - this.vertex(x2, y2, color); - } - triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3) { - this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); - let vertices = this.mesh.getVertices(); - let idx = this.vertexIndex; - if (!color) - color = this.color; - if (!color2) - color2 = this.color; - if (!color3) - color3 = this.color; - if (filled) { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - } else { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x2, y2, color); - this.vertex(x3, y3, color2); - this.vertex(x3, y3, color); - this.vertex(x, y, color2); - } - } - quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { - this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); - let vertices = this.mesh.getVertices(); - let idx = this.vertexIndex; - if (!color) - color = this.color; - if (!color2) - color2 = this.color; - if (!color3) - color3 = this.color; - if (!color4) - color4 = this.color; - if (filled) { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - this.vertex(x3, y3, color3); - this.vertex(x4, y4, color4); - this.vertex(x, y, color); - } else { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - this.vertex(x3, y3, color3); - this.vertex(x4, y4, color4); - this.vertex(x4, y4, color4); - this.vertex(x, y, color); - } - } - rect(filled, x, y, width, height, color) { - this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); - } - rectLine(filled, x1, y1, x2, y2, width, color) { - this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); - if (!color) - color = this.color; - let t = this.tmp.set(y2 - y1, x1 - x2); - t.normalize(); - width *= 0.5; - let tx = t.x * width; - let ty = t.y * width; - if (!filled) { - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x1 - tx, y1 - ty, color); - } else { - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - } - } - x(x, y, size) { - this.line(x - size, y - size, x + size, y + size); - this.line(x - size, y + size, x + size, y - size); - } - polygon(polygonVertices, offset, count, color) { - if (count < 3) - throw new Error("Polygon must contain at least 3 vertices"); - this.check(ShapeType.Line, count * 2); - if (!color) - color = this.color; - let vertices = this.mesh.getVertices(); - let idx = this.vertexIndex; - offset <<= 1; - count <<= 1; - let firstX = polygonVertices[offset]; - let firstY = polygonVertices[offset + 1]; - let last = offset + count; - for (let i = offset, n = offset + count - 2; i < n; i += 2) { - let x1 = polygonVertices[i]; - let y1 = polygonVertices[i + 1]; - let x2 = 0; - let y2 = 0; - if (i + 2 >= last) { - x2 = firstX; - y2 = firstY; - } else { - x2 = polygonVertices[i + 2]; - y2 = polygonVertices[i + 3]; - } - this.vertex(x1, y1, color); - this.vertex(x2, y2, color); - } - } - circle(filled, x, y, radius, color, segments = 0) { - if (segments == 0) - segments = Math.max(1, 6 * MathUtils.cbrt(radius) | 0); - if (segments <= 0) - throw new Error("segments must be > 0."); - if (!color) - color = this.color; - let angle = 2 * MathUtils.PI / segments; - let cos = Math.cos(angle); - let sin = Math.sin(angle); - let cx = radius, cy = 0; - if (!filled) { - this.check(ShapeType.Line, segments * 2 + 2); - for (let i = 0; i < segments; i++) { - this.vertex(x + cx, y + cy, color); - let temp2 = cx; - cx = cos * cx - sin * cy; - cy = sin * temp2 + cos * cy; - this.vertex(x + cx, y + cy, color); - } - this.vertex(x + cx, y + cy, color); - } else { - this.check(ShapeType.Filled, segments * 3 + 3); - segments--; - for (let i = 0; i < segments; i++) { - this.vertex(x, y, color); - this.vertex(x + cx, y + cy, color); - let temp2 = cx; - cx = cos * cx - sin * cy; - cy = sin * temp2 + cos * cy; - this.vertex(x + cx, y + cy, color); - } - this.vertex(x, y, color); - this.vertex(x + cx, y + cy, color); - } - let temp = cx; - cx = radius; - cy = 0; - this.vertex(x + cx, y + cy, color); - } - curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { - this.check(ShapeType.Line, segments * 2 + 2); - if (!color) - color = this.color; - let subdiv_step = 1 / segments; - let subdiv_step2 = subdiv_step * subdiv_step; - let subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; - let pre1 = 3 * subdiv_step; - let pre2 = 3 * subdiv_step2; - let pre4 = 6 * subdiv_step2; - let pre5 = 6 * subdiv_step3; - let tmp1x = x1 - cx1 * 2 + cx2; - let tmp1y = y1 - cy1 * 2 + cy2; - let tmp2x = (cx1 - cx2) * 3 - x1 + x2; - let tmp2y = (cy1 - cy2) * 3 - y1 + y2; - let fx = x1; - let fy = y1; - let dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; - let dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; - let ddfx = tmp1x * pre4 + tmp2x * pre5; - let ddfy = tmp1y * pre4 + tmp2y * pre5; - let dddfx = tmp2x * pre5; - let dddfy = tmp2y * pre5; - while (segments-- > 0) { - this.vertex(fx, fy, color); - fx += dfx; - fy += dfy; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - this.vertex(fx, fy, color); - } - this.vertex(fx, fy, color); - this.vertex(x2, y2, color); - } - vertex(x, y, color) { - let idx = this.vertexIndex; - let vertices = this.mesh.getVertices(); - vertices[idx++] = x; - vertices[idx++] = y; - vertices[idx++] = color.r; - vertices[idx++] = color.g; - vertices[idx++] = color.b; - vertices[idx++] = color.a; - this.vertexIndex = idx; - } - end() { - if (!this.isDrawing) - throw new Error("ShapeRenderer.begin() has not been called"); - this.flush(); - let gl = this.context.gl; - gl.disable(gl.BLEND); - this.isDrawing = false; - } - flush() { - if (this.vertexIndex == 0) - return; - if (!this.shader) - throw new Error("No shader set."); - this.mesh.setVerticesLength(this.vertexIndex); - this.mesh.draw(this.shader, this.shapeType); - this.vertexIndex = 0; - } - check(shapeType, numVertices) { - if (!this.isDrawing) - throw new Error("ShapeRenderer.begin() has not been called"); - if (this.shapeType == shapeType) { - if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) - this.flush(); - else - return; - } else { - this.flush(); - this.shapeType = shapeType; - } - } - dispose() { - this.mesh.dispose(); - } -}; -var ShapeType = /* @__PURE__ */ ((ShapeType2) => { - ShapeType2[ShapeType2["Point"] = 0] = "Point"; - ShapeType2[ShapeType2["Line"] = 1] = "Line"; - ShapeType2[ShapeType2["Filled"] = 4] = "Filled"; - return ShapeType2; -})(ShapeType || {}); - -// spine-webgl/src/SkeletonDebugRenderer.ts -var _SkeletonDebugRenderer = class { - boneLineColor = new Color(1, 0, 0, 1); - boneOriginColor = new Color(0, 1, 0, 1); - attachmentLineColor = new Color(0, 0, 1, 0.5); - triangleLineColor = new Color(1, 0.64, 0, 0.5); - pathColor = new Color().setFromString("FF7F00"); - clipColor = new Color(0.8, 0, 0, 2); - aabbColor = new Color(0, 1, 0, 0.5); - drawBones = true; - drawRegionAttachments = true; - drawBoundingBoxes = true; - drawMeshHull = true; - drawMeshTriangles = true; - drawPaths = true; - drawSkeletonXY = false; - drawClipping = true; - premultipliedAlpha = false; - scale = 1; - boneWidth = 2; - context; - bounds = new SkeletonBounds(); - temp = new Array(); - vertices = Utils.newFloatArray(2 * 1024); - constructor(context) { - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - } - draw(shapes, skeleton, ignoredBones) { - let skeletonX = skeleton.x; - let skeletonY = skeleton.y; - let gl = this.context.gl; - let srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; - shapes.setBlendMode(srcFunc, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - let bones = skeleton.bones; - if (this.drawBones) { - shapes.setColor(this.boneLineColor); - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) - continue; - if (!bone.parent) - continue; - let x = bone.data.length * bone.a + bone.worldX; - let y = bone.data.length * bone.c + bone.worldY; - shapes.rectLine(true, bone.worldX, bone.worldY, x, y, this.boneWidth * this.scale); - } - if (this.drawSkeletonXY) - shapes.x(skeletonX, skeletonY, 4 * this.scale); - } - if (this.drawRegionAttachments) { - shapes.setColor(this.attachmentLineColor); - let slots = skeleton.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - let attachment = slot.getAttachment(); - if (attachment instanceof RegionAttachment) { - let regionAttachment = attachment; - let vertices = this.vertices; - regionAttachment.computeWorldVertices(slot, vertices, 0, 2); - shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); - shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); - shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); - shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); - } - } - } - if (this.drawMeshHull || this.drawMeshTriangles) { - let slots = skeleton.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (!slot.bone.active) - continue; - let attachment = slot.getAttachment(); - if (!(attachment instanceof MeshAttachment)) - continue; - let mesh = attachment; - let vertices = this.vertices; - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); - let triangles = mesh.triangles; - let hullLength = mesh.hullLength; - if (this.drawMeshTriangles) { - shapes.setColor(this.triangleLineColor); - for (let ii = 0, nn = triangles.length; ii < nn; ii += 3) { - let v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; - shapes.triangle( - false, - vertices[v1], - vertices[v1 + 1], - // - vertices[v2], - vertices[v2 + 1], - // - vertices[v3], - vertices[v3 + 1] - // - ); - } - } - if (this.drawMeshHull && hullLength > 0) { - shapes.setColor(this.attachmentLineColor); - hullLength = (hullLength >> 1) * 2; - let lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; - for (let ii = 0, nn = hullLength; ii < nn; ii += 2) { - let x = vertices[ii], y = vertices[ii + 1]; - shapes.line(x, y, lastX, lastY); - lastX = x; - lastY = y; - } - } - } - } - if (this.drawBoundingBoxes) { - let bounds = this.bounds; - bounds.update(skeleton, true); - shapes.setColor(this.aabbColor); - shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); - let polygons = bounds.polygons; - let boxes = bounds.boundingBoxes; - for (let i = 0, n = polygons.length; i < n; i++) { - let polygon = polygons[i]; - shapes.setColor(boxes[i].color); - shapes.polygon(polygon, 0, polygon.length); - } - } - if (this.drawPaths) { - let slots = skeleton.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (!slot.bone.active) - continue; - let attachment = slot.getAttachment(); - if (!(attachment instanceof PathAttachment)) - continue; - let path = attachment; - let nn = path.worldVerticesLength; - let world = this.temp = Utils.setArraySize(this.temp, nn, 0); - path.computeWorldVertices(slot, 0, nn, world, 0, 2); - let color = this.pathColor; - let x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; - if (path.closed) { - shapes.setColor(color); - let cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; - x2 = world[nn - 4]; - y2 = world[nn - 3]; - shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); - shapes.setColor(_SkeletonDebugRenderer.LIGHT_GRAY); - shapes.line(x1, y1, cx1, cy1); - shapes.line(x2, y2, cx2, cy2); - } - nn -= 4; - for (let ii = 4; ii < nn; ii += 6) { - let cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; - x2 = world[ii + 4]; - y2 = world[ii + 5]; - shapes.setColor(color); - shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); - shapes.setColor(_SkeletonDebugRenderer.LIGHT_GRAY); - shapes.line(x1, y1, cx1, cy1); - shapes.line(x2, y2, cx2, cy2); - x1 = x2; - y1 = y2; - } - } - } - if (this.drawBones) { - shapes.setColor(this.boneOriginColor); - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) - continue; - shapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, this.boneOriginColor, 8); - } - } - if (this.drawClipping) { - let slots = skeleton.slots; - shapes.setColor(this.clipColor); - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (!slot.bone.active) - continue; - let attachment = slot.getAttachment(); - if (!(attachment instanceof ClippingAttachment)) - continue; - let clip = attachment; - let nn = clip.worldVerticesLength; - let world = this.temp = Utils.setArraySize(this.temp, nn, 0); - clip.computeWorldVertices(slot, 0, nn, world, 0, 2); - for (let i2 = 0, n2 = world.length; i2 < n2; i2 += 2) { - let x = world[i2]; - let y = world[i2 + 1]; - let x2 = world[(i2 + 2) % world.length]; - let y2 = world[(i2 + 3) % world.length]; - shapes.line(x, y, x2, y2); - } - } - } - } - dispose() { - } -}; -var SkeletonDebugRenderer = _SkeletonDebugRenderer; -__publicField(SkeletonDebugRenderer, "LIGHT_GRAY", new Color(192 / 255, 192 / 255, 192 / 255, 1)); -__publicField(SkeletonDebugRenderer, "GREEN", new Color(0, 1, 0, 1)); - -// spine-webgl/src/SkeletonRenderer.ts -var Renderable = class { - constructor(vertices, numVertices, numFloats) { - this.vertices = vertices; - this.numVertices = numVertices; - this.numFloats = numFloats; - } -}; -var _SkeletonRenderer = class { - premultipliedAlpha = false; - tempColor = new Color(); - tempColor2 = new Color(); - vertices; - vertexSize = 2 + 2 + 4; - twoColorTint = false; - renderable = new Renderable([], 0, 0); - clipper = new SkeletonClipping(); - temp = new Vector2(); - temp2 = new Vector2(); - temp3 = new Color(); - temp4 = new Color(); - constructor(context, twoColorTint = true) { - this.twoColorTint = twoColorTint; - if (twoColorTint) - this.vertexSize += 4; - this.vertices = Utils.newFloatArray(this.vertexSize * 1024); - } - draw(batcher, skeleton, slotRangeStart = -1, slotRangeEnd = -1, transformer = null) { - let clipper = this.clipper; - let premultipliedAlpha = this.premultipliedAlpha; - let twoColorTint = this.twoColorTint; - let blendMode = null; - let renderable = this.renderable; - let uvs; - let triangles; - let drawOrder = skeleton.drawOrder; - let attachmentColor; - let skeletonColor = skeleton.color; - let vertexSize = twoColorTint ? 12 : 8; - let inRange = false; - if (slotRangeStart == -1) - inRange = true; - for (let i = 0, n = drawOrder.length; i < n; i++) { - let clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; - let slot = drawOrder[i]; - if (!slot.bone.active) { - clipper.clipEndWithSlot(slot); - continue; - } - if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { - inRange = true; - } - if (!inRange) { - clipper.clipEndWithSlot(slot); - continue; - } - if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { - inRange = false; - } - let attachment = slot.getAttachment(); - let texture; - if (attachment instanceof RegionAttachment) { - let region = attachment; - renderable.vertices = this.vertices; - renderable.numVertices = 4; - renderable.numFloats = clippedVertexSize << 2; - region.computeWorldVertices(slot, renderable.vertices, 0, clippedVertexSize); - triangles = _SkeletonRenderer.QUAD_TRIANGLES; - uvs = region.uvs; - texture = region.region.texture; - attachmentColor = region.color; - } else if (attachment instanceof MeshAttachment) { - let mesh = attachment; - renderable.vertices = this.vertices; - renderable.numVertices = mesh.worldVerticesLength >> 1; - renderable.numFloats = renderable.numVertices * clippedVertexSize; - if (renderable.numFloats > renderable.vertices.length) { - renderable.vertices = this.vertices = Utils.newFloatArray(renderable.numFloats); - } - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); - triangles = mesh.triangles; - texture = mesh.region.texture; - uvs = mesh.uvs; - attachmentColor = mesh.color; - } else if (attachment instanceof ClippingAttachment) { - let clip = attachment; - clipper.clipStart(slot, clip); - continue; - } else { - clipper.clipEndWithSlot(slot); - continue; - } - if (texture) { - let slotColor = slot.color; - let finalColor = this.tempColor; - finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; - finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; - finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; - finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; - if (premultipliedAlpha) { - finalColor.r *= finalColor.a; - finalColor.g *= finalColor.a; - finalColor.b *= finalColor.a; - } - let darkColor = this.tempColor2; - if (!slot.darkColor) - darkColor.set(0, 0, 0, 1); - else { - if (premultipliedAlpha) { - darkColor.r = slot.darkColor.r * finalColor.a; - darkColor.g = slot.darkColor.g * finalColor.a; - darkColor.b = slot.darkColor.b * finalColor.a; - } else { - darkColor.setFromColor(slot.darkColor); - } - darkColor.a = premultipliedAlpha ? 1 : 0; - } - let slotBlendMode = slot.data.blendMode; - if (slotBlendMode != blendMode) { - blendMode = slotBlendMode; - batcher.setBlendMode(blendMode, premultipliedAlpha); - } - if (clipper.isClipping()) { - clipper.clipTriangles(renderable.vertices, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); - let clippedVertices = new Float32Array(clipper.clippedVertices); - let clippedTriangles = clipper.clippedTriangles; - if (transformer) - transformer(clippedVertices, clippedVertices.length, vertexSize); - batcher.draw(texture, clippedVertices, clippedTriangles); - } else { - let verts = renderable.vertices; - if (!twoColorTint) { - for (let v = 2, u = 0, n2 = renderable.numFloats; v < n2; v += vertexSize, u += 2) { - verts[v] = finalColor.r; - verts[v + 1] = finalColor.g; - verts[v + 2] = finalColor.b; - verts[v + 3] = finalColor.a; - verts[v + 4] = uvs[u]; - verts[v + 5] = uvs[u + 1]; - } - } else { - for (let v = 2, u = 0, n2 = renderable.numFloats; v < n2; v += vertexSize, u += 2) { - verts[v] = finalColor.r; - verts[v + 1] = finalColor.g; - verts[v + 2] = finalColor.b; - verts[v + 3] = finalColor.a; - verts[v + 4] = uvs[u]; - verts[v + 5] = uvs[u + 1]; - verts[v + 6] = darkColor.r; - verts[v + 7] = darkColor.g; - verts[v + 8] = darkColor.b; - verts[v + 9] = darkColor.a; - } - } - let view = renderable.vertices.subarray(0, renderable.numFloats); - if (transformer) - transformer(renderable.vertices, renderable.numFloats, vertexSize); - batcher.draw(texture, view, triangles); - } - } - clipper.clipEndWithSlot(slot); - } - clipper.clipEnd(); - } - /** Returns the {@link SkeletonClipping} used by this renderer for use with e.g. {@link Skeleton.getBounds} **/ - getSkeletonClipping() { - return this.clipper; - } -}; -var SkeletonRenderer = _SkeletonRenderer; -__publicField(SkeletonRenderer, "QUAD_TRIANGLES", [0, 1, 2, 2, 3, 0]); - -// spine-webgl/src/SceneRenderer.ts -var quad = [ - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0 -]; -var QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; -var WHITE = new Color(1, 1, 1, 1); -var SceneRenderer = class { - context; - canvas; - camera; - batcher; - twoColorTint = false; - batcherShader; - shapes; - shapesShader; - activeRenderer = null; - skeletonRenderer; - skeletonDebugRenderer; - constructor(canvas, context, twoColorTint = true) { - this.canvas = canvas; - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.twoColorTint = twoColorTint; - this.camera = new OrthoCamera(canvas.width, canvas.height); - this.batcherShader = twoColorTint ? Shader.newTwoColoredTextured(this.context) : Shader.newColoredTextured(this.context); - this.batcher = new PolygonBatcher(this.context, twoColorTint); - this.shapesShader = Shader.newColored(this.context); - this.shapes = new ShapeRenderer(this.context); - this.skeletonRenderer = new SkeletonRenderer(this.context, twoColorTint); - this.skeletonDebugRenderer = new SkeletonDebugRenderer(this.context); - } - dispose() { - this.batcher.dispose(); - this.batcherShader.dispose(); - this.shapes.dispose(); - this.shapesShader.dispose(); - this.skeletonDebugRenderer.dispose(); - } - begin() { - this.camera.update(); - this.enableRenderer(this.batcher); - } - drawSkeleton(skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform = null) { - this.enableRenderer(this.batcher); - this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; - this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd, transform); - } - drawSkeletonDebug(skeleton, premultipliedAlpha = false, ignoredBones) { - this.enableRenderer(this.shapes); - this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; - this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); - } - drawTexture(texture, x, y, width, height, color) { - this.enableRenderer(this.batcher); - if (!color) - color = WHITE; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i] = 0; - } - this.batcher.draw(texture, quad, QUAD_TRIANGLES); - } - drawTextureUV(texture, x, y, width, height, u, v, u2, v2, color) { - this.enableRenderer(this.batcher); - if (!color) - color = WHITE; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u; - quad[i++] = v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u2; - quad[i++] = v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u2; - quad[i++] = v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u; - quad[i++] = v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i] = 0; - } - this.batcher.draw(texture, quad, QUAD_TRIANGLES); - } - drawTextureRotated(texture, x, y, width, height, pivotX, pivotY, angle, color) { - this.enableRenderer(this.batcher); - if (!color) - color = WHITE; - let worldOriginX = x + pivotX; - let worldOriginY = y + pivotY; - let fx = -pivotX; - let fy = -pivotY; - let fx2 = width - pivotX; - let fy2 = height - pivotY; - let p1x = fx; - let p1y = fy; - let p2x = fx; - let p2y = fy2; - let p3x = fx2; - let p3y = fy2; - let p4x = fx2; - let p4y = fy; - let x1 = 0; - let y1 = 0; - let x2 = 0; - let y2 = 0; - let x3 = 0; - let y3 = 0; - let x4 = 0; - let y4 = 0; - if (angle != 0) { - let cos = MathUtils.cosDeg(angle); - let sin = MathUtils.sinDeg(angle); - x1 = cos * p1x - sin * p1y; - y1 = sin * p1x + cos * p1y; - x4 = cos * p2x - sin * p2y; - y4 = sin * p2x + cos * p2y; - x3 = cos * p3x - sin * p3y; - y3 = sin * p3x + cos * p3y; - x2 = x3 + (x1 - x4); - y2 = y3 + (y1 - y4); - } else { - x1 = p1x; - y1 = p1y; - x4 = p2x; - y4 = p2y; - x3 = p3x; - y3 = p3y; - x2 = p4x; - y2 = p4y; - } - x1 += worldOriginX; - y1 += worldOriginY; - x2 += worldOriginX; - y2 += worldOriginY; - x3 += worldOriginX; - y3 += worldOriginY; - x4 += worldOriginX; - y4 += worldOriginY; - var i = 0; - quad[i++] = x1; - quad[i++] = y1; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x2; - quad[i++] = y2; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x3; - quad[i++] = y3; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x4; - quad[i++] = y4; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i] = 0; - } - this.batcher.draw(texture, quad, QUAD_TRIANGLES); - } - drawRegion(region, x, y, width, height, color) { - this.enableRenderer(this.batcher); - if (!color) - color = WHITE; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u; - quad[i++] = region.v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u2; - quad[i++] = region.v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u2; - quad[i++] = region.v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u; - quad[i++] = region.v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i] = 0; - } - this.batcher.draw(region.page.texture, quad, QUAD_TRIANGLES); - } - line(x, y, x2, y2, color, color2) { - this.enableRenderer(this.shapes); - this.shapes.line(x, y, x2, y2, color); - } - triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3) { - this.enableRenderer(this.shapes); - this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); - } - quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { - this.enableRenderer(this.shapes); - this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); - } - rect(filled, x, y, width, height, color) { - this.enableRenderer(this.shapes); - this.shapes.rect(filled, x, y, width, height, color); - } - rectLine(filled, x1, y1, x2, y2, width, color) { - this.enableRenderer(this.shapes); - this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); - } - polygon(polygonVertices, offset, count, color) { - this.enableRenderer(this.shapes); - this.shapes.polygon(polygonVertices, offset, count, color); - } - circle(filled, x, y, radius, color, segments = 0) { - this.enableRenderer(this.shapes); - this.shapes.circle(filled, x, y, radius, color, segments); - } - curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { - this.enableRenderer(this.shapes); - this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); - } - end() { - if (this.activeRenderer === this.batcher) - this.batcher.end(); - else if (this.activeRenderer === this.shapes) - this.shapes.end(); - this.activeRenderer = null; - } - resize(resizeMode) { - let canvas = this.canvas; - var dpr = window.devicePixelRatio || 1; - var w = Math.round(canvas.clientWidth * dpr); - var h = Math.round(canvas.clientHeight * dpr); - if (canvas.width != w || canvas.height != h) { - canvas.width = w; - canvas.height = h; - } - this.context.gl.viewport(0, 0, canvas.width, canvas.height); - if (resizeMode === ResizeMode.Expand) - this.camera.setViewport(w, h); - else if (resizeMode === ResizeMode.Fit) { - let sourceWidth = canvas.width, sourceHeight = canvas.height; - let targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; - let targetRatio = targetHeight / targetWidth; - let sourceRatio = sourceHeight / sourceWidth; - let scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; - this.camera.setViewport(sourceWidth * scale, sourceHeight * scale); - } - this.camera.update(); - } - enableRenderer(renderer) { - if (this.activeRenderer === renderer) - return; - this.end(); - if (renderer instanceof PolygonBatcher) { - this.batcherShader.bind(); - this.batcherShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values); - this.batcherShader.setUniformi("u_texture", 0); - this.batcher.begin(this.batcherShader); - this.activeRenderer = this.batcher; - } else if (renderer instanceof ShapeRenderer) { - this.shapesShader.bind(); - this.shapesShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values); - this.shapes.begin(this.shapesShader); - this.activeRenderer = this.shapes; - } else - this.activeRenderer = this.skeletonDebugRenderer; - } -}; -var ResizeMode = /* @__PURE__ */ ((ResizeMode2) => { - ResizeMode2[ResizeMode2["Stretch"] = 0] = "Stretch"; - ResizeMode2[ResizeMode2["Expand"] = 1] = "Expand"; - ResizeMode2[ResizeMode2["Fit"] = 2] = "Fit"; - return ResizeMode2; -})(ResizeMode || {}); - -// spine-webgl/src/LoadingScreen.ts -var spinnerImage; -var logoImage; -var loaded = 0; -var FADE_IN = 1; -var FADE_OUT = 1; -var logoWidth = 165; -var logoHeight = 108; -var spinnerSize = 163; -var LoadingScreen = class { - renderer; - logo = null; - spinner = null; - angle = 0; - fadeOut = 0; - fadeIn = 0; - timeKeeper = new TimeKeeper(); - backgroundColor = new Color(0.135, 0.135, 0.135, 1); - tempColor = new Color(); - constructor(renderer) { - this.renderer = renderer; - this.timeKeeper.maxDelta = 9; - if (!logoImage) { - let isSafari = navigator.userAgent.indexOf("Safari") > -1; - let onload = () => loaded++; - logoImage = new Image(); - logoImage.src = SPINE_LOGO_DATA; - if (!isSafari) - logoImage.crossOrigin = "anonymous"; - logoImage.onload = onload; - spinnerImage = new Image(); - spinnerImage.src = SPINNER_DATA; - if (!isSafari) - spinnerImage.crossOrigin = "anonymous"; - spinnerImage.onload = onload; - } - } - dispose() { - this.logo?.dispose(); - this.spinner?.dispose(); - } - draw(complete = false) { - if (loaded < 2 || complete && this.fadeOut > FADE_OUT) - return; - this.timeKeeper.update(); - let a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.25)); - this.angle -= this.timeKeeper.delta * 200 * (1 + 1.5 * Math.pow(a, 5)); - let tempColor = this.tempColor; - let renderer = this.renderer; - let canvas = renderer.canvas; - let gl = renderer.context.gl; - renderer.resize(1 /* Expand */); - renderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0); - renderer.batcher.setBlendMode(0 /* Normal */, true); - if (complete) { - this.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1); - if (this.fadeOut > FADE_OUT) - return; - tempColor.setFromColor(this.backgroundColor); - a = 1 - this.fadeOut / FADE_OUT; - a = 1 - (a - 1) * (a - 1); - tempColor.a *= a; - if (tempColor.a > 0) { - renderer.camera.zoom = 1; - renderer.begin(); - renderer.quad( - true, - 0, - 0, - canvas.width, - 0, - canvas.width, - canvas.height, - 0, - canvas.height, - tempColor, - tempColor, - tempColor, - tempColor - ); - renderer.end(); - } - } else { - this.fadeIn += this.timeKeeper.delta; - if (this.backgroundColor.a > 0) { - gl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a); - gl.clear(gl.COLOR_BUFFER_BIT); - } - a = 1; - } - a *= Math.min(this.fadeIn / FADE_IN, 1); - tempColor.set(a, a, a, a); - if (!this.logo) { - this.logo = new GLTexture(renderer.context, logoImage); - this.spinner = new GLTexture(renderer.context, spinnerImage); - } - renderer.camera.zoom = Math.max(1, spinnerSize / canvas.height); - renderer.begin(); - renderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, tempColor); - if (this.spinner) - renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerSize) / 2, (canvas.height - spinnerSize) / 2, spinnerSize, spinnerSize, spinnerSize / 2, spinnerSize / 2, this.angle, tempColor); - renderer.end(); - } -}; -var SPINNER_DATA = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiH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Z0dZlxwLpkiWDULpmy5gwqayZgZNkA7oKQQCxctByYg0XIIEQQuRitGVHblMTA2ShKGPDpC6wu+DEgJqg2rDGDBtAF4Q6RAojp1xXGmSMbImVcR+YWNY04eQCtUG1ofUJ2/uvcETIgUhhdAE5GAlkKShjwHTNmhhODKgJqQ2sC14uOgyfD0IbRF+MlQaZAiZWyn2yJsTJATqGnHQO2Jhh+xlsACFCG0QbRtdyzQFZCZSxYPpmTS7Q5cjJHYNBYIkZpu99HoUQ/o4QIYSIZUZfjJ4ZMjZI32wZBDMU5yhy8pZTULl4XYP5fagMyEVoy4oupTpGduwnkloSlKEwY+AcQU4MhRTD6ovXBRwFzwWgCSEF0QVjJUGmgEllTS5OLlCIlIN1mS9mx/cZ5eLDALpCTI2RAhkTZQqYoTgpoCPECbaBHQ2ETL3PUl98ECAXYijG0OyYAmQoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII="; - -// spine-webgl/src/SpineCanvas.ts -var SpineCanvas = class { - /** Constructs a new spine canvas, rendering to the provided HTML canvas. */ - constructor(canvas, config) { - this.config = config; - if (!config.pathPrefix) - config.pathPrefix = ""; - if (!config.app) - config.app = { - loadAssets: () => { - }, - initialize: () => { - }, - update: () => { - }, - render: () => { - }, - error: () => { - }, - dispose: () => { - } - }; - if (!config.webglConfig) - config.webglConfig = { alpha: true }; - this.htmlCanvas = canvas; - this.context = new ManagedWebGLRenderingContext(canvas, config.webglConfig); - this.renderer = new SceneRenderer(canvas, this.context); - this.gl = this.context.gl; - this.assetManager = new AssetManager(this.context, config.pathPrefix); - this.input = new Input(canvas); - if (config.app.loadAssets) - config.app.loadAssets(this); - let loop = () => { - if (this.disposed) - return; - requestAnimationFrame(loop); - this.time.update(); - if (config.app.update) - config.app.update(this, this.time.delta); - if (config.app.render) - config.app.render(this); - }; - let waitForAssets = () => { - if (this.disposed) - return; - if (this.assetManager.isLoadingComplete()) { - if (this.assetManager.hasErrors()) { - if (config.app.error) - config.app.error(this, this.assetManager.getErrors()); - } else { - if (config.app.initialize) - config.app.initialize(this); - loop(); - } - return; - } - requestAnimationFrame(waitForAssets); - }; - requestAnimationFrame(waitForAssets); - } - context; - /** Tracks the current time, delta, and other time related statistics. */ - time = new TimeKeeper(); - /** The HTML canvas to render to. */ - htmlCanvas; - /** The WebGL rendering context. */ - gl; - /** The scene renderer for easy drawing of skeletons, shapes, and images. */ - renderer; - /** The asset manager to load assets with. */ - assetManager; - /** The input processor used to listen to mouse, touch, and keyboard events. */ - input; - disposed = false; - /** Clears the canvas with the given color. The color values are given in the range [0,1]. */ - clear(r, g, b, a) { - this.gl.clearColor(r, g, b, a); - this.gl.clear(this.gl.COLOR_BUFFER_BIT); - } - /** Disposes the app, so the update() and render() functions are no longer called. Calls the dispose() callback.*/ - dispose() { - if (this.config.app.dispose) - this.config.app.dispose(this); - this.disposed = true; - } -}; - -// spine-phaser-v3/src/mixins.ts -var components = Phaser.GameObjects.Components; -var ComputedSize = components.ComputedSize; -var Depth = components.Depth; -var Flip = components.Flip; -var ScrollFactor = components.ScrollFactor; -var Transform = components.Transform; -var Visible = components.Visible; -var Origin = components.Origin; -var Alpha = components.Alpha; -function createMixin(...component) { - return (BaseGameObject) => { - Phaser.Class.mixin(BaseGameObject, component); - return BaseGameObject; - }; -} -var ComputedSizeMixin = createMixin(ComputedSize); -var DepthMixin = createMixin(Depth); -var FlipMixin = createMixin(Flip); -var ScrollFactorMixin = createMixin(ScrollFactor); -var TransformMixin = createMixin(Transform); -var VisibleMixin = createMixin(Visible); -var OriginMixin = createMixin(Origin); -var AlphaMixin = createMixin(Alpha); - -// spine-phaser-v3/src/SpineGameObject.ts -var BaseSpineGameObject = class extends Phaser.GameObjects.GameObject { - constructor(scene, type) { - super(scene, type); - } -}; -var SetupPoseBoundsProvider = class { - /** - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(clipping = false) { - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton) - return { x: 0, y: 0, width: 0, height: 0 }; - const skeleton = new Skeleton(gameObject.skeleton.data); - skeleton.setToSetupPose(); - skeleton.updateWorldTransform(2 /* update */); - const bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : void 0); - return bounds.width == Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } -}; -var SkinsAndAnimationBoundsProvider = class { - /** - * @param animation The animation to use for calculating the bounds. If null, the setup pose is used. - * @param skins The skins to use for calculating the bounds. If empty, the default skin is used. - * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation. - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(animation, skins = [], timeStep = 0.05, clipping = false) { - this.animation = animation; - this.skins = skins; - this.timeStep = timeStep; - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton || !gameObject.animationState) - return { x: 0, y: 0, width: 0, height: 0 }; - const animationState = new AnimationState(gameObject.animationState.data); - const skeleton = new Skeleton(gameObject.skeleton.data); - const clipper = this.clipping ? new SkeletonClipping() : void 0; - const data = skeleton.data; - if (this.skins.length > 0) { - let customSkin = new Skin("custom-skin"); - for (const skinName of this.skins) { - const skin = data.findSkin(skinName); - if (skin == null) - continue; - customSkin.addSkin(skin); - } - skeleton.setSkin(customSkin); - } - skeleton.setToSetupPose(); - const animation = this.animation != null ? data.findAnimation(this.animation) : null; - if (animation == null) { - skeleton.updateWorldTransform(2 /* update */); - const bounds = skeleton.getBoundsRect(clipper); - return bounds.width == Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } else { - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - animationState.clearTracks(); - animationState.setAnimationWith(0, animation, false); - const steps = Math.max(animation.duration / this.timeStep, 1); - for (let i = 0; i < steps; i++) { - const delta = i > 0 ? this.timeStep : 0; - animationState.update(delta); - animationState.apply(skeleton); - skeleton.update(delta); - skeleton.updateWorldTransform(2 /* update */); - const bounds2 = skeleton.getBoundsRect(clipper); - minX = Math.min(minX, bounds2.x); - minY = Math.min(minY, bounds2.y); - maxX = Math.max(maxX, bounds2.x + bounds2.width); - maxY = Math.max(maxY, bounds2.y + bounds2.height); - } - const bounds = { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY - }; - return bounds.width == Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } - } -}; -var SpineGameObject = class extends DepthMixin( - OriginMixin( - ComputedSizeMixin( - FlipMixin( - ScrollFactorMixin( - TransformMixin(VisibleMixin(AlphaMixin(BaseSpineGameObject))) - ) - ) - ) - ) -) { - constructor(scene, plugin, x, y, dataKey, atlasKey, boundsProvider = new SetupPoseBoundsProvider()) { - super(scene, window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE); - this.plugin = plugin; - this.boundsProvider = boundsProvider; - this.setPosition(x, y); - this.premultipliedAlpha = this.plugin.isAtlasPremultiplied(atlasKey); - this.skeleton = this.plugin.createSkeleton(dataKey, atlasKey); - this.animationStateData = new AnimationStateData(this.skeleton.data); - this.animationState = new AnimationState(this.animationStateData); - this.skeleton.updateWorldTransform(2 /* update */); - this.updateSize(); - } - blendMode = -1; - skeleton; - animationStateData; - animationState; - beforeUpdateWorldTransforms = () => { - }; - afterUpdateWorldTransforms = () => { - }; - premultipliedAlpha = false; - updateSize() { - if (!this.skeleton) - return; - let bounds = this.boundsProvider.calculateBounds(this); - let self = this; - self.width = bounds.width; - self.height = bounds.height; - this.displayOriginX = -bounds.x; - this.displayOriginY = -bounds.y; - } - /** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */ - skeletonToPhaserWorldCoordinates(point) { - let transform = this.getWorldTransformMatrix(); - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - let x = point.x; - let y = point.y; - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - } - /** Converts a point from the Phaser world coordinate system to the skeleton coordinate system. */ - phaserWorldCoordinatesToSkeleton(point) { - let transform = this.getWorldTransformMatrix(); - transform = transform.invert(); - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - let x = point.x; - let y = point.y; - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - } - /** Converts a point from the Phaser world coordinate system to the bone's local coordinate system. */ - phaserWorldCoordinatesToBone(point, bone) { - this.phaserWorldCoordinatesToSkeleton(point); - if (bone.parent) { - bone.parent.worldToLocal(point); - } else { - bone.worldToLocal(point); - } - } - /** - * Updates the {@link AnimationState}, applies it to the {@link Skeleton}, then updates the world transforms of all bones. - * @param delta The time delta in milliseconds - */ - updatePose(delta) { - this.animationState.update(delta / 1e3); - this.animationState.apply(this.skeleton); - this.beforeUpdateWorldTransforms(this); - this.skeleton.update(delta / 1e3); - this.skeleton.updateWorldTransform(2 /* update */); - this.afterUpdateWorldTransforms(this); - } - preUpdate(time, delta) { - if (!this.skeleton || !this.animationState) - return; - this.updatePose(delta); - } - preDestroy() { - } - willRender(camera) { - var GameObjectRenderMask = 15; - var result = !this.skeleton || !(GameObjectRenderMask !== this.renderFlags || this.cameraFilter !== 0 && this.cameraFilter & camera.id); - if (!this.visible) - result = false; - if (!result && this.parentContainer && this.plugin.webGLRenderer) { - var sceneRenderer = this.plugin.webGLRenderer; - if (this.plugin.gl && this.plugin.phaserRenderer instanceof Phaser.Renderer.WebGL.WebGLRenderer && sceneRenderer.batcher.isDrawing) { - sceneRenderer.end(); - this.plugin.phaserRenderer.pipelines.rebind(); - } - } - return result; - } - renderWebGL(renderer, src, camera, parentMatrix) { - if (!this.skeleton || !this.animationState || !this.plugin.webGLRenderer) - return; - let sceneRenderer = this.plugin.webGLRenderer; - if (renderer.newType) { - renderer.pipelines.clear(); - sceneRenderer.begin(); - } - camera.addToRenderList(src); - let transform = Phaser.GameObjects.GetCalcMatrix( - src, - camera, - parentMatrix - ).calc; - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - sceneRenderer.drawSkeleton( - this.skeleton, - this.premultipliedAlpha, - -1, - -1, - (vertices, numVertices, stride) => { - for (let i = 0; i < numVertices; i += stride) { - let vx = vertices[i]; - let vy = vertices[i + 1]; - vertices[i] = vx * a + vy * c + tx; - vertices[i + 1] = vx * b + vy * d + ty; - } - } - ); - if (!renderer.nextTypeMatch) { - sceneRenderer.end(); - renderer.pipelines.rebind(); - } - } - renderCanvas(renderer, src, camera, parentMatrix) { - if (!this.skeleton || !this.animationState || !this.plugin.canvasRenderer) - return; - let context = renderer.currentContext; - let skeletonRenderer = this.plugin.canvasRenderer; - skeletonRenderer.ctx = context; - camera.addToRenderList(src); - let transform = Phaser.GameObjects.GetCalcMatrix( - src, - camera, - parentMatrix - ).calc; - let skeleton = this.skeleton; - skeleton.x = transform.tx; - skeleton.y = transform.ty; - skeleton.scaleX = transform.scaleX; - skeleton.scaleY = transform.scaleY; - let root = skeleton.getRootBone(); - root.rotation = -MathUtils.radiansToDegrees * transform.rotationNormalized; - this.skeleton.updateWorldTransform(2 /* update */); - context.save(); - skeletonRenderer.draw(skeleton); - context.restore(); - } -}; - -// spine-canvas/src/CanvasTexture.ts -var CanvasTexture = class extends Texture { - constructor(image) { - super(image); - } - setFilters(minFilter, magFilter) { - } - setWraps(uWrap, vWrap) { - } - dispose() { - } -}; - -// spine-canvas/src/SkeletonRenderer.ts -var worldVertices = Utils.newFloatArray(8); -var _SkeletonRenderer2 = class { - ctx; - triangleRendering = false; - debugRendering = false; - vertices = Utils.newFloatArray(8 * 1024); - tempColor = new Color(); - constructor(context) { - this.ctx = context; - } - draw(skeleton) { - if (this.triangleRendering) - this.drawTriangles(skeleton); - else - this.drawImages(skeleton); - } - drawImages(skeleton) { - let ctx = this.ctx; - let color = this.tempColor; - let skeletonColor = skeleton.color; - let drawOrder = skeleton.drawOrder; - if (this.debugRendering) - ctx.strokeStyle = "green"; - for (let i = 0, n = drawOrder.length; i < n; i++) { - let slot = drawOrder[i]; - let bone = slot.bone; - if (!bone.active) - continue; - let attachment = slot.getAttachment(); - if (!(attachment instanceof RegionAttachment)) - continue; - attachment.computeWorldVertices(slot, worldVertices, 0, 2); - let region = attachment.region; - let image = region.texture.getImage(); - let slotColor = slot.color; - let regionColor = attachment.color; - color.set( - skeletonColor.r * slotColor.r * regionColor.r, - skeletonColor.g * slotColor.g * regionColor.g, - skeletonColor.b * slotColor.b * regionColor.b, - skeletonColor.a * slotColor.a * regionColor.a - ); - ctx.save(); - ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); - ctx.translate(attachment.offset[0], attachment.offset[1]); - ctx.rotate(attachment.rotation * Math.PI / 180); - let atlasScale = attachment.width / region.originalWidth; - ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); - let w = region.width, h = region.height; - ctx.translate(w / 2, h / 2); - if (attachment.region.degrees == 90) { - let t = w; - w = h; - h = t; - ctx.rotate(-Math.PI / 2); - } - ctx.scale(1, -1); - ctx.translate(-w / 2, -h / 2); - ctx.globalAlpha = color.a; - ctx.drawImage(image, image.width * region.u, image.height * region.v, w, h, 0, 0, w, h); - if (this.debugRendering) - ctx.strokeRect(0, 0, w, h); - ctx.restore(); - } - } - drawTriangles(skeleton) { - let ctx = this.ctx; - let color = this.tempColor; - let skeletonColor = skeleton.color; - let drawOrder = skeleton.drawOrder; - let blendMode = null; - let vertices = this.vertices; - let triangles = null; - for (let i = 0, n = drawOrder.length; i < n; i++) { - let slot = drawOrder[i]; - let attachment = slot.getAttachment(); - let texture; - let region; - if (attachment instanceof RegionAttachment) { - let regionAttachment = attachment; - vertices = this.computeRegionVertices(slot, regionAttachment, false); - triangles = _SkeletonRenderer2.QUAD_TRIANGLES; - texture = regionAttachment.region.texture.getImage(); - } else if (attachment instanceof MeshAttachment) { - let mesh = attachment; - vertices = this.computeMeshVertices(slot, mesh, false); - triangles = mesh.triangles; - texture = mesh.region.texture.getImage(); - } else - continue; - if (texture) { - if (slot.data.blendMode != blendMode) - blendMode = slot.data.blendMode; - let slotColor = slot.color; - let attachmentColor = attachment.color; - color.set( - skeletonColor.r * slotColor.r * attachmentColor.r, - skeletonColor.g * slotColor.g * attachmentColor.g, - skeletonColor.b * slotColor.b * attachmentColor.b, - skeletonColor.a * slotColor.a * attachmentColor.a - ); - ctx.globalAlpha = color.a; - for (var j = 0; j < triangles.length; j += 3) { - let t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; - let x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; - let x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; - let x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; - this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); - if (this.debugRendering) { - ctx.strokeStyle = "green"; - ctx.beginPath(); - ctx.moveTo(x0, y0); - ctx.lineTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.lineTo(x0, y0); - ctx.stroke(); - } - } - } - } - this.ctx.globalAlpha = 1; - } - // Adapted from http://extremelysatisfactorytotalitarianism.com/blog/?p=2120 - // Apache 2 licensed - drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { - let ctx = this.ctx; - const width = img.width - 1; - const height = img.height - 1; - u0 *= width; - v0 *= height; - u1 *= width; - v1 *= height; - u2 *= width; - v2 *= height; - ctx.beginPath(); - ctx.moveTo(x0, y0); - ctx.lineTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.closePath(); - x1 -= x0; - y1 -= y0; - x2 -= x0; - y2 -= y0; - u1 -= u0; - v1 -= v0; - u2 -= u0; - v2 -= v0; - let det = u1 * v2 - u2 * v1; - if (det == 0) - return; - det = 1 / det; - const a = (v2 * x1 - v1 * x2) * det; - const b = (v2 * y1 - v1 * y2) * det; - const c = (u1 * x2 - u2 * x1) * det; - const d = (u1 * y2 - u2 * y1) * det; - const e = x0 - a * u0 - c * v0; - const f = y0 - b * u0 - d * v0; - ctx.save(); - ctx.transform(a, b, c, d, e, f); - ctx.clip(); - ctx.drawImage(img, 0, 0); - ctx.restore(); - } - computeRegionVertices(slot, region, pma) { - let skeletonColor = slot.bone.skeleton.color; - let slotColor = slot.color; - let regionColor = region.color; - let alpha = skeletonColor.a * slotColor.a * regionColor.a; - let multiplier = pma ? alpha : 1; - let color = this.tempColor; - color.set( - skeletonColor.r * slotColor.r * regionColor.r * multiplier, - skeletonColor.g * slotColor.g * regionColor.g * multiplier, - skeletonColor.b * slotColor.b * regionColor.b * multiplier, - alpha - ); - region.computeWorldVertices(slot, this.vertices, 0, _SkeletonRenderer2.VERTEX_SIZE); - let vertices = this.vertices; - let uvs = region.uvs; - vertices[RegionAttachment.C1R] = color.r; - vertices[RegionAttachment.C1G] = color.g; - vertices[RegionAttachment.C1B] = color.b; - vertices[RegionAttachment.C1A] = color.a; - vertices[RegionAttachment.U1] = uvs[0]; - vertices[RegionAttachment.V1] = uvs[1]; - vertices[RegionAttachment.C2R] = color.r; - vertices[RegionAttachment.C2G] = color.g; - vertices[RegionAttachment.C2B] = color.b; - vertices[RegionAttachment.C2A] = color.a; - vertices[RegionAttachment.U2] = uvs[2]; - vertices[RegionAttachment.V2] = uvs[3]; - vertices[RegionAttachment.C3R] = color.r; - vertices[RegionAttachment.C3G] = color.g; - vertices[RegionAttachment.C3B] = color.b; - vertices[RegionAttachment.C3A] = color.a; - vertices[RegionAttachment.U3] = uvs[4]; - vertices[RegionAttachment.V3] = uvs[5]; - vertices[RegionAttachment.C4R] = color.r; - vertices[RegionAttachment.C4G] = color.g; - vertices[RegionAttachment.C4B] = color.b; - vertices[RegionAttachment.C4A] = color.a; - vertices[RegionAttachment.U4] = uvs[6]; - vertices[RegionAttachment.V4] = uvs[7]; - return vertices; - } - computeMeshVertices(slot, mesh, pma) { - let skeletonColor = slot.bone.skeleton.color; - let slotColor = slot.color; - let regionColor = mesh.color; - let alpha = skeletonColor.a * slotColor.a * regionColor.a; - let multiplier = pma ? alpha : 1; - let color = this.tempColor; - color.set( - skeletonColor.r * slotColor.r * regionColor.r * multiplier, - skeletonColor.g * slotColor.g * regionColor.g * multiplier, - skeletonColor.b * slotColor.b * regionColor.b * multiplier, - alpha - ); - let vertexCount = mesh.worldVerticesLength / 2; - let vertices = this.vertices; - if (vertices.length < mesh.worldVerticesLength) - this.vertices = vertices = Utils.newFloatArray(mesh.worldVerticesLength); - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, _SkeletonRenderer2.VERTEX_SIZE); - let uvs = mesh.uvs; - for (let i = 0, u = 0, v = 2; i < vertexCount; i++) { - vertices[v++] = color.r; - vertices[v++] = color.g; - vertices[v++] = color.b; - vertices[v++] = color.a; - vertices[v++] = uvs[u++]; - vertices[v++] = uvs[u++]; - v += 2; - } - return vertices; - } -}; -var SkeletonRenderer2 = _SkeletonRenderer2; -__publicField(SkeletonRenderer2, "QUAD_TRIANGLES", [0, 1, 2, 2, 3, 0]); -__publicField(SkeletonRenderer2, "VERTEX_SIZE", 2 + 2 + 4); - -// spine-phaser-v3/src/SpinePlugin.ts -var _SpinePlugin = class extends Phaser2.Plugins.ScenePlugin { - game; - isWebGL; - gl; - get webGLRenderer() { - return _SpinePlugin.gameWebGLRenderer; - } - canvasRenderer; - phaserRenderer; - skeletonDataCache; - atlasCache; - constructor(scene, pluginManager, pluginKey) { - super(scene, pluginManager, pluginKey); - this.game = pluginManager.game; - this.isWebGL = this.game.config.renderType === 2; - this.gl = this.isWebGL ? this.game.renderer.gl : null; - this.phaserRenderer = this.game.renderer; - this.canvasRenderer = null; - this.skeletonDataCache = this.game.cache.addCustom(SPINE_SKELETON_FILE_CACHE_KEY); - this.atlasCache = this.game.cache.addCustom(SPINE_ATLAS_CACHE_KEY); - let skeletonJsonFileCallback = function(key, url, xhrSettings) { - let file = new SpineSkeletonDataFile(this, key, url, SpineSkeletonDataFileType.json, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineJson", skeletonJsonFileCallback, scene); - let skeletonBinaryFileCallback = function(key, url, xhrSettings) { - let file = new SpineSkeletonDataFile(this, key, url, SpineSkeletonDataFileType.binary, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineBinary", skeletonBinaryFileCallback, scene); - let atlasFileCallback = function(key, url, premultipliedAlpha, xhrSettings) { - let file = new SpineAtlasFile(this, key, url, premultipliedAlpha, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineAtlas", atlasFileCallback, scene); - let addSpineGameObject = function(x, y, dataKey, atlasKey, boundsProvider) { - if (this.scene.sys.renderer instanceof Phaser2.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.clear(); - } - const spinePlugin = this.scene.sys[pluginKey]; - let gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, dataKey, atlasKey, boundsProvider); - this.displayList.add(gameObject); - this.updateList.add(gameObject); - if (this.scene.sys.renderer instanceof Phaser2.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.rebind(); - } - return gameObject; - }; - let makeSpineGameObject = function(config, addToScene = false) { - if (this.scene.sys.renderer instanceof Phaser2.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.clear(); - } - let x = config.x ? config.x : 0; - let y = config.y ? config.y : 0; - let boundsProvider = config.boundsProvider ? config.boundsProvider : void 0; - const spinePlugin = this.scene.sys[pluginKey]; - let gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, config.dataKey, config.atlasKey, boundsProvider); - if (addToScene !== void 0) { - config.add = addToScene; - } - if (this.scene.sys.renderer instanceof Phaser2.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.rebind(); - } - return Phaser2.GameObjects.BuildGameObject(this.scene, gameObject, config); - }; - pluginManager.registerGameObject(window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, addSpineGameObject, makeSpineGameObject); - } - boot() { - Skeleton.yDown = true; - if (this.isWebGL) { - if (!_SpinePlugin.gameWebGLRenderer) { - _SpinePlugin.gameWebGLRenderer = new SceneRenderer(this.game.renderer.canvas, this.gl, true); - } - this.onResize(); - this.game.scale.on(Phaser2.Scale.Events.RESIZE, this.onResize, this); - } else { - if (!this.canvasRenderer) { - this.canvasRenderer = new SkeletonRenderer2(this.scene.sys.context); - } - } - var eventEmitter = this.systems.events; - eventEmitter.once("shutdown", this.shutdown, this); - eventEmitter.once("destroy", this.destroy, this); - this.game.events.once("destroy", this.gameDestroy, this); - } - onResize() { - var phaserRenderer = this.game.renderer; - var sceneRenderer = this.webGLRenderer; - if (phaserRenderer && sceneRenderer) { - var viewportWidth = phaserRenderer.width; - var viewportHeight = phaserRenderer.height; - sceneRenderer.camera.position.x = viewportWidth / 2; - sceneRenderer.camera.position.y = viewportHeight / 2; - sceneRenderer.camera.up.y = -1; - sceneRenderer.camera.direction.z = 1; - sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); - } - } - shutdown() { - this.systems.events.off("shutdown", this.shutdown, this); - if (this.isWebGL) { - this.game.scale.off(Phaser2.Scale.Events.RESIZE, this.onResize, this); - } - } - destroy() { - this.shutdown(); - } - gameDestroy() { - this.pluginManager.removeGameObject(window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, true, true); - if (this.webGLRenderer) - this.webGLRenderer.dispose(); - _SpinePlugin.gameWebGLRenderer = null; - } - /** Returns the TextureAtlas instance for the given key */ - getAtlas(atlasKey) { - let atlas; - if (this.atlasCache.exists(atlasKey)) { - atlas = this.atlasCache.get(atlasKey); - } else { - let atlasFile = this.game.cache.text.get(atlasKey); - atlas = new TextureAtlas(atlasFile.data); - if (this.isWebGL) { - let gl = this.gl; - const phaserUnpackPmaValue = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL); - if (phaserUnpackPmaValue) - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - for (let atlasPage of atlas.pages) { - atlasPage.setTexture(new GLTexture(gl, this.game.textures.get(atlasKey + "!" + atlasPage.name).getSourceImage(), false)); - } - if (phaserUnpackPmaValue) - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); - } else { - for (let atlasPage of atlas.pages) { - atlasPage.setTexture(new CanvasTexture(this.game.textures.get(atlasKey + "!" + atlasPage.name).getSourceImage())); - } - } - this.atlasCache.add(atlasKey, atlas); - } - return atlas; - } - /** Returns whether the TextureAtlas uses premultiplied alpha */ - isAtlasPremultiplied(atlasKey) { - let atlasFile = this.game.cache.text.get(atlasKey); - if (!atlasFile) - return false; - return atlasFile.premultipliedAlpha; - } - /** Returns the SkeletonData instance for the given data and atlas key */ - getSkeletonData(dataKey, atlasKey) { - const atlas = this.getAtlas(atlasKey); - const combinedKey = dataKey + atlasKey; - let skeletonData; - if (this.skeletonDataCache.exists(combinedKey)) { - skeletonData = this.skeletonDataCache.get(combinedKey); - } else { - if (this.game.cache.json.exists(dataKey)) { - let jsonFile = this.game.cache.json.get(dataKey); - let json = new SkeletonJson(new AtlasAttachmentLoader(atlas)); - skeletonData = json.readSkeletonData(jsonFile); - } else { - let binaryFile = this.game.cache.binary.get(dataKey); - let binary = new SkeletonBinary(new AtlasAttachmentLoader(atlas)); - skeletonData = binary.readSkeletonData(new Uint8Array(binaryFile)); - } - this.skeletonDataCache.add(combinedKey, skeletonData); - } - return skeletonData; - } - /** Creates a new Skeleton instance from the data and atlas. */ - createSkeleton(dataKey, atlasKey) { - return new Skeleton(this.getSkeletonData(dataKey, atlasKey)); - } -}; -var SpinePlugin = _SpinePlugin; -__publicField(SpinePlugin, "gameWebGLRenderer", null); -__publicField(SpinePlugin, "rendererId", 0); -var SpineSkeletonDataFileType = /* @__PURE__ */ ((SpineSkeletonDataFileType2) => { - SpineSkeletonDataFileType2[SpineSkeletonDataFileType2["json"] = 0] = "json"; - SpineSkeletonDataFileType2[SpineSkeletonDataFileType2["binary"] = 1] = "binary"; - return SpineSkeletonDataFileType2; -})(SpineSkeletonDataFileType || {}); -var SpineSkeletonDataFile = class extends Phaser2.Loader.MultiFile { - constructor(loader, key, url, fileType, xhrSettings) { - if (typeof key !== "string") { - const config = key; - key = config.key; - url = config.url; - fileType = config.type === "spineJson" ? 0 /* json */ : 1 /* binary */; - xhrSettings = config.xhrSettings; - } - let file = null; - let isJson = fileType == 0 /* json */; - if (isJson) { - file = new Phaser2.Loader.FileTypes.JSONFile(loader, { - key, - url, - extension: "json", - xhrSettings - }); - } else { - file = new Phaser2.Loader.FileTypes.BinaryFile(loader, { - key, - url, - extension: "skel", - xhrSettings - }); - } - super(loader, SPINE_SKELETON_DATA_FILE_TYPE, key, [file]); - this.fileType = fileType; - } - onFileComplete(file) { - this.pending--; - } - addToCache() { - if (this.isReadyToProcess()) - this.files[0].addToCache(); - } -}; -var SpineAtlasFile = class extends Phaser2.Loader.MultiFile { - constructor(loader, key, url, premultipliedAlpha, xhrSettings) { - if (typeof key !== "string") { - const config = key; - key = config.key; - url = config.url; - premultipliedAlpha = config.premultipliedAlpha; - xhrSettings = config.xhrSettings; - } - super(loader, SPINE_ATLAS_FILE_TYPE, key, [ - new Phaser2.Loader.FileTypes.TextFile(loader, { - key, - url, - xhrSettings, - extension: "atlas" - }) - ]); - this.premultipliedAlpha = premultipliedAlpha; - } - onFileComplete(file) { - if (this.files.indexOf(file) != -1) { - this.pending--; - if (file.type == "text") { - var lines = file.data.split(/\r\n|\r|\n/); - let textures = []; - textures.push(lines[0]); - for (var t = 1; t < lines.length; t++) { - var line = lines[t]; - if (line.trim() === "" && t < lines.length - 1) { - line = lines[t + 1]; - textures.push(line); - } - } - let basePath = file.src.match(/^.*\//) ?? ""; - for (var i = 0; i < textures.length; i++) { - var url = basePath + textures[i]; - var key = file.key + "!" + textures[i]; - var image = new Phaser2.Loader.FileTypes.ImageFile(this.loader, key, url); - if (!this.loader.keyExists(image)) { - this.addToMultiFile(image); - this.loader.addFile(image); - } - } - } - } - } - addToCache() { - if (this.isReadyToProcess()) { - let textureManager = this.loader.textureManager; - for (let file of this.files) { - if (file.type == "image") { - if (!textureManager.exists(file.key)) { - textureManager.addImage(file.key, file.data); - } - } else { - this.premultipliedAlpha = this.premultipliedAlpha ?? (file.data.indexOf("pma: true") >= 0 || file.data.indexOf("pma:true") >= 0); - file.data = { - data: file.data, - premultipliedAlpha: this.premultipliedAlpha - }; - file.addToCache(); - } - } - } - } -}; - -// spine-phaser-v3/src/index.ts -window.spine = { SpinePlugin }; -window["spine.SpinePlugin"] = SpinePlugin; -export { - Alpha, - AlphaMixin, - AlphaTimeline, - Animation, - AnimationState, - AnimationStateAdapter, - AnimationStateData, - AssetManager, - AssetManagerBase, - AtlasAttachmentLoader, - Attachment, - AttachmentTimeline, - BinaryInput, - BlendMode, - Bone, - BoneData, - BoundingBoxAttachment, - CURRENT, - CameraController, - ClippingAttachment, - Color, - Color2Attribute, - ColorAttribute, - ComputedSize, - ComputedSizeMixin, - ConstraintData, - CurveTimeline, - CurveTimeline1, - CurveTimeline2, - DebugUtils, - DeformTimeline, - Depth, - DepthMixin, - Downloader, - DrawOrderTimeline, - Event, - EventData, - EventQueue, - EventTimeline, - EventType, - FIRST, - FakeTexture, - Flip, - FlipMixin, - GLTexture, - HOLD_FIRST, - HOLD_MIX, - HOLD_SUBSEQUENT, - IkConstraint, - IkConstraintData, - IkConstraintTimeline, - Inherit, - InheritTimeline, - Input, - IntSet, - Interpolation, - LoadingScreen, - M00, - M01, - M02, - M03, - M10, - M11, - M12, - M13, - M20, - M21, - M22, - M23, - M30, - M31, - M32, - M33, - ManagedWebGLRenderingContext, - MathUtils, - Matrix42 as Matrix4, - Mesh, - MeshAttachment, - MixBlend, - MixDirection, - Origin, - OriginMixin, - OrthoCamera, - PathAttachment, - PathConstraint, - PathConstraintData, - PathConstraintMixTimeline, - PathConstraintPositionTimeline, - PathConstraintSpacingTimeline, - Physics, - PhysicsConstraintDampingTimeline, - PhysicsConstraintGravityTimeline, - PhysicsConstraintInertiaTimeline, - PhysicsConstraintMassTimeline, - PhysicsConstraintMixTimeline, - PhysicsConstraintResetTimeline, - PhysicsConstraintStrengthTimeline, - PhysicsConstraintTimeline, - PhysicsConstraintWindTimeline, - PointAttachment, - PolygonBatcher, - Pool, - Position2Attribute, - Position3Attribute, - PositionMode, - Pow, - PowOut, - RGB2Timeline, - RGBA2Timeline, - RGBATimeline, - RGBTimeline, - RegionAttachment, - ResizeMode, - RotateMode, - RotateTimeline, - SETUP, - SUBSEQUENT, - ScaleTimeline, - ScaleXTimeline, - ScaleYTimeline, - SceneRenderer, - ScrollFactor, - ScrollFactorMixin, - SequenceTimeline, - SetupPoseBoundsProvider, - Shader, - ShapeRenderer, - ShapeType, - ShearTimeline, - ShearXTimeline, - ShearYTimeline, - Skeleton, - SkeletonBinary, - SkeletonBounds, - SkeletonClipping, - SkeletonData, - SkeletonDebugRenderer, - SkeletonJson, - SkeletonRenderer, - Skin, - SkinEntry, - SkinsAndAnimationBoundsProvider, - Slot, - SlotData, - SpacingMode, - SpineCanvas, - SpineGameObject, - SpinePlugin, - StringSet, - TexCoordAttribute, - Texture, - TextureAtlas, - TextureAtlasPage, - TextureAtlasRegion, - TextureFilter, - TextureRegion, - TextureWrap, - TimeKeeper, - Timeline, - Touch, - TrackEntry, - Transform, - TransformConstraint, - TransformConstraintData, - TransformConstraintTimeline, - TransformMixin, - TranslateTimeline, - TranslateXTimeline, - TranslateYTimeline, - Triangulator, - Utils, - Vector2, - Vector3, - VertexAttachment, - VertexAttribute, - VertexAttributeType, - Visible, - VisibleMixin, - WindowedMean, - createMixin -}; -//# sourceMappingURL=spine-phaser-v3.mjs.map diff --git a/spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs.map b/spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs.map deleted file mode 100644 index 39f6ed318..000000000 --- a/spine-ts/spine-phaser-v3/dist/esm/spine-phaser-v3.mjs.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../src/require-shim.ts", "../../src/SpinePlugin.ts", "../../src/keys.ts", "../../../spine-core/src/Utils.ts", "../../../spine-core/src/attachments/Attachment.ts", "../../../spine-core/src/attachments/Sequence.ts", "../../../spine-core/src/Animation.ts", "../../../spine-core/src/AnimationState.ts", "../../../spine-core/src/AnimationStateData.ts", "../../../spine-core/src/attachments/BoundingBoxAttachment.ts", "../../../spine-core/src/attachments/ClippingAttachment.ts", "../../../spine-core/src/Texture.ts", "../../../spine-core/src/TextureAtlas.ts", "../../../spine-core/src/attachments/MeshAttachment.ts", "../../../spine-core/src/attachments/PathAttachment.ts", "../../../spine-core/src/attachments/PointAttachment.ts", "../../../spine-core/src/attachments/RegionAttachment.ts", "../../../spine-core/src/AtlasAttachmentLoader.ts", "../../../spine-core/src/BoneData.ts", "../../../spine-core/src/Bone.ts", "../../../spine-core/src/ConstraintData.ts", "../../../spine-core/src/AssetManagerBase.ts", "../../../spine-core/src/Event.ts", "../../../spine-core/src/EventData.ts", "../../../spine-core/src/IkConstraint.ts", "../../../spine-core/src/IkConstraintData.ts", "../../../spine-core/src/PathConstraintData.ts", "../../../spine-core/src/PathConstraint.ts", "../../../spine-core/src/PhysicsConstraint.ts", "../../../spine-core/src/Slot.ts", "../../../spine-core/src/TransformConstraint.ts", "../../../spine-core/src/Skeleton.ts", "../../../spine-core/src/PhysicsConstraintData.ts", "../../../spine-core/src/SkeletonData.ts", "../../../spine-core/src/Skin.ts", "../../../spine-core/src/SlotData.ts", "../../../spine-core/src/TransformConstraintData.ts", "../../../spine-core/src/SkeletonBinary.ts", "../../../spine-core/src/SkeletonBounds.ts", "../../../spine-core/src/Triangulator.ts", "../../../spine-core/src/SkeletonClipping.ts", "../../../spine-core/src/SkeletonJson.ts", "../../../spine-core/src/polyfills.ts", "../../../spine-webgl/src/WebGL.ts", "../../../spine-webgl/src/GLTexture.ts", "../../../spine-webgl/src/AssetManager.ts", "../../../spine-webgl/src/Vector3.ts", "../../../spine-webgl/src/Matrix4.ts", "../../../spine-webgl/src/Camera.ts", "../../../spine-webgl/src/Input.ts", "../../../spine-webgl/src/CameraController.ts", "../../../spine-webgl/src/Shader.ts", "../../../spine-webgl/src/Mesh.ts", "../../../spine-webgl/src/PolygonBatcher.ts", "../../../spine-webgl/src/ShapeRenderer.ts", "../../../spine-webgl/src/SkeletonDebugRenderer.ts", "../../../spine-webgl/src/SkeletonRenderer.ts", "../../../spine-webgl/src/SceneRenderer.ts", "../../../spine-webgl/src/LoadingScreen.ts", "../../../spine-webgl/src/SpineCanvas.ts", "../../src/mixins.ts", "../../src/SpineGameObject.ts", "../../../spine-canvas/src/CanvasTexture.ts", "../../../spine-canvas/src/SkeletonRenderer.ts", "../../src/index.ts"], - "sourcesContent": ["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\ndeclare global {\n\tvar require: any;\n}\nif (typeof window !== 'undefined' && window.Phaser) {\n\tlet prevRequire = window.require;\n\twindow.require = (x: string) => {\n\t\tif (prevRequire) return prevRequire(x);\n\t\telse if (x === \"Phaser\") return window.Phaser;\n\t}\n}\nexport { }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport * as Phaser from \"phaser\";\nimport { SPINE_ATLAS_CACHE_KEY, SPINE_GAME_OBJECT_TYPE, SPINE_SKELETON_DATA_FILE_TYPE, SPINE_ATLAS_FILE_TYPE, SPINE_SKELETON_FILE_CACHE_KEY as SPINE_SKELETON_DATA_CACHE_KEY } from \"./keys.js\";\nimport { AtlasAttachmentLoader, GLTexture, SceneRenderer, Skeleton, SkeletonBinary, SkeletonData, SkeletonJson, TextureAtlas } from \"@esotericsoftware/spine-webgl\"\nimport { SpineGameObject, SpineGameObjectBoundsProvider } from \"./SpineGameObject.js\";\nimport { CanvasTexture, SkeletonRenderer } from \"@esotericsoftware/spine-canvas\";\n\n/**\n * Configuration object used when creating {@link SpineGameObject} instances via a scene's\n * {@link GameObjectCreator} (`Scene.make`).\n */\nexport interface SpineGameObjectConfig extends Phaser.Types.GameObjects.GameObjectConfig {\n\t/** The x-position of the object, optional, default: 0 */\n\tx?: number,\n\t/** The y-position of the object, optional, default: 0 */\n\ty?: number,\n\t/** The skeleton data key */\n\tdataKey: string,\n\t/** The atlas key */\n\tatlasKey: string\n\t/** The bounds provider, optional, default: `SetupPoseBoundsProvider` */\n\tboundsProvider?: SpineGameObjectBoundsProvider\n}\n\n/**\n * {@link ScenePlugin} implementation adding Spine Runtime capabilities to a scene.\n *\n * The scene's {@link LoaderPlugin} (`Scene.load`) gets these additional functions:\n * * `spineBinary(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`.\n * * `spineJson(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`.\n * * `spineAtlas(key: string, url: string, premultipliedAlpha: boolean = true, xhrSettings?: XHRSettingsObject)`: loads a texture atlas `.atlas` file from the `url` as well as its correponding texture atlas page images.\n *\n * The scene's {@link GameObjectFactory} (`Scene.add`) gets these additional functions:\n * * `spine(x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider = SetupPoseBoundsProvider())`:\n * creates a new {@link SpineGameObject} from the data and atlas at position `(x, y)`, using the {@link BoundsProvider} to calculate its bounding box. The object is automatically added to the scene.\n *\n * The scene's {@link GameObjectCreator} (`Scene.make`) gets these additional functions:\n * * `spine(config: SpineGameObjectConfig)`: creates a new {@link SpineGameObject} from the given configuration object.\n *\n * The plugin has additional public methods to work with Spine Runtime core API objects:\n * * `getAtlas(atlasKey: string)`: returns the {@link TextureAtlas} instance for the given atlas key.\n * * `getSkeletonData(skeletonDataKey: string)`: returns the {@link SkeletonData} instance for the given skeleton data key.\n * * `createSkeleton(skeletonDataKey: string, atlasKey: string, premultipliedAlpha: boolean = true)`: creates a new {@link Skeleton} instance from the given skeleton data and atlas key.\n * * `isPremultipliedAlpha(atlasKey: string)`: returns `true` if the atlas with the given key has premultiplied alpha.\n */\nexport class SpinePlugin extends Phaser.Plugins.ScenePlugin {\n\tgame: Phaser.Game;\n\tprivate isWebGL: boolean;\n\tgl: WebGLRenderingContext | null;\n\tstatic gameWebGLRenderer: SceneRenderer | null = null;\n\tget webGLRenderer (): SceneRenderer | null {\n\t\treturn SpinePlugin.gameWebGLRenderer;\n\t}\n\tcanvasRenderer: SkeletonRenderer | null;\n\tphaserRenderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer;\n\tprivate skeletonDataCache: Phaser.Cache.BaseCache;\n\tprivate atlasCache: Phaser.Cache.BaseCache;\n\n\tconstructor (scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n\t\tsuper(scene, pluginManager, pluginKey);\n\t\tthis.game = pluginManager.game;\n\t\tthis.isWebGL = this.game.config.renderType === 2;\n\t\tthis.gl = this.isWebGL ? (this.game.renderer as Phaser.Renderer.WebGL.WebGLRenderer).gl : null;\n\t\tthis.phaserRenderer = this.game.renderer;\n\t\tthis.canvasRenderer = null;\n\t\tthis.skeletonDataCache = this.game.cache.addCustom(SPINE_SKELETON_DATA_CACHE_KEY);\n\t\tthis.atlasCache = this.game.cache.addCustom(SPINE_ATLAS_CACHE_KEY);\n\n\t\tlet skeletonJsonFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineSkeletonDataFile(this as any, key, url, SpineSkeletonDataFileType.json, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineJson\", skeletonJsonFileCallback, scene);\n\n\t\tlet skeletonBinaryFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineSkeletonDataFile(this as any, key, url, SpineSkeletonDataFileType.binary, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineBinary\", skeletonBinaryFileCallback, scene);\n\n\t\tlet atlasFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\tpremultipliedAlpha: boolean,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineAtlasFile(this as any, key, url, premultipliedAlpha, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineAtlas\", atlasFileCallback, scene);\n\n\t\tlet addSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider) {\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.clear();\n\t\t\t}\n\n\t\t\tconst spinePlugin = (this.scene.sys as any)[pluginKey] as SpinePlugin;\n\t\t\tlet gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, dataKey, atlasKey, boundsProvider);\n\t\t\tthis.displayList.add(gameObject);\n\t\t\tthis.updateList.add(gameObject);\n\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.rebind();\n\t\t\t}\n\n\t\t\treturn gameObject;\n\t\t};\n\n\t\tlet makeSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, config: SpineGameObjectConfig, addToScene: boolean = false) {\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.clear();\n\t\t\t}\n\n\t\t\tlet x = config.x ? config.x : 0;\n\t\t\tlet y = config.y ? config.y : 0;\n\t\t\tlet boundsProvider = config.boundsProvider ? config.boundsProvider : undefined;\n\n\t\t\tconst spinePlugin = (this.scene.sys as any)[pluginKey] as SpinePlugin;\n\t\t\tlet gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, config.dataKey, config.atlasKey, boundsProvider);\n\t\t\tif (addToScene !== undefined) {\n\t\t\t\tconfig.add = addToScene;\n\t\t\t}\n\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.rebind();\n\t\t\t}\n\n\t\t\treturn Phaser.GameObjects.BuildGameObject(this.scene, gameObject, config);\n\t\t}\n\t\tpluginManager.registerGameObject((window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, addSpineGameObject, makeSpineGameObject);\n\t}\n\n\tstatic rendererId = 0;\n\tboot () {\n\t\tSkeleton.yDown = true;\n\t\tif (this.isWebGL) {\n\t\t\tif (!SpinePlugin.gameWebGLRenderer) {\n\t\t\t\tSpinePlugin.gameWebGLRenderer = new SceneRenderer((this.game.renderer! as Phaser.Renderer.WebGL.WebGLRenderer).canvas, this.gl!, true);\n\t\t\t}\n\t\t\tthis.onResize();\n\t\t\tthis.game.scale.on(Phaser.Scale.Events.RESIZE, this.onResize, this);\n\t\t} else {\n\t\t\tif (!this.canvasRenderer) {\n\t\t\t\tthis.canvasRenderer = new SkeletonRenderer(this.scene!.sys.context);\n\t\t\t}\n\t\t}\n\n\t\tvar eventEmitter = this.systems!.events;\n\t\teventEmitter.once('shutdown', this.shutdown, this);\n\t\teventEmitter.once('destroy', this.destroy, this);\n\t\tthis.game.events.once('destroy', this.gameDestroy, this);\n\t}\n\n\tonResize () {\n\t\tvar phaserRenderer = this.game.renderer;\n\t\tvar sceneRenderer = this.webGLRenderer;\n\n\t\tif (phaserRenderer && sceneRenderer) {\n\t\t\tvar viewportWidth = phaserRenderer.width;\n\t\t\tvar viewportHeight = phaserRenderer.height;\n\t\t\tsceneRenderer.camera.position.x = viewportWidth / 2;\n\t\t\tsceneRenderer.camera.position.y = viewportHeight / 2;\n\t\t\tsceneRenderer.camera.up.y = -1;\n\t\t\tsceneRenderer.camera.direction.z = 1;\n\t\t\tsceneRenderer.camera.setViewport(viewportWidth, viewportHeight);\n\t\t}\n\t}\n\n\tshutdown () {\n\t\tthis.systems!.events.off(\"shutdown\", this.shutdown, this);\n\t\tif (this.isWebGL) {\n\t\t\tthis.game.scale.off(Phaser.Scale.Events.RESIZE, this.onResize, this);\n\t\t}\n\t}\n\n\tdestroy () {\n\t\tthis.shutdown()\n\t}\n\n\tgameDestroy () {\n\t\tthis.pluginManager.removeGameObject((window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, true, true);\n\t\tif (this.webGLRenderer) this.webGLRenderer.dispose();\n\t\tSpinePlugin.gameWebGLRenderer = null;\n\t}\n\n\t/** Returns the TextureAtlas instance for the given key */\n\tgetAtlas (atlasKey: string) {\n\t\tlet atlas: TextureAtlas;\n\t\tif (this.atlasCache.exists(atlasKey)) {\n\t\t\tatlas = this.atlasCache.get(atlasKey);\n\t\t} else {\n\t\t\tlet atlasFile = this.game.cache.text.get(atlasKey) as { data: string, premultipliedAlpha: boolean };\n\t\t\tatlas = new TextureAtlas(atlasFile.data);\n\t\t\tif (this.isWebGL) {\n\t\t\t\tlet gl = this.gl!;\n\t\t\t\tconst phaserUnpackPmaValue = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL);\n\t\t\t\tif (phaserUnpackPmaValue) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\t\t\t\tfor (let atlasPage of atlas.pages) {\n\t\t\t\t\tatlasPage.setTexture(new GLTexture(gl, this.game.textures.get(atlasKey + \"!\" + atlasPage.name).getSourceImage() as HTMLImageElement | ImageBitmap, false));\n\t\t\t\t}\n\t\t\t\tif (phaserUnpackPmaValue) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\t\t\t} else {\n\t\t\t\tfor (let atlasPage of atlas.pages) {\n\t\t\t\t\tatlasPage.setTexture(new CanvasTexture(this.game.textures.get(atlasKey + \"!\" + atlasPage.name).getSourceImage() as HTMLImageElement | ImageBitmap));\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.atlasCache.add(atlasKey, atlas);\n\t\t}\n\t\treturn atlas;\n\t}\n\n\t/** Returns whether the TextureAtlas uses premultiplied alpha */\n\tisAtlasPremultiplied (atlasKey: string) {\n\t\tlet atlasFile = this.game.cache.text.get(atlasKey);\n\t\tif (!atlasFile) return false;\n\t\treturn atlasFile.premultipliedAlpha;\n\t}\n\n\t/** Returns the SkeletonData instance for the given data and atlas key */\n\tgetSkeletonData (dataKey: string, atlasKey: string) {\n\t\tconst atlas = this.getAtlas(atlasKey)\n\t\tconst combinedKey = dataKey + atlasKey;\n\t\tlet skeletonData: SkeletonData;\n\t\tif (this.skeletonDataCache.exists(combinedKey)) {\n\t\t\tskeletonData = this.skeletonDataCache.get(combinedKey);\n\t\t} else {\n\t\t\tif (this.game.cache.json.exists(dataKey)) {\n\t\t\t\tlet jsonFile = this.game.cache.json.get(dataKey) as any;\n\t\t\t\tlet json = new SkeletonJson(new AtlasAttachmentLoader(atlas));\n\t\t\t\tskeletonData = json.readSkeletonData(jsonFile);\n\t\t\t} else {\n\t\t\t\tlet binaryFile = this.game.cache.binary.get(dataKey) as ArrayBuffer;\n\t\t\t\tlet binary = new SkeletonBinary(new AtlasAttachmentLoader(atlas));\n\t\t\t\tskeletonData = binary.readSkeletonData(new Uint8Array(binaryFile));\n\t\t\t}\n\t\t\tthis.skeletonDataCache.add(combinedKey, skeletonData);\n\t\t}\n\t\treturn skeletonData;\n\t}\n\n\t/** Creates a new Skeleton instance from the data and atlas. */\n\tcreateSkeleton (dataKey: string, atlasKey: string) {\n\t\treturn new Skeleton(this.getSkeletonData(dataKey, atlasKey));\n\t}\n}\n\nenum SpineSkeletonDataFileType {\n\tjson,\n\tbinary\n}\n\ninterface SpineSkeletonDataFileConfig {\n\tkey: string;\n\turl: string;\n\ttype: \"spineJson\" | \"spineBinary\";\n\txhrSettings?: Phaser.Types.Loader.XHRSettingsObject\n}\n\nclass SpineSkeletonDataFile extends Phaser.Loader.MultiFile {\n\tconstructor (loader: Phaser.Loader.LoaderPlugin, key: string | SpineSkeletonDataFileConfig, url?: string, public fileType?: SpineSkeletonDataFileType, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject) {\n\t\tif (typeof key !== \"string\") {\n\t\t\tconst config = key;\n\t\t\tkey = config.key;\n\t\t\turl = config.url;\n\t\t\tfileType = config.type === \"spineJson\" ? SpineSkeletonDataFileType.json : SpineSkeletonDataFileType.binary;\n\t\t\txhrSettings = config.xhrSettings;\n\t\t}\n\t\tlet file = null;\n\t\tlet isJson = fileType == SpineSkeletonDataFileType.json;\n\t\tif (isJson) {\n\t\t\tfile = new Phaser.Loader.FileTypes.JSONFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\textension: \"json\",\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t} as Phaser.Types.Loader.FileTypes.JSONFileConfig);\n\t\t} else {\n\t\t\tfile = new Phaser.Loader.FileTypes.BinaryFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\textension: \"skel\",\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t} as Phaser.Types.Loader.FileTypes.BinaryFileConfig);\n\t\t}\n\t\tsuper(loader, SPINE_SKELETON_DATA_FILE_TYPE, key, [file]);\n\t}\n\n\tonFileComplete (file: Phaser.Loader.File) {\n\t\tthis.pending--;\n\t}\n\n\taddToCache () {\n\t\tif (this.isReadyToProcess()) this.files[0].addToCache();\n\t}\n}\n\ninterface SpineAtlasFileConfig {\n\tkey: string;\n\turl: string;\n\tpremultipliedAlpha?: boolean;\n\txhrSettings?: Phaser.Types.Loader.XHRSettingsObject;\n}\n\nclass SpineAtlasFile extends Phaser.Loader.MultiFile {\n\tconstructor (loader: Phaser.Loader.LoaderPlugin, key: string | SpineAtlasFileConfig, url?: string, public premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject) {\n\t\tif (typeof key !== \"string\") {\n\t\t\tconst config = key;\n\t\t\tkey = config.key;\n\t\t\turl = config.url;\n\t\t\tpremultipliedAlpha = config.premultipliedAlpha;\n\t\t\txhrSettings = config.xhrSettings;\n\t\t}\n\n\t\tsuper(loader, SPINE_ATLAS_FILE_TYPE, key, [\n\t\t\tnew Phaser.Loader.FileTypes.TextFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t\textension: \"atlas\"\n\t\t\t})\n\t\t]);\n\t}\n\n\tonFileComplete (file: Phaser.Loader.File) {\n\t\tif (this.files.indexOf(file) != -1) {\n\t\t\tthis.pending--;\n\n\t\t\tif (file.type == \"text\") {\n\t\t\t\tvar lines = file.data.split(/\\r\\n|\\r|\\n/);\n\t\t\t\tlet textures = [];\n\t\t\t\ttextures.push(lines[0]);\n\t\t\t\tfor (var t = 1; t < lines.length; t++) {\n\t\t\t\t\tvar line = lines[t];\n\t\t\t\t\tif (line.trim() === '' && t < lines.length - 1) {\n\t\t\t\t\t\tline = lines[t + 1];\n\t\t\t\t\t\ttextures.push(line);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet basePath = file.src.match(/^.*\\//) ?? \"\";\n\t\t\t\tfor (var i = 0; i < textures.length; i++) {\n\t\t\t\t\tvar url = basePath + textures[i];\n\t\t\t\t\tvar key = file.key + \"!\" + textures[i];\n\t\t\t\t\tvar image = new Phaser.Loader.FileTypes.ImageFile(this.loader, key, url);\n\n\t\t\t\t\tif (!this.loader.keyExists(image)) {\n\t\t\t\t\t\tthis.addToMultiFile(image);\n\t\t\t\t\t\tthis.loader.addFile(image);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\taddToCache () {\n\t\tif (this.isReadyToProcess()) {\n\t\t\tlet textureManager = this.loader.textureManager;\n\t\t\tfor (let file of this.files) {\n\t\t\t\tif (file.type == \"image\") {\n\t\t\t\t\tif (!textureManager.exists(file.key)) {\n\t\t\t\t\t\ttextureManager.addImage(file.key, file.data);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.premultipliedAlpha = this.premultipliedAlpha ?? (file.data.indexOf(\"pma: true\") >= 0 || file.data.indexOf(\"pma:true\") >= 0);\n\t\t\t\t\tfile.data = {\n\t\t\t\t\t\tdata: file.data,\n\t\t\t\t\t\tpremultipliedAlpha: this.premultipliedAlpha,\n\t\t\t\t\t};\n\t\t\t\t\tfile.addToCache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport const SPINE_SKELETON_FILE_CACHE_KEY = \"esotericsoftware.spine.skeletonFile.cache\";\nexport const SPINE_ATLAS_CACHE_KEY = \"esotericsoftware.spine.atlas.cache\";\nexport const SPINE_LOADER_TYPE = \"spine\";\nexport const SPINE_SKELETON_DATA_FILE_TYPE = \"spineSkeletonData\";\nexport const SPINE_ATLAS_FILE_TYPE = \"spineAtlasData\";\nexport const SPINE_GAME_OBJECT_TYPE = \"spine\";\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Skeleton } from \"./Skeleton.js\";\nimport { MixBlend } from \"./Animation.js\";\n\nexport interface StringMap {\n\t[key: string]: T;\n}\n\nexport class IntSet {\n\tarray = new Array();\n\n\tadd (value: number): boolean {\n\t\tlet contains = this.contains(value);\n\t\tthis.array[value | 0] = value | 0;\n\t\treturn !contains;\n\t}\n\n\tcontains (value: number) {\n\t\treturn this.array[value | 0] != undefined;\n\t}\n\n\tremove (value: number) {\n\t\tthis.array[value | 0] = undefined;\n\t}\n\n\tclear () {\n\t\tthis.array.length = 0;\n\t}\n}\n\nexport class StringSet {\n\tentries: StringMap = {};\n\tsize = 0;\n\n\tadd (value: string): boolean {\n\t\tlet contains = this.entries[value];\n\t\tthis.entries[value] = true;\n\t\tif (!contains) {\n\t\t\tthis.size++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\taddAll (values: string[]): boolean {\n\t\tlet oldSize = this.size;\n\t\tfor (var i = 0, n = values.length; i < n; i++)\n\t\t\tthis.add(values[i]);\n\t\treturn oldSize != this.size;\n\t}\n\n\tcontains (value: string) {\n\t\treturn this.entries[value];\n\t}\n\n\tclear () {\n\t\tthis.entries = {};\n\t\tthis.size = 0;\n\t}\n}\n\nexport type NumberArrayLike = Array | Float32Array;\nexport type IntArrayLike = Array | Int16Array;\n\nexport interface Disposable {\n\tdispose (): void;\n}\n\nexport interface Restorable {\n\trestore (): void;\n}\n\nexport class Color {\n\tpublic static WHITE = new Color(1, 1, 1, 1);\n\tpublic static RED = new Color(1, 0, 0, 1);\n\tpublic static GREEN = new Color(0, 1, 0, 1);\n\tpublic static BLUE = new Color(0, 0, 1, 1);\n\tpublic static MAGENTA = new Color(1, 0, 1, 1);\n\n\tconstructor (public r: number = 0, public g: number = 0, public b: number = 0, public a: number = 0) {\n\t}\n\n\tset (r: number, g: number, b: number, a: number) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tthis.a = a;\n\t\treturn this.clamp();\n\t}\n\n\tsetFromColor (c: Color) {\n\t\tthis.r = c.r;\n\t\tthis.g = c.g;\n\t\tthis.b = c.b;\n\t\tthis.a = c.a;\n\t\treturn this;\n\t}\n\n\tsetFromString (hex: string) {\n\t\thex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\n\t\tthis.r = parseInt(hex.substr(0, 2), 16) / 255;\n\t\tthis.g = parseInt(hex.substr(2, 2), 16) / 255;\n\t\tthis.b = parseInt(hex.substr(4, 2), 16) / 255;\n\t\tthis.a = hex.length != 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255;\n\t\treturn this;\n\t}\n\n\tadd (r: number, g: number, b: number, a: number) {\n\t\tthis.r += r;\n\t\tthis.g += g;\n\t\tthis.b += b;\n\t\tthis.a += a;\n\t\treturn this.clamp();\n\t}\n\n\tclamp () {\n\t\tif (this.r < 0) this.r = 0;\n\t\telse if (this.r > 1) this.r = 1;\n\n\t\tif (this.g < 0) this.g = 0;\n\t\telse if (this.g > 1) this.g = 1;\n\n\t\tif (this.b < 0) this.b = 0;\n\t\telse if (this.b > 1) this.b = 1;\n\n\t\tif (this.a < 0) this.a = 0;\n\t\telse if (this.a > 1) this.a = 1;\n\t\treturn this;\n\t}\n\n\tstatic rgba8888ToColor (color: Color, value: number) {\n\t\tcolor.r = ((value & 0xff000000) >>> 24) / 255;\n\t\tcolor.g = ((value & 0x00ff0000) >>> 16) / 255;\n\t\tcolor.b = ((value & 0x0000ff00) >>> 8) / 255;\n\t\tcolor.a = ((value & 0x000000ff)) / 255;\n\t}\n\n\tstatic rgb888ToColor (color: Color, value: number) {\n\t\tcolor.r = ((value & 0x00ff0000) >>> 16) / 255;\n\t\tcolor.g = ((value & 0x0000ff00) >>> 8) / 255;\n\t\tcolor.b = ((value & 0x000000ff)) / 255;\n\t}\n\n\ttoRgb888 () {\n\t\tconst hex = (x: number) => (\"0\" + (x * 255).toString(16)).slice(-2);\n\t\treturn Number(\"0x\" + hex(this.r) + hex(this.g) + hex(this.b));\n\t}\n\n\tstatic fromString (hex: string): Color {\n\t\treturn new Color().setFromString(hex);\n\t}\n}\n\nexport class MathUtils {\n\tstatic PI = 3.1415927;\n\tstatic PI2 = MathUtils.PI * 2;\n\tstatic invPI2 = 1 / MathUtils.PI2;\n\tstatic radiansToDegrees = 180 / MathUtils.PI;\n\tstatic radDeg = MathUtils.radiansToDegrees;\n\tstatic degreesToRadians = MathUtils.PI / 180;\n\tstatic degRad = MathUtils.degreesToRadians;\n\n\tstatic clamp (value: number, min: number, max: number) {\n\t\tif (value < min) return min;\n\t\tif (value > max) return max;\n\t\treturn value;\n\t}\n\n\tstatic cosDeg (degrees: number) {\n\t\treturn Math.cos(degrees * MathUtils.degRad);\n\t}\n\n\tstatic sinDeg (degrees: number) {\n\t\treturn Math.sin(degrees * MathUtils.degRad);\n\t}\n\n\tstatic atan2Deg (y: number, x: number) {\n\t\treturn Math.atan2(y, x) * MathUtils.degRad;\n\t}\n\n\tstatic signum (value: number): number {\n\t\treturn value > 0 ? 1 : value < 0 ? -1 : 0;\n\t}\n\n\tstatic toInt (x: number) {\n\t\treturn x > 0 ? Math.floor(x) : Math.ceil(x);\n\t}\n\n\tstatic cbrt (x: number) {\n\t\tlet y = Math.pow(Math.abs(x), 1 / 3);\n\t\treturn x < 0 ? -y : y;\n\t}\n\n\tstatic randomTriangular (min: number, max: number): number {\n\t\treturn MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\n\t}\n\n\tstatic randomTriangularWith (min: number, max: number, mode: number): number {\n\t\tlet u = Math.random();\n\t\tlet d = max - min;\n\t\tif (u <= (mode - min) / d) return min + Math.sqrt(u * d * (mode - min));\n\t\treturn max - Math.sqrt((1 - u) * d * (max - mode));\n\t}\n\n\tstatic isPowerOfTwo (value: number) {\n\t\treturn value && (value & (value - 1)) === 0;\n\t}\n}\n\nexport abstract class Interpolation {\n\tprotected abstract applyInternal (a: number): number;\n\tapply (start: number, end: number, a: number): number {\n\t\treturn start + (end - start) * this.applyInternal(a);\n\t}\n}\n\nexport class Pow extends Interpolation {\n\tprotected power = 2;\n\n\tconstructor (power: number) {\n\t\tsuper();\n\t\tthis.power = power;\n\t}\n\n\tapplyInternal (a: number): number {\n\t\tif (a <= 0.5) return Math.pow(a * 2, this.power) / 2;\n\t\treturn Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\n\t}\n}\n\nexport class PowOut extends Pow {\n\tconstructor (power: number) {\n\t\tsuper(power);\n\t}\n\n\tapplyInternal (a: number): number {\n\t\treturn Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\n\t}\n}\n\nexport class Utils {\n\tstatic SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\n\n\tstatic arrayCopy (source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number) {\n\t\tfor (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\n\t\t\tdest[j] = source[i];\n\t\t}\n\t}\n\n\tstatic arrayFill (array: ArrayLike, fromIndex: number, toIndex: number, value: T) {\n\t\tfor (let i = fromIndex; i < toIndex; i++)\n\t\t\tarray[i] = value;\n\t}\n\n\tstatic setArraySize (array: Array, size: number, value: any = 0): Array {\n\t\tlet oldSize = array.length;\n\t\tif (oldSize == size) return array;\n\t\tarray.length = size;\n\t\tif (oldSize < size) {\n\t\t\tfor (let i = oldSize; i < size; i++) array[i] = value;\n\t\t}\n\t\treturn array;\n\t}\n\n\tstatic ensureArrayCapacity (array: Array, size: number, value: any = 0): Array {\n\t\tif (array.length >= size) return array;\n\t\treturn Utils.setArraySize(array, size, value);\n\t}\n\n\tstatic newArray (size: number, defaultValue: T): Array {\n\t\tlet array = new Array(size);\n\t\tfor (let i = 0; i < size; i++) array[i] = defaultValue;\n\t\treturn array;\n\t}\n\n\tstatic newFloatArray (size: number): NumberArrayLike {\n\t\tif (Utils.SUPPORTS_TYPED_ARRAYS)\n\t\t\treturn new Float32Array(size)\n\t\telse {\n\t\t\tlet array = new Array(size);\n\t\t\tfor (let i = 0; i < array.length; i++) array[i] = 0;\n\t\t\treturn array;\n\t\t}\n\t}\n\n\tstatic newShortArray (size: number): IntArrayLike {\n\t\tif (Utils.SUPPORTS_TYPED_ARRAYS)\n\t\t\treturn new Int16Array(size)\n\t\telse {\n\t\t\tlet array = new Array(size);\n\t\t\tfor (let i = 0; i < array.length; i++) array[i] = 0;\n\t\t\treturn array;\n\t\t}\n\t}\n\n\tstatic toFloatArray (array: Array) {\n\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\n\t}\n\n\tstatic toSinglePrecision (value: number) {\n\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\n\t}\n\n\t// This function is used to fix WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\tstatic webkit602BugfixHelper (alpha: number, blend: MixBlend) {\n\t}\n\n\tstatic contains (array: Array, element: T, identity = true) {\n\t\tfor (var i = 0; i < array.length; i++)\n\t\t\tif (array[i] == element) return true;\n\t\treturn false;\n\t}\n\n\tstatic enumValue (type: any, name: string) {\n\t\treturn type[name[0].toUpperCase() + name.slice(1)];\n\t}\n}\n\nexport class DebugUtils {\n\tstatic logBones (skeleton: Skeleton) {\n\t\tfor (let i = 0; i < skeleton.bones.length; i++) {\n\t\t\tlet bone = skeleton.bones[i];\n\t\t\tconsole.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\n\t\t}\n\t}\n}\n\nexport class Pool {\n\tprivate items = new Array();\n\tprivate instantiator: () => T;\n\n\tconstructor (instantiator: () => T) {\n\t\tthis.instantiator = instantiator;\n\t}\n\n\tobtain () {\n\t\treturn this.items.length > 0 ? this.items.pop()! : this.instantiator();\n\t}\n\n\tfree (item: T) {\n\t\tif ((item as any).reset) (item as any).reset();\n\t\tthis.items.push(item);\n\t}\n\n\tfreeAll (items: ArrayLike) {\n\t\tfor (let i = 0; i < items.length; i++)\n\t\t\tthis.free(items[i]);\n\t}\n\n\tclear () {\n\t\tthis.items.length = 0;\n\t}\n}\n\nexport class Vector2 {\n\tconstructor (public x = 0, public y = 0) {\n\t}\n\n\tset (x: number, y: number): Vector2 {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tlength () {\n\t\tlet x = this.x;\n\t\tlet y = this.y;\n\t\treturn Math.sqrt(x * x + y * y);\n\t}\n\n\tnormalize () {\n\t\tlet len = this.length();\n\t\tif (len != 0) {\n\t\t\tthis.x /= len;\n\t\t\tthis.y /= len;\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport class TimeKeeper {\n\tmaxDelta = 0.064;\n\tframesPerSecond = 0;\n\tdelta = 0;\n\ttotalTime = 0;\n\n\tprivate lastTime = Date.now() / 1000;\n\tprivate frameCount = 0;\n\tprivate frameTime = 0;\n\n\tupdate () {\n\t\tlet now = Date.now() / 1000;\n\t\tthis.delta = now - this.lastTime;\n\t\tthis.frameTime += this.delta;\n\t\tthis.totalTime += this.delta;\n\t\tif (this.delta > this.maxDelta) this.delta = this.maxDelta;\n\t\tthis.lastTime = now;\n\n\t\tthis.frameCount++;\n\t\tif (this.frameTime > 1) {\n\t\t\tthis.framesPerSecond = this.frameCount / this.frameTime;\n\t\t\tthis.frameTime = 0;\n\t\t\tthis.frameCount = 0;\n\t\t}\n\t}\n}\n\nexport interface ArrayLike {\n\tlength: number;\n\t[n: number]: T;\n}\n\nexport class WindowedMean {\n\tvalues: Array;\n\taddedValues = 0;\n\tlastValue = 0;\n\tmean = 0;\n\tdirty = true;\n\n\tconstructor (windowSize: number = 32) {\n\t\tthis.values = new Array(windowSize);\n\t}\n\n\thasEnoughData () {\n\t\treturn this.addedValues >= this.values.length;\n\t}\n\n\taddValue (value: number) {\n\t\tif (this.addedValues < this.values.length) this.addedValues++;\n\t\tthis.values[this.lastValue++] = value;\n\t\tif (this.lastValue > this.values.length - 1) this.lastValue = 0;\n\t\tthis.dirty = true;\n\t}\n\n\tgetMean () {\n\t\tif (this.hasEnoughData()) {\n\t\t\tif (this.dirty) {\n\t\t\t\tlet mean = 0;\n\t\t\t\tfor (let i = 0; i < this.values.length; i++)\n\t\t\t\t\tmean += this.values[i];\n\t\t\t\tthis.mean = mean / this.values.length;\n\t\t\t\tthis.dirty = false;\n\t\t\t}\n\t\t\treturn this.mean;\n\t\t}\n\t\treturn 0;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Slot } from \"../Slot.js\";\nimport { NumberArrayLike, Utils } from \"../Utils.js\";\n\n/** The base class for all attachments. */\nexport abstract class Attachment {\n\tname: string;\n\n\tconstructor (name: string) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t}\n\n\tabstract copy (): Attachment;\n}\n\n/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's\n * {@link Slot#deform}. */\nexport abstract class VertexAttachment extends Attachment {\n\tprivate static nextID = 0;\n\n\t/** The unique ID for this attachment. */\n\tid = VertexAttachment.nextID++;\n\n\t/** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting\n\t * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null\n\t * if this attachment has no weights. */\n\tbones: Array | null = null;\n\n\t/** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`\n\t * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting\n\t * each vertex. */\n\tvertices: NumberArrayLike = [];\n\n\t/** The maximum number of world vertex values that can be output by\n\t * {@link #computeWorldVertices()} using the `count` parameter. */\n\tworldVerticesLength = 0;\n\n\t/** Timelines for the timeline attachment are also applied to this attachment.\n\t * May be null if no attachment-specific timelines should be applied. */\n\ttimelineAttachment: Attachment = this;\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\t/** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is\n\t * not empty, it is used to deform the vertices.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide.\n\t * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y.\n\t * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`.\n\t * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *\n\t * `stride` / 2.\n\t * @param offset The `worldVertices` index to begin writing values.\n\t * @param stride The number of `worldVertices` entries between the value pairs written. */\n\tcomputeWorldVertices (slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tcount = offset + (count >> 1) * stride;\n\t\tlet skeleton = slot.bone.skeleton;\n\t\tlet deformArray = slot.deform;\n\t\tlet vertices = this.vertices;\n\t\tlet bones = this.bones;\n\t\tif (!bones) {\n\t\t\tif (deformArray.length > 0) vertices = deformArray;\n\t\t\tlet bone = slot.bone;\n\t\t\tlet x = bone.worldX;\n\t\t\tlet y = bone.worldY;\n\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\tfor (let v = start, w = offset; w < count; v += 2, w += stride) {\n\t\t\t\tlet vx = vertices[v], vy = vertices[v + 1];\n\t\t\t\tworldVertices[w] = vx * a + vy * b + x;\n\t\t\t\tworldVertices[w + 1] = vx * c + vy * d + y;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet v = 0, skip = 0;\n\t\tfor (let i = 0; i < start; i += 2) {\n\t\t\tlet n = bones[v];\n\t\t\tv += n + 1;\n\t\t\tskip += n;\n\t\t}\n\t\tlet skeletonBones = skeleton.bones;\n\t\tif (deformArray.length == 0) {\n\t\t\tfor (let w = offset, b = skip * 3; w < count; w += stride) {\n\t\t\t\tlet wx = 0, wy = 0;\n\t\t\t\tlet n = bones[v++];\n\t\t\t\tn += v;\n\t\t\t\tfor (; v < n; v++, b += 3) {\n\t\t\t\t\tlet bone = skeletonBones[bones[v]];\n\t\t\t\t\tlet vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\n\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n\t\t\t\t}\n\t\t\t\tworldVertices[w] = wx;\n\t\t\t\tworldVertices[w + 1] = wy;\n\t\t\t}\n\t\t} else {\n\t\t\tlet deform = deformArray;\n\t\t\tfor (let w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\n\t\t\t\tlet wx = 0, wy = 0;\n\t\t\t\tlet n = bones[v++];\n\t\t\t\tn += v;\n\t\t\t\tfor (; v < n; v++, b += 3, f += 2) {\n\t\t\t\t\tlet bone = skeletonBones[bones[v]];\n\t\t\t\t\tlet vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\n\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n\t\t\t\t}\n\t\t\t\tworldVertices[w] = wx;\n\t\t\t\tworldVertices[w + 1] = wy;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Does not copy id (generated) or name (set on construction). **/\n\tcopyTo (attachment: VertexAttachment) {\n\t\tif (this.bones) {\n\t\t\tattachment.bones = new Array(this.bones.length);\n\t\t\tUtils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\n\t\t} else\n\t\t\tattachment.bones = null;\n\n\t\tif (this.vertices) {\n\t\t\tattachment.vertices = Utils.newFloatArray(this.vertices.length);\n\t\t\tUtils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\n\t\t}\n\n\t\tattachment.worldVerticesLength = this.worldVerticesLength;\n\t\tattachment.timelineAttachment = this.timelineAttachment;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TextureRegion } from \"../Texture.js\";\nimport { Slot } from \"../Slot.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Utils } from \"../Utils.js\";\n\n\nexport class Sequence {\n\tprivate static _nextID = 0;\n\n\tid = Sequence.nextID();\n\tregions: TextureRegion[];\n\tstart = 0;\n\tdigits = 0;\n\t/** The index of the region to show for the setup pose. */\n\tsetupIndex = 0;\n\n\tconstructor (count: number) {\n\t\tthis.regions = new Array(count);\n\t}\n\n\tcopy (): Sequence {\n\t\tlet copy = new Sequence(this.regions.length);\n\t\tUtils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length);\n\t\tcopy.start = this.start;\n\t\tcopy.digits = this.digits;\n\t\tcopy.setupIndex = this.setupIndex;\n\t\treturn copy;\n\t}\n\n\tapply (slot: Slot, attachment: HasTextureRegion) {\n\t\tlet index = slot.sequenceIndex;\n\t\tif (index == -1) index = this.setupIndex;\n\t\tif (index >= this.regions.length) index = this.regions.length - 1;\n\t\tlet region = this.regions[index];\n\t\tif (attachment.region != region) {\n\t\t\tattachment.region = region;\n\t\t\tattachment.updateRegion();\n\t\t}\n\t}\n\n\tgetPath (basePath: string, index: number): string {\n\t\tlet result = basePath;\n\t\tlet frame = (this.start + index).toString();\n\t\tfor (let i = this.digits - frame.length; i > 0; i--)\n\t\t\tresult += \"0\";\n\t\tresult += frame;\n\t\treturn result;\n\t}\n\n\tprivate static nextID (): number {\n\t\treturn Sequence._nextID++;\n\t}\n}\n\nexport enum SequenceMode {\n\thold = 0,\n\tonce = 1,\n\tloop = 2,\n\tpingpong = 3,\n\tonceReverse = 4,\n\tloopReverse = 5,\n\tpingpongReverse = 6\n}\n\nexport const SequenceModeValues = [\n\tSequenceMode.hold,\n\tSequenceMode.once,\n\tSequenceMode.loop,\n\tSequenceMode.pingpong,\n\tSequenceMode.onceReverse,\n\tSequenceMode.loopReverse,\n\tSequenceMode.pingpongReverse\n];\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { IkConstraint } from \"./IkConstraint.js\";\nimport { PathConstraint } from \"./PathConstraint.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { TransformConstraint } from \"./TransformConstraint.js\";\nimport { StringSet, Utils, MathUtils, NumberArrayLike } from \"./Utils.js\";\nimport { Event } from \"./Event.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { SequenceMode, SequenceModeValues } from \"./attachments/Sequence.js\";\nimport { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Inherit } from \"./BoneData.js\";\n\n/** A simple container for a list of timelines and a name. */\nexport class Animation {\n\t/** The animation's name, which is unique across all animations in the skeleton. */\n\tname: string;\n\ttimelines: Array = [];\n\ttimelineIds: StringSet = new StringSet();\n\n\t/** The duration of the animation in seconds, which is the highest time of all keys in the timeline. */\n\tduration: number;\n\n\tconstructor (name: string, timelines: Array, duration: number) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t\tthis.setTimelines(timelines);\n\t\tthis.duration = duration;\n\t}\n\n\tsetTimelines (timelines: Array) {\n\t\tif (!timelines) throw new Error(\"timelines cannot be null.\");\n\t\tthis.timelines = timelines;\n\t\tthis.timelineIds.clear();\n\t\tfor (var i = 0; i < timelines.length; i++)\n\t\t\tthis.timelineIds.addAll(timelines[i].getPropertyIds());\n\t}\n\n\thasTimeline (ids: string[]): boolean {\n\t\tfor (let i = 0; i < ids.length; i++)\n\t\t\tif (this.timelineIds.contains(ids[i])) return true;\n\t\treturn false;\n\t}\n\n\t/** Applies all the animation's timelines to the specified skeleton.\n\t *\n\t * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\n\t * @param loop If true, the animation repeats after {@link #getDuration()}.\n\t * @param events May be null to ignore fired events. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\n\t\tif (loop && this.duration != 0) {\n\t\t\ttime %= this.duration;\n\t\t\tif (lastTime > 0) lastTime %= this.duration;\n\t\t}\n\n\t\tlet timelines = this.timelines;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\ttimelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\n\t}\n}\n\n/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`\n * < 1.\n *\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */\nexport enum MixBlend {\n\t/** Transitions from the setup value to the timeline value (the current value is not used). Before the first key, the setup\n\t * value is set. */\n\tsetup,\n\t/** Transitions from the current value to the timeline value. Before the first key, transitions from the current value to\n\t * the setup value. Timelines which perform instant transitions, such as {@link DrawOrderTimeline} or\n\t * {@link AttachmentTimeline}, use the setup value before the first key.\n\t *\n\t * `first` is intended for the first animations applied, not for animations layered on top of those. */\n\tfirst,\n\t/** Transitions from the current value to the timeline value. No change is made before the first key (the current value is\n\t * kept until the first key).\n\t *\n\t * `replace` is intended for animations layered on top of others, not for the first animations applied. */\n\treplace,\n\t/** Transitions from the current value to the current value plus the timeline value. No change is made before the first key\n\t * (the current value is kept until the first key).\n\t *\n\t * `add` is intended for animations layered on top of others, not for the first animations applied. Properties\n\t * keyed by additive animations must be set manually or by another animation before applying the additive animations, else\n\t * the property values will increase continually. */\n\tadd\n}\n\n/** Indicates whether a timeline's `alpha` is mixing out over time toward 0 (the setup or current pose value) or\n * mixing in toward 1 (the timeline's value).\n *\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */\nexport enum MixDirection {\n\tmixIn, mixOut\n}\n\nconst Property = {\n\trotate: 0,\n\tx: 1,\n\ty: 2,\n\tscaleX: 3,\n\tscaleY: 4,\n\tshearX: 5,\n\tshearY: 6,\n\tinherit: 7,\n\n\trgb: 8,\n\talpha: 9,\n\trgb2: 10,\n\n\tattachment: 11,\n\tdeform: 12,\n\n\tevent: 13,\n\tdrawOrder: 14,\n\n\tikConstraint: 15,\n\ttransformConstraint: 16,\n\n\tpathConstraintPosition: 17,\n\tpathConstraintSpacing: 18,\n\tpathConstraintMix: 19,\n\n\tphysicsConstraintInertia: 20,\n\tphysicsConstraintStrength: 21,\n\tphysicsConstraintDamping: 22,\n\tphysicsConstraintMass: 23,\n\tphysicsConstraintWind: 24,\n\tphysicsConstraintGravity: 25,\n\tphysicsConstraintMix: 26,\n\tphysicsConstraintReset: 27,\n\n\tsequence: 28,\n}\n\n/** The interface for all timelines. */\nexport abstract class Timeline {\n\tpropertyIds: string[];\n\tframes: NumberArrayLike;\n\n\tconstructor (frameCount: number, propertyIds: string[]) {\n\t\tthis.propertyIds = propertyIds;\n\t\tthis.frames = Utils.newFloatArray(frameCount * this.getFrameEntries());\n\t}\n\n\tgetPropertyIds () {\n\t\treturn this.propertyIds;\n\t}\n\n\tgetFrameEntries (): number {\n\t\treturn 1;\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length / this.getFrameEntries();\n\t}\n\n\tgetDuration (): number {\n\t\treturn this.frames[this.frames.length - this.getFrameEntries()];\n\t}\n\n\tabstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array | null, alpha: number, blend: MixBlend, direction: MixDirection): void;\n\n\tstatic search1 (frames: NumberArrayLike, time: number) {\n\t\tlet n = frames.length;\n\t\tfor (let i = 1; i < n; i++)\n\t\t\tif (frames[i] > time) return i - 1;\n\t\treturn n - 1;\n\t}\n\n\tstatic search (frames: NumberArrayLike, time: number, step: number) {\n\t\tlet n = frames.length;\n\t\tfor (let i = step; i < n; i += step)\n\t\t\tif (frames[i] > time) return i - step;\n\t\treturn n - step;\n\t}\n}\n\nexport interface BoneTimeline {\n\t/** The index of the bone in {@link Skeleton#bones} that will be changed. */\n\tboneIndex: number;\n}\n\nexport interface SlotTimeline {\n\t/** The index of the slot in {@link Skeleton#slots} that will be changed. */\n\tslotIndex: number;\n}\n\n/** The base class for timelines that use interpolation between key frame values. */\nexport abstract class CurveTimeline extends Timeline {\n\tprotected curves: NumberArrayLike; // type, x, y, ...\n\n\tconstructor (frameCount: number, bezierCount: number, propertyIds: string[]) {\n\t\tsuper(frameCount, propertyIds);\n\t\tthis.curves = Utils.newFloatArray(frameCount + bezierCount * 18/*BEZIER_SIZE*/);\n\t\tthis.curves[frameCount - 1] = 1/*STEPPED*/;\n\t}\n\n\t/** Sets the specified key frame to linear interpolation. */\n\tsetLinear (frame: number) {\n\t\tthis.curves[frame] = 0/*LINEAR*/;\n\t}\n\n\t/** Sets the specified key frame to stepped interpolation. */\n\tsetStepped (frame: number) {\n\t\tthis.curves[frame] = 1/*STEPPED*/;\n\t}\n\n\t/** Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger\n\t * than the actual number of Bezier curves. */\n\tshrink (bezierCount: number) {\n\t\tlet size = this.getFrameCount() + bezierCount * 18/*BEZIER_SIZE*/;\n\t\tif (this.curves.length > size) {\n\t\t\tlet newCurves = Utils.newFloatArray(size);\n\t\t\tUtils.arrayCopy(this.curves, 0, newCurves, 0, size);\n\t\t\tthis.curves = newCurves;\n\t\t}\n\t}\n\n\t/** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than\n\t * one curve per frame.\n\t * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified\n\t * in the constructor), inclusive.\n\t * @param frame Between 0 and frameCount - 1, inclusive.\n\t * @param value The index of the value for this frame that this curve is used for.\n\t * @param time1 The time for the first key.\n\t * @param value1 The value for the first key.\n\t * @param cx1 The time for the first Bezier handle.\n\t * @param cy1 The value for the first Bezier handle.\n\t * @param cx2 The time of the second Bezier handle.\n\t * @param cy2 The value for the second Bezier handle.\n\t * @param time2 The time for the second key.\n\t * @param value2 The value for the second key. */\n\tsetBezier (bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number,\n\t\tcy2: number, time2: number, value2: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = this.getFrameCount() + bezier * 18/*BEZIER_SIZE*/;\n\t\tif (value == 0) curves[frame] = 2/*BEZIER*/ + i;\n\t\tlet tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03;\n\t\tlet dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 0.006;\n\t\tlet ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\n\t\tlet dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667;\n\t\tlet x = time1 + dx, y = value1 + dy;\n\t\tfor (let n = i + 18/*BEZIER_SIZE*/; i < n; i += 2) {\n\t\t\tcurves[i] = x;\n\t\t\tcurves[i + 1] = y;\n\t\t\tdx += ddx;\n\t\t\tdy += ddy;\n\t\t\tddx += dddx;\n\t\t\tddy += dddy;\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t}\n\n\t/** Returns the Bezier interpolated value for the specified time.\n\t * @param frameIndex The index into {@link #getFrames()} for the values of the frame before time.\n\t * @param valueOffset The offset from frameIndex to the value this curve is used for.\n\t * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */\n\tgetBezierValue (time: number, frameIndex: number, valueOffset: number, i: number) {\n\t\tlet curves = this.curves;\n\t\tif (curves[i] > time) {\n\t\t\tlet x = this.frames[frameIndex], y = this.frames[frameIndex + valueOffset];\n\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t}\n\t\tlet n = i + 18/*BEZIER_SIZE*/;\n\t\tfor (i += 2; i < n; i += 2) {\n\t\t\tif (curves[i] >= time) {\n\t\t\t\tlet x = curves[i - 2], y = curves[i - 1];\n\t\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t\t}\n\t\t}\n\t\tframeIndex += this.getFrameEntries();\n\t\tlet x = curves[n - 2], y = curves[n - 1];\n\t\treturn y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y);\n\t}\n}\n\nexport abstract class CurveTimeline1 extends CurveTimeline {\n\tconstructor (frameCount: number, bezierCount: number, propertyId: string) {\n\t\tsuper(frameCount, bezierCount, [propertyId]);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 2/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and value for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, value: number) {\n\t\tframe <<= 1;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*VALUE*/] = value;\n\t}\n\n\t/** Returns the interpolated value for the specified time. */\n\tgetCurveValue (time: number) {\n\t\tlet frames = this.frames;\n\t\tlet i = frames.length - 2;\n\t\tfor (let ii = 2; ii <= i; ii += 2) {\n\t\t\tif (frames[ii] > time) {\n\t\t\t\ti = ii - 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tlet curveType = this.curves[i >> 1];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i], value = frames[i + 1/*VALUE*/];\n\t\t\t\treturn value + (time - before) / (frames[i + 2/*ENTRIES*/] - before) * (frames[i + 2/*ENTRIES*/ + 1/*VALUE*/] - value);\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\treturn frames[i + 1/*VALUE*/];\n\t\t}\n\t\treturn this.getBezierValue(time, i, 1/*VALUE*/, curveType - 2/*BEZIER*/);\n\t}\n\n\tgetRelativeValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time);\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\treturn setup + value * alpha;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tvalue += setup - current;\n\t\t}\n\t\treturn current + value * alpha;\n\t}\n\n\tgetAbsoluteValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time);\n\t\tif (blend == MixBlend.setup) return setup + (value - setup) * alpha;\n\t\treturn current + (value - current) * alpha;\n\t}\n\n\tgetAbsoluteValue2 (time: number, alpha: number, blend: MixBlend, current: number, setup: number, value: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tif (blend == MixBlend.setup) return setup + (value - setup) * alpha;\n\t\treturn current + (value - current) * alpha;\n\t}\n\n\tgetScaleValue (time: number, alpha: number, blend: MixBlend, direction: MixDirection, current: number, setup: number) {\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time) * setup;\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) return current + value - setup;\n\t\t\treturn value;\n\t\t}\n\t\t// Mixing out uses sign of setup or current pose, else use sign of key.\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup + (Math.abs(value) * MathUtils.signum(setup) - setup) * alpha;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\treturn current + (Math.abs(value) * MathUtils.signum(current) - current) * alpha;\n\t\t\t}\n\t\t} else {\n\t\t\tlet s = 0;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\ts = Math.abs(setup) * MathUtils.signum(value);\n\t\t\t\t\treturn s + (value - s) * alpha;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\ts = Math.abs(current) * MathUtils.signum(value);\n\t\t\t\t\treturn s + (value - s) * alpha;\n\t\t\t}\n\t\t}\n\t\treturn current + (value - setup) * alpha;\n\t}\n}\n\n/** The base class for a {@link CurveTimeline} which sets two properties. */\nexport abstract class CurveTimeline2 extends CurveTimeline {\n\t/** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}.\n\t * @param propertyIds Unique identifiers for the properties the timeline modifies. */\n\tconstructor (frameCount: number, bezierCount: number, propertyId1: string, propertyId2: string) {\n\t\tsuper(frameCount, bezierCount, [propertyId1, propertyId2]);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 3/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and values for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, value1: number, value2: number) {\n\t\tframe *= 3/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*VALUE1*/] = value1;\n\t\tthis.frames[frame + 2/*VALUE2*/] = value2;\n\t}\n}\n\n/** Changes a bone's local {@link Bone#rotation}. */\nexport class RotateTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.rotate + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array | null, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.rotation = this.getRelativeValue(time, alpha, blend, bone.rotation, bone.data.rotation);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x} and {@link Bone#y}. */\nexport class TranslateTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.x + \"|\" + boneIndex,\n\t\t\tProperty.y + \"|\" + boneIndex,\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.x = bone.data.x;\n\t\t\t\t\tbone.y = bone.data.y;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.x += (bone.data.x - bone.x) * alpha;\n\t\t\t\t\tbone.y += (bone.data.y - bone.y) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = 0, y = 0;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\tbone.x = bone.data.x + x * alpha;\n\t\t\t\tbone.y = bone.data.y + y * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tbone.x += (bone.data.x + x - bone.x) * alpha;\n\t\t\t\tbone.y += (bone.data.y + y - bone.y) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tbone.x += x * alpha;\n\t\t\t\tbone.y += y * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x}. */\nexport class TranslateXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.x + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.x = this.getRelativeValue(time, alpha, blend, bone.x, bone.data.x);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x}. */\nexport class TranslateYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.y + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.y = this.getRelativeValue(time, alpha, blend, bone.y, bone.data.y);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.scaleX + \"|\" + boneIndex,\n\t\t\tProperty.scaleY + \"|\" + boneIndex\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.scaleX = bone.data.scaleX;\n\t\t\t\t\tbone.scaleY = bone.data.scaleY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\n\t\t\t\t\tbone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x, y;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\t\tx *= bone.data.scaleX;\n\t\ty *= bone.data.scaleY;\n\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) {\n\t\t\t\tbone.scaleX += x - bone.data.scaleX;\n\t\t\t\tbone.scaleY += y - bone.data.scaleY;\n\t\t\t} else {\n\t\t\t\tbone.scaleX = x;\n\t\t\t\tbone.scaleY = y;\n\t\t\t}\n\t\t} else {\n\t\t\tlet bx = 0, by = 0;\n\t\t\tif (direction == MixDirection.mixOut) {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\t\tbx = bone.data.scaleX;\n\t\t\t\t\t\tby = bone.data.scaleY;\n\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tbx = bone.scaleX;\n\t\t\t\t\t\tby = bone.scaleY;\n\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tbone.scaleX += (x - bone.data.scaleX) * alpha;\n\t\t\t\t\t\tbone.scaleY += (y - bone.data.scaleY) * alpha;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\t\tbx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\n\t\t\t\t\t\tby = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\n\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tbx = Math.abs(bone.scaleX) * MathUtils.signum(x);\n\t\t\t\t\t\tby = Math.abs(bone.scaleY) * MathUtils.signum(y);\n\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tbone.scaleX += (x - bone.data.scaleX) * alpha;\n\t\t\t\t\t\tbone.scaleY += (y - bone.data.scaleY) * alpha;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.scaleX + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.scaleX = this.getScaleValue(time, alpha, blend, direction, bone.scaleX, bone.data.scaleX);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.scaleY + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.scaleY, bone.data.scaleY);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.shearX + \"|\" + boneIndex,\n\t\t\tProperty.shearY + \"|\" + boneIndex\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.shearX = bone.data.shearX;\n\t\t\t\t\tbone.shearY = bone.data.shearY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.shearX += (bone.data.shearX - bone.shearX) * alpha;\n\t\t\t\t\tbone.shearY += (bone.data.shearY - bone.shearY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = 0, y = 0;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\tbone.shearX = bone.data.shearX + x * alpha;\n\t\t\t\tbone.shearY = bone.data.shearY + y * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tbone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\n\t\t\t\tbone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tbone.shearX += x * alpha;\n\t\t\t\tbone.shearY += y * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.shearX + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.shearX = this.getRelativeValue(time, alpha, blend, bone.shearX, bone.data.shearX);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.shearY + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.shearY = this.getRelativeValue(time, alpha, blend, bone.shearY, bone.data.shearY);\n\t}\n}\n\nexport class InheritTimeline extends Timeline implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, boneIndex: number) {\n\t\tsuper(frameCount, [Property.inherit + \"|\" + boneIndex]);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tpublic getFrameEntries () {\n\t\treturn 2/*ENTRIES*/;\n\t}\n\n\t/** Sets the transform mode for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tpublic setFrame (frame: number, time: number, inherit: Inherit) {\n\t\tframe *= 2/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*INHERIT*/] = inherit;\n\t}\n\n\tpublic apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) bone.inherit = bone.data.inherit;\n\t\t\treturn;\n\t\t}\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) bone.inherit = bone.data.inherit;\n\t\t\treturn;\n\t\t}\n\t\tbone.inherit = this.frames[Timeline.search(frames, time, 2/*ENTRIES*/) + 1/*INHERIT*/];\n\t}\n}\n\n/** Changes a slot's {@link Slot#color}. */\nexport class RGBATimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.alpha + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 5/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, a: number) {\n\t\tframe *= 5/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*A*/] = a;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet color = slot.color;\n\t\tif (time < frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.setFromColor(setup);\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha,\n\t\t\t\t\t\t(setup.a - color.a) * alpha);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0;\n\t\tlet i = Timeline.search(frames, time, 5/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 5/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 5/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 5/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 5/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 5/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\ta += (frames[i + 5/*ENTRIES*/ + 4/*A*/] - a) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\ta = this.getBezierValue(time, i, 4/*A*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t}\n\t\tif (alpha == 1)\n\t\t\tcolor.set(r, g, b, a);\n\t\telse {\n\t\t\tif (blend == MixBlend.setup) color.setFromColor(slot.data.color);\n\t\t\tcolor.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color}. */\nexport class RGBTimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 4/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number) {\n\t\tframe <<= 2;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet color = slot.color;\n\t\tif (time < frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.r = setup.r;\n\t\t\t\t\tcolor.g = setup.g;\n\t\t\t\t\tcolor.b = setup.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.r += (setup.r - color.r) * alpha;\n\t\t\t\t\tcolor.g += (setup.g - color.g) * alpha;\n\t\t\t\t\tcolor.b += (setup.b - color.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0;\n\t\tlet i = Timeline.search(frames, time, 4/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 2];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 4/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 4/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 4/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 4/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t}\n\t\tif (alpha == 1) {\n\t\t\tcolor.r = r;\n\t\t\tcolor.g = g;\n\t\t\tcolor.b = b;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlet setup = slot.data.color;\n\t\t\t\tcolor.r = setup.r;\n\t\t\t\tcolor.g = setup.g;\n\t\t\t\tcolor.b = setup.b;\n\t\t\t}\n\t\t\tcolor.r += (r - color.r) * alpha;\n\t\t\tcolor.g += (g - color.g) * alpha;\n\t\t\tcolor.b += (b - color.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class AlphaTimeline extends CurveTimeline1 implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.alpha + \"|\" + slotIndex);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet color = slot.color;\n\t\tif (time < this.frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.a = setup.a;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.a += (setup.a - color.a) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet a = this.getCurveValue(time);\n\t\tif (alpha == 1)\n\t\t\tcolor.a = a;\n\t\telse {\n\t\t\tif (blend == MixBlend.setup) color.a = slot.data.color.a;\n\t\t\tcolor.a += (a - color.a) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */\nexport class RGBA2Timeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.alpha + \"|\" + slotIndex,\n\t\t\tProperty.rgb2 + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 8/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, light, and dark colors for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number) {\n\t\tframe <<= 3;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*A*/] = a;\n\t\tthis.frames[frame + 5/*R2*/] = r2;\n\t\tthis.frames[frame + 6/*G2*/] = g2;\n\t\tthis.frames[frame + 7/*B2*/] = b2;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet light = slot.color, dark = slot.darkColor!;\n\t\tif (time < frames[0]) {\n\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tlight.setFromColor(setupLight);\n\t\t\t\t\tdark.r = setupDark.r;\n\t\t\t\t\tdark.g = setupDark.g;\n\t\t\t\t\tdark.b = setupDark.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tlight.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha,\n\t\t\t\t\t\t(setupLight.a - light.a) * alpha);\n\t\t\t\t\tdark.r += (setupDark.r - dark.r) * alpha;\n\t\t\t\t\tdark.g += (setupDark.g - dark.g) * alpha;\n\t\t\t\t\tdark.b += (setupDark.b - dark.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\n\t\tlet i = Timeline.search(frames, time, 8/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 3];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tr2 = frames[i + 5/*R2*/];\n\t\t\t\tg2 = frames[i + 6/*G2*/];\n\t\t\t\tb2 = frames[i + 7/*B2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 8/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 8/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 8/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 8/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\ta += (frames[i + 8/*ENTRIES*/ + 4/*A*/] - a) * t;\n\t\t\t\tr2 += (frames[i + 8/*ENTRIES*/ + 5/*R2*/] - r2) * t;\n\t\t\t\tg2 += (frames[i + 8/*ENTRIES*/ + 6/*G2*/] - g2) * t;\n\t\t\t\tb2 += (frames[i + 8/*ENTRIES*/ + 7/*B2*/] - b2) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tr2 = frames[i + 5/*R2*/];\n\t\t\t\tg2 = frames[i + 6/*G2*/];\n\t\t\t\tb2 = frames[i + 7/*B2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\ta = this.getBezierValue(time, i, 4/*A*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tr2 = this.getBezierValue(time, i, 5/*R2*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tg2 = this.getBezierValue(time, i, 6/*G2*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t\t\tb2 = this.getBezierValue(time, i, 7/*B2*/, curveType + 18/*BEZIER_SIZE*/ * 6 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (alpha == 1) {\n\t\t\tlight.set(r, g, b, a);\n\t\t\tdark.r = r2;\n\t\t\tdark.g = g2;\n\t\t\tdark.b = b2;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlight.setFromColor(slot.data.color);\n\t\t\t\tlet setupDark = slot.data.darkColor!;\n\t\t\t\tdark.r = setupDark.r;\n\t\t\t\tdark.g = setupDark.g;\n\t\t\t\tdark.b = setupDark.b;\n\t\t\t}\n\t\t\tlight.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\n\t\t\tdark.r += (r2 - dark.r) * alpha;\n\t\t\tdark.g += (g2 - dark.g) * alpha;\n\t\t\tdark.b += (b2 - dark.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */\nexport class RGB2Timeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.rgb2 + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 7/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, light, and dark colors for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, r2: number, g2: number, b2: number) {\n\t\tframe *= 7/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*R2*/] = r2;\n\t\tthis.frames[frame + 5/*G2*/] = g2;\n\t\tthis.frames[frame + 6/*B2*/] = b2;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet light = slot.color, dark = slot.darkColor!;\n\t\tif (time < frames[0]) {\n\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tlight.r = setupLight.r;\n\t\t\t\t\tlight.g = setupLight.g;\n\t\t\t\t\tlight.b = setupLight.b;\n\t\t\t\t\tdark.r = setupDark.r;\n\t\t\t\t\tdark.g = setupDark.g;\n\t\t\t\t\tdark.b = setupDark.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tlight.r += (setupLight.r - light.r) * alpha;\n\t\t\t\t\tlight.g += (setupLight.g - light.g) * alpha;\n\t\t\t\t\tlight.b += (setupLight.b - light.b) * alpha;\n\t\t\t\t\tdark.r += (setupDark.r - dark.r) * alpha;\n\t\t\t\t\tdark.g += (setupDark.g - dark.g) * alpha;\n\t\t\t\t\tdark.b += (setupDark.b - dark.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\n\t\tlet i = Timeline.search(frames, time, 7/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 7/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tr2 = frames[i + 4/*R2*/];\n\t\t\t\tg2 = frames[i + 5/*G2*/];\n\t\t\t\tb2 = frames[i + 6/*B2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 7/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 7/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 7/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 7/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\tr2 += (frames[i + 7/*ENTRIES*/ + 4/*R2*/] - r2) * t;\n\t\t\t\tg2 += (frames[i + 7/*ENTRIES*/ + 5/*G2*/] - g2) * t;\n\t\t\t\tb2 += (frames[i + 7/*ENTRIES*/ + 6/*B2*/] - b2) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tr2 = frames[i + 4/*R2*/];\n\t\t\t\tg2 = frames[i + 5/*G2*/];\n\t\t\t\tb2 = frames[i + 6/*B2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\tr2 = this.getBezierValue(time, i, 4/*R2*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tg2 = this.getBezierValue(time, i, 5/*G2*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tb2 = this.getBezierValue(time, i, 6/*B2*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (alpha == 1) {\n\t\t\tlight.r = r;\n\t\t\tlight.g = g;\n\t\t\tlight.b = b;\n\t\t\tdark.r = r2;\n\t\t\tdark.g = g2;\n\t\t\tdark.b = b2;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\t\tlight.r = setupLight.r;\n\t\t\t\tlight.g = setupLight.g;\n\t\t\t\tlight.b = setupLight.b;\n\t\t\t\tdark.r = setupDark.r;\n\t\t\t\tdark.g = setupDark.g;\n\t\t\t\tdark.b = setupDark.b;\n\t\t\t}\n\t\t\tlight.r += (r - light.r) * alpha;\n\t\t\tlight.g += (g - light.g) * alpha;\n\t\t\tlight.b += (b - light.b) * alpha;\n\t\t\tdark.r += (r2 - dark.r) * alpha;\n\t\t\tdark.g += (g2 - dark.g) * alpha;\n\t\t\tdark.b += (b2 - dark.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#attachment}. */\nexport class AttachmentTimeline extends Timeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\t/** The attachment name for each key frame. May contain null values to clear the attachment. */\n\tattachmentNames: Array;\n\n\tconstructor (frameCount: number, slotIndex: number) {\n\t\tsuper(frameCount, [\n\t\t\tProperty.attachment + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachmentNames = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the attachment name for the specified key frame. */\n\tsetFrame (frame: number, time: number, attachmentName: string | null) {\n\t\tthis.frames[frame] = time;\n\t\tthis.attachmentNames[frame] = attachmentName;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) this.setAttachment(skeleton, slot, slot.data.attachmentName);\n\t\t\treturn;\n\t\t}\n\n\t\tif (time < this.frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) this.setAttachment(skeleton, slot, slot.data.attachmentName);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setAttachment(skeleton, slot, this.attachmentNames[Timeline.search1(this.frames, time)]);\n\t}\n\n\tsetAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string | null) {\n\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\n\t}\n}\n\n/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}. */\nexport class DeformTimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\t/** The attachment that will be deformed. */\n\tattachment: VertexAttachment;\n\n\t/** The vertices for each key frame. */\n\tvertices: Array;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number, attachment: VertexAttachment) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.deform + \"|\" + slotIndex + \"|\" + attachment.id\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachment = attachment;\n\t\tthis.vertices = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the vertices for the specified key frame.\n\t * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */\n\tsetFrame (frame: number, time: number, vertices: NumberArrayLike) {\n\t\tthis.frames[frame] = time;\n\t\tthis.vertices[frame] = vertices;\n\t}\n\n\t/** @param value1 Ignored (0 is used for a deform timeline).\n\t * @param value2 Ignored (1 is used for a deform timeline). */\n\tsetBezier (bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number,\n\t\tcy2: number, time2: number, value2: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = this.getFrameCount() + bezier * 18/*BEZIER_SIZE*/;\n\t\tif (value == 0) curves[frame] = 2/*BEZIER*/ + i;\n\t\tlet tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06;\n\t\tlet dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = (cy1 - cy2 + 0.33333333) * 0.018;\n\t\tlet ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\n\t\tlet dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667;\n\t\tlet x = time1 + dx, y = dy;\n\t\tfor (let n = i + 18/*BEZIER_SIZE*/; i < n; i += 2) {\n\t\t\tcurves[i] = x;\n\t\t\tcurves[i + 1] = y;\n\t\t\tdx += ddx;\n\t\t\tdy += ddy;\n\t\t\tddx += dddx;\n\t\t\tddy += dddy;\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t}\n\n\tgetCurvePercent (time: number, frame: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = curves[frame];\n\t\tswitch (i) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet x = this.frames[frame];\n\t\t\t\treturn (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\treturn 0;\n\t\t}\n\t\ti -= 2/*BEZIER*/;\n\t\tif (curves[i] > time) {\n\t\t\tlet x = this.frames[frame];\n\t\t\treturn curves[i + 1] * (time - x) / (curves[i] - x);\n\t\t}\n\t\tlet n = i + 18/*BEZIER_SIZE*/;\n\t\tfor (i += 2; i < n; i += 2) {\n\t\t\tif (curves[i] >= time) {\n\t\t\t\tlet x = curves[i - 2], y = curves[i - 1];\n\t\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t\t}\n\t\t}\n\t\tlet x = curves[n - 2], y = curves[n - 1];\n\t\treturn y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot: Slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\t\tlet slotAttachment: Attachment | null = slot.getAttachment();\n\t\tif (!slotAttachment) return;\n\t\tif (!(slotAttachment instanceof VertexAttachment) || (slotAttachment).timelineAttachment != this.attachment) return;\n\n\t\tlet deform: Array = slot.deform;\n\t\tif (deform.length == 0) blend = MixBlend.setup;\n\n\t\tlet vertices = this.vertices;\n\t\tlet vertexCount = vertices[0].length;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tdeform.length = 0;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tif (alpha == 1) {\n\t\t\t\t\t\tdeform.length = 0;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tdeform.length = vertexCount;\n\t\t\t\t\tlet vertexAttachment = slotAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += (setupVertices[i] - deform[i]) * alpha;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets.\n\t\t\t\t\t\talpha = 1 - alpha;\n\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] *= alpha;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tdeform.length = vertexCount;\n\t\tif (time >= frames[frames.length - 1]) {\n\t\t\tlet lastVertices = vertices[frames.length - 1];\n\t\t\tif (alpha == 1) {\n\t\t\t\tif (blend == MixBlend.add) {\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += lastVertices[i] - setupVertices[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += lastVertices[i];\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\tUtils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\n\t\t\t} else {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup: {\n\t\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\t\tlet setup = setupVertices[i];\n\t\t\t\t\t\t\t\tdeform[i] = setup + (lastVertices[i] - setup) * alpha;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] = lastVertices[i] * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += (lastVertices[i] - deform[i]) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] += (lastVertices[i] - setupVertices[i]) * alpha;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] += lastVertices[i] * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Interpolate between the previous frame and the current frame.\n\t\tlet frame = Timeline.search1(frames, time);\n\t\tlet percent = this.getCurvePercent(time, frame);\n\t\tlet prevVertices = vertices[frame];\n\t\tlet nextVertices = vertices[frame + 1];\n\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) {\n\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += prev + (nextVertices[i] - prev) * percent;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\tdeform[i] = prev + (nextVertices[i] - prev) * percent;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: {\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i], setup = setupVertices[i];\n\t\t\t\t\t\t\tdeform[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent - deform[i]) * alpha;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase MixBlend.add:\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Fires an {@link Event} when specific animation times are reached. */\nexport class EventTimeline extends Timeline {\n\tstatic propertyIds = [\"\" + Property.event];\n\n\t/** The event for each key frame. */\n\tevents: Array;\n\n\tconstructor (frameCount: number) {\n\t\tsuper(frameCount, EventTimeline.propertyIds);\n\n\t\tthis.events = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the event for the specified key frame. */\n\tsetFrame (frame: number, event: Event) {\n\t\tthis.frames[frame] = event.time;\n\t\tthis.events[frame] = event;\n\t}\n\n\t/** Fires events for frames > `lastTime` and <= `time`. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (!firedEvents) return;\n\n\t\tlet frames = this.frames;\n\t\tlet frameCount = this.frames.length;\n\n\t\tif (lastTime > time) { // Apply after lastTime for looped animations.\n\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\n\t\t\tlastTime = -1;\n\t\t} else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\n\t\t\treturn;\n\t\tif (time < frames[0]) return;\n\n\t\tlet i = 0;\n\t\tif (lastTime < frames[0])\n\t\t\ti = 0;\n\t\telse {\n\t\t\ti = Timeline.search1(frames, lastTime) + 1;\n\t\t\tlet frameTime = frames[i];\n\t\t\twhile (i > 0) { // Fire multiple events with the same frame.\n\t\t\t\tif (frames[i - 1] != frameTime) break;\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tfor (; i < frameCount && time >= frames[i]; i++)\n\t\t\tfiredEvents.push(this.events[i]);\n\t}\n}\n\n/** Changes a skeleton's {@link Skeleton#drawOrder}. */\nexport class DrawOrderTimeline extends Timeline {\n\tstatic propertyIds = [\"\" + Property.drawOrder];\n\n\t/** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */\n\tdrawOrders: Array | null>;\n\n\tconstructor (frameCount: number) {\n\t\tsuper(frameCount, DrawOrderTimeline.propertyIds);\n\t\tthis.drawOrders = new Array | null>(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the draw order for the specified key frame.\n\t * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose\n\t * draw order. */\n\tsetFrame (frame: number, time: number, drawOrder: Array | null) {\n\t\tthis.frames[frame] = time;\n\t\tthis.drawOrders[frame] = drawOrder;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\t\treturn;\n\t\t}\n\n\t\tif (time < this.frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\t\treturn;\n\t\t}\n\n\t\tlet idx = Timeline.search1(this.frames, time);\n\t\tlet drawOrderToSetupIndex = this.drawOrders[idx];\n\t\tif (!drawOrderToSetupIndex)\n\t\t\tUtils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\telse {\n\t\t\tlet drawOrder: Array = skeleton.drawOrder;\n\t\t\tlet slots: Array = skeleton.slots;\n\t\t\tfor (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\n\t\t\t\tdrawOrder[i] = slots[drawOrderToSetupIndex[i]];\n\t\t}\n\t}\n}\n\n/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},\n * {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */\nexport class IkConstraintTimeline extends CurveTimeline {\n\t/** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is applied */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, ikConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.ikConstraint + \"|\" + ikConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = ikConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 6/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */\n\tsetFrame (frame: number, time: number, mix: number, softness: number, bendDirection: number, compress: boolean, stretch: boolean) {\n\t\tframe *= 6/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*MIX*/] = mix;\n\t\tthis.frames[frame + 2/*SOFTNESS*/] = softness;\n\t\tthis.frames[frame + 3/*BEND_DIRECTION*/] = bendDirection;\n\t\tthis.frames[frame + 4/*COMPRESS*/] = compress ? 1 : 0;\n\t\tthis.frames[frame + 5/*STRETCH*/] = stretch ? 1 : 0;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: IkConstraint = skeleton.ikConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mix = constraint.data.mix;\n\t\t\t\t\tconstraint.softness = constraint.data.softness;\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mix += (constraint.data.mix - constraint.mix) * alpha;\n\t\t\t\t\tconstraint.softness += (constraint.data.softness - constraint.softness) * alpha;\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet mix = 0, softness = 0;\n\t\tlet i = Timeline.search(frames, time, 6/*ENTRIES*/)\n\t\tlet curveType = this.curves[i / 6/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tmix = frames[i + 1/*MIX*/];\n\t\t\t\tsoftness = frames[i + 2/*SOFTNESS*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 6/*ENTRIES*/] - before);\n\t\t\t\tmix += (frames[i + 6/*ENTRIES*/ + 1/*MIX*/] - mix) * t;\n\t\t\t\tsoftness += (frames[i + 6/*ENTRIES*/ + 2/*SOFTNESS*/] - softness) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tmix = frames[i + 1/*MIX*/];\n\t\t\t\tsoftness = frames[i + 2/*SOFTNESS*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmix = this.getBezierValue(time, i, 1/*MIX*/, curveType - 2/*BEZIER*/);\n\t\t\t\tsoftness = this.getBezierValue(time, i, 2/*SOFTNESS*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tconstraint.mix = constraint.data.mix + (mix - constraint.data.mix) * alpha;\n\t\t\tconstraint.softness = constraint.data.softness + (softness - constraint.data.softness) * alpha;\n\n\t\t\tif (direction == MixDirection.mixOut) {\n\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t} else {\n\t\t\t\tconstraint.bendDirection = frames[i + 3/*BEND_DIRECTION*/];\n\t\t\t\tconstraint.compress = frames[i + 4/*COMPRESS*/] != 0;\n\t\t\t\tconstraint.stretch = frames[i + 5/*STRETCH*/] != 0;\n\t\t\t}\n\t\t} else {\n\t\t\tconstraint.mix += (mix - constraint.mix) * alpha;\n\t\t\tconstraint.softness += (softness - constraint.softness) * alpha;\n\t\t\tif (direction == MixDirection.mixIn) {\n\t\t\t\tconstraint.bendDirection = frames[i + 3/*BEND_DIRECTION*/];\n\t\t\t\tconstraint.compress = frames[i + 4/*COMPRESS*/] != 0;\n\t\t\t\tconstraint.stretch = frames[i + 5/*STRETCH*/] != 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},\n * {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}. */\nexport class TransformConstraintTimeline extends CurveTimeline {\n\t/** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, transformConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.transformConstraint + \"|\" + transformConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = transformConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 7/*ENTRIES*/;\n\t}\n\n\t/** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */\n\tsetFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number, mixScaleX: number, mixScaleY: number,\n\t\tmixShearY: number) {\n\t\tlet frames = this.frames;\n\t\tframe *= 7/*ENTRIES*/;\n\t\tframes[frame] = time;\n\t\tframes[frame + 1/*ROTATE*/] = mixRotate;\n\t\tframes[frame + 2/*X*/] = mixX;\n\t\tframes[frame + 3/*Y*/] = mixY;\n\t\tframes[frame + 4/*SCALEX*/] = mixScaleX;\n\t\tframes[frame + 5/*SCALEY*/] = mixScaleY;\n\t\tframes[frame + 6/*SHEARY*/] = mixShearY;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: TransformConstraint = skeleton.transformConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tlet data = constraint.data;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mixRotate = data.mixRotate;\n\t\t\t\t\tconstraint.mixX = data.mixX;\n\t\t\t\t\tconstraint.mixY = data.mixY;\n\t\t\t\t\tconstraint.mixScaleX = data.mixScaleX;\n\t\t\t\t\tconstraint.mixScaleY = data.mixScaleY;\n\t\t\t\t\tconstraint.mixShearY = data.mixShearY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mixRotate += (data.mixRotate - constraint.mixRotate) * alpha;\n\t\t\t\t\tconstraint.mixX += (data.mixX - constraint.mixX) * alpha;\n\t\t\t\t\tconstraint.mixY += (data.mixY - constraint.mixY) * alpha;\n\t\t\t\t\tconstraint.mixScaleX += (data.mixScaleX - constraint.mixScaleX) * alpha;\n\t\t\t\t\tconstraint.mixScaleY += (data.mixScaleY - constraint.mixScaleY) * alpha;\n\t\t\t\t\tconstraint.mixShearY += (data.mixShearY - constraint.mixShearY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet rotate, x, y, scaleX, scaleY, shearY;\n\t\tlet i = Timeline.search(frames, time, 7/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 7/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tscaleX = frames[i + 4/*SCALEX*/];\n\t\t\t\tscaleY = frames[i + 5/*SCALEY*/];\n\t\t\t\tshearY = frames[i + 6/*SHEARY*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 7/*ENTRIES*/] - before);\n\t\t\t\trotate += (frames[i + 7/*ENTRIES*/ + 1/*ROTATE*/] - rotate) * t;\n\t\t\t\tx += (frames[i + 7/*ENTRIES*/ + 2/*X*/] - x) * t;\n\t\t\t\ty += (frames[i + 7/*ENTRIES*/ + 3/*Y*/] - y) * t;\n\t\t\t\tscaleX += (frames[i + 7/*ENTRIES*/ + 4/*SCALEX*/] - scaleX) * t;\n\t\t\t\tscaleY += (frames[i + 7/*ENTRIES*/ + 5/*SCALEY*/] - scaleY) * t;\n\t\t\t\tshearY += (frames[i + 7/*ENTRIES*/ + 6/*SHEARY*/] - shearY) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tscaleX = frames[i + 4/*SCALEX*/];\n\t\t\t\tscaleY = frames[i + 5/*SCALEY*/];\n\t\t\t\tshearY = frames[i + 6/*SHEARY*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\trotate = this.getBezierValue(time, i, 1/*ROTATE*/, curveType - 2/*BEZIER*/);\n\t\t\t\tx = this.getBezierValue(time, i, 2/*X*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 3/*Y*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\tscaleX = this.getBezierValue(time, i, 4/*SCALEX*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tscaleY = this.getBezierValue(time, i, 5/*SCALEY*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tshearY = this.getBezierValue(time, i, 6/*SHEARY*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tlet data = constraint.data;\n\t\t\tconstraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\n\t\t\tconstraint.mixX = data.mixX + (x - data.mixX) * alpha;\n\t\t\tconstraint.mixY = data.mixY + (y - data.mixY) * alpha;\n\t\t\tconstraint.mixScaleX = data.mixScaleX + (scaleX - data.mixScaleX) * alpha;\n\t\t\tconstraint.mixScaleY = data.mixScaleY + (scaleY - data.mixScaleY) * alpha;\n\t\t\tconstraint.mixShearY = data.mixShearY + (shearY - data.mixShearY) * alpha;\n\t\t} else {\n\t\t\tconstraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\n\t\t\tconstraint.mixX += (x - constraint.mixX) * alpha;\n\t\t\tconstraint.mixY += (y - constraint.mixY) * alpha;\n\t\t\tconstraint.mixScaleX += (scaleX - constraint.mixScaleX) * alpha;\n\t\t\tconstraint.mixScaleY += (scaleY - constraint.mixScaleY) * alpha;\n\t\t\tconstraint.mixShearY += (shearY - constraint.mixShearY) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a path constraint's {@link PathConstraint#position}. */\nexport class PathConstraintPositionTimeline extends CurveTimeline1 {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.pathConstraintPosition + \"|\" + pathConstraintIndex);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (constraint.active)\n\t\t\tconstraint.position = this.getAbsoluteValue(time, alpha, blend, constraint.position, constraint.data.position);\n\t}\n}\n\n/** Changes a path constraint's {@link PathConstraint#spacing}. */\nexport class PathConstraintSpacingTimeline extends CurveTimeline1 {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.pathConstraintSpacing + \"|\" + pathConstraintIndex);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (constraint.active)\n\t\t\tconstraint.spacing = this.getAbsoluteValue(time, alpha, blend, constraint.spacing, constraint.data.spacing);\n\t}\n}\n\n/** Changes a transform constraint's {@link PathConstraint#getMixRotate()}, {@link PathConstraint#getMixX()}, and\n * {@link PathConstraint#getMixY()}. */\nexport class PathConstraintMixTimeline extends CurveTimeline {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.pathConstraintMix + \"|\" + pathConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 4/*ENTRIES*/;\n\t}\n\n\tsetFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number) {\n\t\tlet frames = this.frames;\n\t\tframe <<= 2;\n\t\tframes[frame] = time;\n\t\tframes[frame + 1/*ROTATE*/] = mixRotate;\n\t\tframes[frame + 2/*X*/] = mixX;\n\t\tframes[frame + 3/*Y*/] = mixY;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mixRotate = constraint.data.mixRotate;\n\t\t\t\t\tconstraint.mixX = constraint.data.mixX;\n\t\t\t\t\tconstraint.mixY = constraint.data.mixY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mixRotate += (constraint.data.mixRotate - constraint.mixRotate) * alpha;\n\t\t\t\t\tconstraint.mixX += (constraint.data.mixX - constraint.mixX) * alpha;\n\t\t\t\t\tconstraint.mixY += (constraint.data.mixY - constraint.mixY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet rotate, x, y;\n\t\tlet i = Timeline.search(frames, time, 4/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 2];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 4/*ENTRIES*/] - before);\n\t\t\t\trotate += (frames[i + 4/*ENTRIES*/ + 1/*ROTATE*/] - rotate) * t;\n\t\t\t\tx += (frames[i + 4/*ENTRIES*/ + 2/*X*/] - x) * t;\n\t\t\t\ty += (frames[i + 4/*ENTRIES*/ + 3/*Y*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\trotate = this.getBezierValue(time, i, 1/*ROTATE*/, curveType - 2/*BEZIER*/);\n\t\t\t\tx = this.getBezierValue(time, i, 2/*X*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 3/*Y*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tlet data = constraint.data;\n\t\t\tconstraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\n\t\t\tconstraint.mixX = data.mixX + (x - data.mixX) * alpha;\n\t\t\tconstraint.mixY = data.mixY + (y - data.mixY) * alpha;\n\t\t} else {\n\t\t\tconstraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\n\t\t\tconstraint.mixX += (x - constraint.mixX) * alpha;\n\t\t\tconstraint.mixY += (y - constraint.mixY) * alpha;\n\t\t}\n\t}\n}\n\n/** The base class for most {@link PhysicsConstraint} timelines. */\nexport abstract class PhysicsConstraintTimeline extends CurveTimeline1 {\n\t/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be changed when this timeline\n\t * is applied, or -1 if all physics constraints in the skeleton will be changed. */\n\tconstraintIndex = 0;\n\n\t/** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {\n\t\tsuper(frameCount, bezierCount, property + \"|\" + physicsConstraintIndex);\n\t\tthis.constraintIndex = physicsConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PhysicsConstraint;\n\t\tif (this.constraintIndex == -1) {\n\t\t\tconst value = time >= this.frames[0] ? this.getCurveValue(time) : 0;\n\n\t\t\tfor (const constraint of skeleton.physicsConstraints) {\n\t\t\t\tif (constraint.active && this.global(constraint.data))\n\t\t\t\t\tthis.set(constraint, this.getAbsoluteValue2(time, alpha, blend, this.get(constraint), this.setup(constraint), value));\n\t\t\t}\n\t\t} else {\n\t\t\tconstraint = skeleton.physicsConstraints[this.constraintIndex];\n\t\t\tif (constraint.active) this.set(constraint, this.getAbsoluteValue(time, alpha, blend, this.get(constraint), this.setup(constraint)));\n\t\t}\n\t}\n\n\tabstract setup (constraint: PhysicsConstraint): number;\n\n\tabstract get (constraint: PhysicsConstraint): number;\n\n\tabstract set (constraint: PhysicsConstraint, value: number): void;\n\n\tabstract global (constraint: PhysicsConstraintData): boolean;\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getInertia()}. */\nexport class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.inertia;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.inertia;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.inertia = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.inertiaGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getStrength()}. */\nexport class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.strength;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.strength;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.strength = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.strengthGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getDamping()}. */\nexport class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.damping;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.damping;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.damping = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.dampingGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getMassInverse()}. The timeline values are not inverted. */\nexport class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn 1 / constraint.data.massInverse;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn 1 / constraint.massInverse;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.massInverse = 1 / value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.massGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getWind()}. */\nexport class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.wind;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.wind;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.wind = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.windGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getGravity()}. */\nexport class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.gravity;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.gravity;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.gravity = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.gravityGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getMix()}. */\nexport class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.mix;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.mix;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.mix = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.mixGlobal;\n\t}\n}\n\n/** Resets a physics constraint when specific animation times are reached. */\nexport class PhysicsConstraintResetTimeline extends Timeline {\n\tprivate static propertyIds: string[] = [Property.physicsConstraintReset.toString()];\n\n\t/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be reset when this timeline is\n\t* applied, or -1 if all physics constraints in the skeleton will be reset. */\n\tconstraintIndex: number;\n\n\t/** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */\n\tconstructor (frameCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, PhysicsConstraintResetTimeline.propertyIds);\n\t\tthis.constraintIndex = physicsConstraintIndex;\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive. */\n\tsetFrame (frame: number, time: number) {\n\t\tthis.frames[frame] = time;\n\t}\n\n\t/** Resets the physics constraint when frames > lastTime and <= time. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\n\t\tlet constraint: PhysicsConstraint | undefined;\n\t\tif (this.constraintIndex != -1) {\n\t\t\tconstraint = skeleton.physicsConstraints[this.constraintIndex];\n\t\t\tif (!constraint.active) return;\n\t\t}\n\n\t\tconst frames = this.frames;\n\n\t\tif (lastTime > time) { // Apply after lastTime for looped animations.\n\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, [], alpha, blend, direction);\n\t\t\tlastTime = -1;\n\t\t} else if (lastTime >= frames[frames.length - 1]) // Last time is after last frame.\n\t\t\treturn;\n\t\tif (time < frames[0]) return;\n\n\t\tif (lastTime < frames[0] || time >= frames[Timeline.search1(frames, lastTime) + 1]) {\n\t\t\tif (constraint != null)\n\t\t\t\tconstraint.reset();\n\t\t\telse {\n\t\t\t\tfor (const constraint of skeleton.physicsConstraints) {\n\t\t\t\t\tif (constraint.active) constraint.reset();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */\nexport class SequenceTimeline extends Timeline implements SlotTimeline {\n\tstatic ENTRIES = 3;\n\tstatic MODE = 1;\n\tstatic DELAY = 2;\n\n\tslotIndex: number;\n\tattachment: HasTextureRegion;\n\n\tconstructor (frameCount: number, slotIndex: number, attachment: HasTextureRegion) {\n\t\tsuper(frameCount, [\n\t\t\tProperty.sequence + \"|\" + slotIndex + \"|\" + attachment.sequence!.id\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachment = attachment;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn SequenceTimeline.ENTRIES;\n\t}\n\n\tgetSlotIndex () {\n\t\treturn this.slotIndex;\n\t}\n\n\tgetAttachment () {\n\t\treturn this.attachment as unknown as Attachment;\n\t}\n\n\t/** Sets the time, mode, index, and frame time for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time Seconds between frames. */\n\tsetFrame (frame: number, time: number, mode: SequenceMode, index: number, delay: number) {\n\t\tlet frames = this.frames;\n\t\tframe *= SequenceTimeline.ENTRIES;\n\t\tframes[frame] = time;\n\t\tframes[frame + SequenceTimeline.MODE] = mode | (index << 4);\n\t\tframes[frame + SequenceTimeline.DELAY] = delay;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\t\tlet slotAttachment = slot.attachment;\n\t\tlet attachment = this.attachment as unknown as Attachment;\n\t\tif (slotAttachment != attachment) {\n\t\t\tif (!(slotAttachment instanceof VertexAttachment)\n\t\t\t\t|| (slotAttachment as VertexAttachment).timelineAttachment != attachment) return;\n\t\t}\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) slot.sequenceIndex = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) slot.sequenceIndex = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tlet i = Timeline.search(frames, time, SequenceTimeline.ENTRIES);\n\t\tlet before = frames[i];\n\t\tlet modeAndIndex = frames[i + SequenceTimeline.MODE];\n\t\tlet delay = frames[i + SequenceTimeline.DELAY];\n\n\t\tif (!this.attachment.sequence) return;\n\t\tlet index = modeAndIndex >> 4, count = this.attachment.sequence!.regions.length;\n\t\tlet mode = SequenceModeValues[modeAndIndex & 0xf];\n\t\tif (mode != SequenceMode.hold) {\n\t\t\tindex += (((time - before) / delay + 0.00001) | 0);\n\t\t\tswitch (mode) {\n\t\t\t\tcase SequenceMode.once:\n\t\t\t\t\tindex = Math.min(count - 1, index);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.loop:\n\t\t\t\t\tindex %= count;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.pingpong: {\n\t\t\t\t\tlet n = (count << 1) - 2;\n\t\t\t\t\tindex = n == 0 ? 0 : index % n;\n\t\t\t\t\tif (index >= count) index = n - index;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase SequenceMode.onceReverse:\n\t\t\t\t\tindex = Math.max(count - 1 - index, 0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.loopReverse:\n\t\t\t\t\tindex = count - 1 - (index % count);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.pingpongReverse: {\n\t\t\t\t\tlet n = (count << 1) - 2;\n\t\t\t\t\tindex = n == 0 ? 0 : (index + count - 1) % n;\n\t\t\t\t\tif (index >= count) index = n - index;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tslot.sequenceIndex = index;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, MixBlend, AttachmentTimeline, MixDirection, RotateTimeline, DrawOrderTimeline, Timeline, EventTimeline } from \"./Animation.js\";\nimport { AnimationStateData } from \"./AnimationStateData.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { StringSet, Pool, Utils, MathUtils } from \"./Utils.js\";\nimport { Event } from \"./Event.js\";\n\n\n/** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies\n * multiple animations on top of each other (layering).\n *\n * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide. */\nexport class AnimationState {\n\tstatic _emptyAnimation = new Animation(\"\", [], 0);\n\tprivate static emptyAnimation (): Animation {\n\t\treturn AnimationState._emptyAnimation;\n\t}\n\n\t/** The AnimationStateData to look up mix durations. */\n\tdata: AnimationStateData;\n\n\t/** The list of tracks that currently have animations, which may contain null entries. */\n\ttracks = new Array();\n\n\t/** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower\n\t * or faster. Defaults to 1.\n\t *\n\t * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */\n\ttimeScale = 1;\n\tunkeyedState = 0;\n\n\tevents = new Array();\n\tlisteners = new Array();\n\tqueue = new EventQueue(this);\n\tpropertyIDs = new StringSet();\n\tanimationsChanged = false;\n\n\ttrackEntryPool = new Pool(() => new TrackEntry());\n\n\tconstructor (data: AnimationStateData) {\n\t\tthis.data = data;\n\t}\n\n\t/** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */\n\tupdate (delta: number) {\n\t\tdelta *= this.timeScale;\n\t\tlet tracks = this.tracks;\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet current = tracks[i];\n\t\t\tif (!current) continue;\n\n\t\t\tcurrent.animationLast = current.nextAnimationLast;\n\t\t\tcurrent.trackLast = current.nextTrackLast;\n\n\t\t\tlet currentDelta = delta * current.timeScale;\n\n\t\t\tif (current.delay > 0) {\n\t\t\t\tcurrent.delay -= currentDelta;\n\t\t\t\tif (current.delay > 0) continue;\n\t\t\t\tcurrentDelta = -current.delay;\n\t\t\t\tcurrent.delay = 0;\n\t\t\t}\n\n\t\t\tlet next = current.next;\n\t\t\tif (next) {\n\t\t\t\t// When the next entry's delay is passed, change to the next entry, preserving leftover time.\n\t\t\t\tlet nextTime = current.trackLast - next.delay;\n\t\t\t\tif (nextTime >= 0) {\n\t\t\t\t\tnext.delay = 0;\n\t\t\t\t\tnext.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\n\t\t\t\t\tcurrent.trackTime += currentDelta;\n\t\t\t\t\tthis.setCurrent(i, next, true);\n\t\t\t\t\twhile (next.mixingFrom) {\n\t\t\t\t\t\tnext.mixTime += delta;\n\t\t\t\t\t\tnext = next.mixingFrom;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (current.trackLast >= current.trackEnd && !current.mixingFrom) {\n\t\t\t\ttracks[i] = null;\n\t\t\t\tthis.queue.end(current);\n\t\t\t\tthis.clearNext(current);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (current.mixingFrom && this.updateMixingFrom(current, delta)) {\n\t\t\t\t// End mixing from entries once all have completed.\n\t\t\t\tlet from: TrackEntry | null = current.mixingFrom;\n\t\t\t\tcurrent.mixingFrom = null;\n\t\t\t\tif (from) from.mixingTo = null;\n\t\t\t\twhile (from) {\n\t\t\t\t\tthis.queue.end(from);\n\t\t\t\t\tfrom = from.mixingFrom;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcurrent.trackTime += currentDelta;\n\t\t}\n\n\t\tthis.queue.drain();\n\t}\n\n\t/** Returns true when all mixing from entries are complete. */\n\tupdateMixingFrom (to: TrackEntry, delta: number): boolean {\n\t\tlet from = to.mixingFrom;\n\t\tif (!from) return true;\n\n\t\tlet finished = this.updateMixingFrom(from, delta);\n\n\t\tfrom.animationLast = from.nextAnimationLast;\n\t\tfrom.trackLast = from.nextTrackLast;\n\n\t\t// The from entry was applied at least once and the mix is complete.\n\t\tif (to.nextTrackLast != -1 && to.mixTime >= to.mixDuration) {\n\t\t\t// Mixing is complete for all entries before the from entry or the mix is instantaneous.\n\t\t\tif (from.totalAlpha == 0 || to.mixDuration == 0) {\n\t\t\t\tto.mixingFrom = from.mixingFrom;\n\t\t\t\tif (from.mixingFrom != null) from.mixingFrom.mixingTo = to;\n\t\t\t\tto.interruptAlpha = from.interruptAlpha;\n\t\t\t\tthis.queue.end(from);\n\t\t\t}\n\t\t\treturn finished;\n\t\t}\n\n\t\tfrom.trackTime += delta * from.timeScale;\n\t\tto.mixTime += delta;\n\t\treturn false;\n\t}\n\n\t/** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the\n\t * animation state can be applied to multiple skeletons to pose them identically.\n\t * @returns True if any animations were applied. */\n\tapply (skeleton: Skeleton): boolean {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tif (this.animationsChanged) this._animationsChanged();\n\n\t\tlet events = this.events;\n\t\tlet tracks = this.tracks;\n\t\tlet applied = false;\n\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet current = tracks[i];\n\t\t\tif (!current || current.delay > 0) continue;\n\t\t\tapplied = true;\n\t\t\tlet blend: MixBlend = i == 0 ? MixBlend.first : current.mixBlend;\n\n\t\t\t// Apply mixing from entries first.\n\t\t\tlet alpha = current.alpha;\n\t\t\tif (current.mixingFrom)\n\t\t\t\talpha *= this.applyMixingFrom(current, skeleton, blend);\n\t\t\telse if (current.trackTime >= current.trackEnd && !current.next)\n\t\t\t\talpha = 0;\n\t\t\tlet attachments = alpha >= current.alphaAttachmentThreshold;\n\n\n\t\t\t// Apply current entry.\n\t\t\tlet animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime;\n\t\t\tlet applyEvents: Event[] | null = events;\n\t\t\tif (current.reverse) {\n\t\t\t\tapplyTime = current.animation!.duration - applyTime;\n\t\t\t\tapplyEvents = null;\n\t\t\t}\n\t\t\tlet timelines = current.animation!.timelines;\n\t\t\tlet timelineCount = timelines.length;\n\t\t\tif ((i == 0 && alpha == 1) || blend == MixBlend.add) {\n\t\t\t\tif (i == 0) attachments = true;\n\t\t\t\tfor (let ii = 0; ii < timelineCount; ii++) {\n\t\t\t\t\t// Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\n\t\t\t\t\t// to sometimes stop rendering when using color correction, as their RGBA values become NaN.\n\t\t\t\t\t// (https://github.com/pixijs/pixi-spine/issues/302)\n\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\tvar timeline = timelines[ii];\n\t\t\t\t\tif (timeline instanceof AttachmentTimeline)\n\t\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments);\n\t\t\t\t\telse\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection.mixIn);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet timelineMode = current.timelineMode;\n\n\t\t\t\tlet shortestRotation = current.shortestRotation;\n\t\t\t\tlet firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1;\n\t\t\t\tif (firstFrame) current.timelinesRotation.length = timelineCount << 1;\n\n\t\t\t\tfor (let ii = 0; ii < timelineCount; ii++) {\n\t\t\t\t\tlet timeline = timelines[ii];\n\t\t\t\t\tlet timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;\n\t\t\t\t\tif (!shortestRotation && timeline instanceof RotateTimeline) {\n\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);\n\t\t\t\t\t} else if (timeline instanceof AttachmentTimeline) {\n\t\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\t\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, MixDirection.mixIn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.queueEvents(current, animationTime);\n\t\t\tevents.length = 0;\n\t\t\tcurrent.nextAnimationLast = animationTime;\n\t\t\tcurrent.nextTrackLast = current.trackTime;\n\t\t}\n\n\t\t// Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so\n\t\t// subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or\n\t\t// the time is before the first key).\n\t\tvar setupState = this.unkeyedState + SETUP;\n\t\tvar slots = skeleton.slots;\n\t\tfor (var i = 0, n = skeleton.slots.length; i < n; i++) {\n\t\t\tvar slot = slots[i];\n\t\t\tif (slot.attachmentState == setupState) {\n\t\t\t\tvar attachmentName = slot.data.attachmentName;\n\t\t\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n\t\t\t}\n\t\t}\n\t\tthis.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.\n\n\t\tthis.queue.drain();\n\t\treturn applied;\n\t}\n\n\tapplyMixingFrom (to: TrackEntry, skeleton: Skeleton, blend: MixBlend) {\n\t\tlet from = to.mixingFrom!;\n\t\tif (from.mixingFrom) this.applyMixingFrom(from, skeleton, blend);\n\n\t\tlet mix = 0;\n\t\tif (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\n\t\t\tmix = 1;\n\t\t\tif (blend == MixBlend.first) blend = MixBlend.setup;\n\t\t} else {\n\t\t\tmix = to.mixTime / to.mixDuration;\n\t\t\tif (mix > 1) mix = 1;\n\t\t\tif (blend != MixBlend.first) blend = from.mixBlend;\n\t\t}\n\n\t\tlet attachments = mix < from.mixAttachmentThreshold, drawOrder = mix < from.mixDrawOrderThreshold;\n\t\tlet timelines = from.animation!.timelines;\n\t\tlet timelineCount = timelines.length;\n\t\tlet alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\n\t\tlet animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime;\n\t\tlet events = null;\n\t\tif (from.reverse)\n\t\t\tapplyTime = from.animation!.duration - applyTime;\n\t\telse if (mix < from.eventThreshold)\n\t\t\tevents = this.events;\n\n\t\tif (blend == MixBlend.add) {\n\t\t\tfor (let i = 0; i < timelineCount; i++)\n\t\t\t\ttimelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, MixDirection.mixOut);\n\t\t} else {\n\t\t\tlet timelineMode = from.timelineMode;\n\t\t\tlet timelineHoldMix = from.timelineHoldMix;\n\n\t\t\tlet shortestRotation = from.shortestRotation;\n\t\t\tlet firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1;\n\t\t\tif (firstFrame) from.timelinesRotation.length = timelineCount << 1;\n\n\t\t\tfrom.totalAlpha = 0;\n\t\t\tfor (let i = 0; i < timelineCount; i++) {\n\t\t\t\tlet timeline = timelines[i];\n\t\t\t\tlet direction = MixDirection.mixOut;\n\t\t\t\tlet timelineBlend: MixBlend;\n\t\t\t\tlet alpha = 0;\n\t\t\t\tswitch (timelineMode[i]) {\n\t\t\t\t\tcase SUBSEQUENT:\n\t\t\t\t\t\tif (!drawOrder && timeline instanceof DrawOrderTimeline) continue;\n\t\t\t\t\t\ttimelineBlend = blend;\n\t\t\t\t\t\talpha = alphaMix;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase FIRST:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\talpha = alphaMix;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOLD_SUBSEQUENT:\n\t\t\t\t\t\ttimelineBlend = blend;\n\t\t\t\t\t\talpha = alphaHold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOLD_FIRST:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\talpha = alphaHold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\tlet holdMix = timelineHoldMix[i];\n\t\t\t\t\t\talpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfrom.totalAlpha += alpha;\n\n\t\t\t\tif (!shortestRotation && timeline instanceof RotateTimeline)\n\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);\n\t\t\t\telse if (timeline instanceof AttachmentTimeline)\n\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments && alpha >= from.alphaAttachmentThreshold);\n\t\t\t\telse {\n\t\t\t\t\t// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\tif (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == MixBlend.setup)\n\t\t\t\t\t\tdirection = MixDirection.mixIn;\n\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (to.mixDuration > 0) this.queueEvents(from, animationTime);\n\t\tthis.events.length = 0;\n\t\tfrom.nextAnimationLast = animationTime;\n\t\tfrom.nextTrackLast = from.trackTime;\n\n\t\treturn mix;\n\t}\n\n\tapplyAttachmentTimeline (timeline: AttachmentTimeline, skeleton: Skeleton, time: number, blend: MixBlend, attachments: boolean) {\n\t\tvar slot = skeleton.slots[timeline.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tif (time < timeline.frames[0]) { // Time is before first frame.\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first)\n\t\t\t\tthis.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\n\t\t} else\n\t\t\tthis.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search1(timeline.frames, time)], attachments);\n\n\t\t// If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.\n\t\tif (slot.attachmentState <= this.unkeyedState) slot.attachmentState = this.unkeyedState + SETUP;\n\t}\n\n\tsetAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string | null, attachments: boolean) {\n\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n\t\tif (attachments) slot.attachmentState = this.unkeyedState + CURRENT;\n\t}\n\n\tapplyRotateTimeline (timeline: RotateTimeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend,\n\t\ttimelinesRotation: Array, i: number, firstFrame: boolean) {\n\n\t\tif (firstFrame) timelinesRotation[i] = 0;\n\n\t\tif (alpha == 1) {\n\t\t\ttimeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\n\t\t\treturn;\n\t\t}\n\n\t\tlet bone = skeleton.bones[timeline.boneIndex];\n\t\tif (!bone.active) return;\n\t\tlet frames = timeline.frames;\n\t\tlet r1 = 0, r2 = 0;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.rotation = bone.data.rotation;\n\t\t\t\tdefault:\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tr1 = bone.rotation;\n\t\t\t\t\tr2 = bone.data.rotation;\n\t\t\t}\n\t\t} else {\n\t\t\tr1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\n\t\t\tr2 = bone.data.rotation + timeline.getCurveValue(time);\n\t\t}\n\n\t\t// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\n\t\tlet total = 0, diff = r2 - r1;\n\t\tdiff -= Math.ceil(diff / 360 - 0.5) * 360;\n\t\tif (diff == 0) {\n\t\t\ttotal = timelinesRotation[i];\n\t\t} else {\n\t\t\tlet lastTotal = 0, lastDiff = 0;\n\t\t\tif (firstFrame) {\n\t\t\t\tlastTotal = 0;\n\t\t\t\tlastDiff = diff;\n\t\t\t} else {\n\t\t\t\tlastTotal = timelinesRotation[i];\n\t\t\t\tlastDiff = timelinesRotation[i + 1];\n\t\t\t}\n\t\t\tlet loops = lastTotal - lastTotal % 360;\n\t\t\ttotal = diff + loops;\n\t\t\tlet current = diff >= 0, dir = lastTotal >= 0;\n\t\t\tif (Math.abs(lastDiff) <= 90 && MathUtils.signum(lastDiff) != MathUtils.signum(diff)) {\n\t\t\t\tif (Math.abs(lastTotal - loops) > 180) {\n\t\t\t\t\ttotal += 360 * MathUtils.signum(lastTotal);\n\t\t\t\t\tdir = current;\n\t\t\t\t} else if (loops != 0)\n\t\t\t\t\ttotal -= 360 * MathUtils.signum(lastTotal);\n\t\t\t\telse\n\t\t\t\t\tdir = current;\n\t\t\t}\n\t\t\tif (dir != current) total += 360 * MathUtils.signum(lastTotal);\n\t\t\ttimelinesRotation[i] = total;\n\t\t}\n\t\ttimelinesRotation[i + 1] = diff;\n\t\tbone.rotation = r1 + total * alpha;\n\t}\n\n\tqueueEvents (entry: TrackEntry, animationTime: number) {\n\t\tlet animationStart = entry.animationStart, animationEnd = entry.animationEnd;\n\t\tlet duration = animationEnd - animationStart;\n\t\tlet trackLastWrapped = entry.trackLast % duration;\n\n\t\t// Queue events before complete.\n\t\tlet events = this.events;\n\t\tlet i = 0, n = events.length;\n\t\tfor (; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.time < trackLastWrapped) break;\n\t\t\tif (event.time > animationEnd) continue; // Discard events outside animation start/end.\n\t\t\tthis.queue.event(entry, event);\n\t\t}\n\n\t\t// Queue complete if completed a loop iteration or the animation.\n\t\tlet complete = false;\n\t\tif (entry.loop) {\n\t\t\tif (duration == 0)\n\t\t\t\tcomplete = true;\n\t\t\telse {\n\t\t\t\tconst cycles = Math.floor(entry.trackTime / duration);\n\t\t\t\tcomplete = cycles > 0 && cycles > Math.floor(entry.trackLast / duration);\n\t\t\t}\n\t\t} else\n\t\t\tcomplete = animationTime >= animationEnd && entry.animationLast < animationEnd;\n\t\tif (complete) this.queue.complete(entry);\n\n\t\t// Queue events after complete.\n\t\tfor (; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.time < animationStart) continue; // Discard events outside animation start/end.\n\t\t\tthis.queue.event(entry, event);\n\t\t}\n\t}\n\n\t/** Removes all animations from all tracks, leaving skeletons in their current pose.\n\t *\n\t * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\n\t * rather than leaving them in their current pose. */\n\tclearTracks () {\n\t\tlet oldDrainDisabled = this.queue.drainDisabled;\n\t\tthis.queue.drainDisabled = true;\n\t\tfor (let i = 0, n = this.tracks.length; i < n; i++)\n\t\t\tthis.clearTrack(i);\n\t\tthis.tracks.length = 0;\n\t\tthis.queue.drainDisabled = oldDrainDisabled;\n\t\tthis.queue.drain();\n\t}\n\n\t/** Removes all animations from the track, leaving skeletons in their current pose.\n\t *\n\t * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\n\t * rather than leaving them in their current pose. */\n\tclearTrack (trackIndex: number) {\n\t\tif (trackIndex >= this.tracks.length) return;\n\t\tlet current = this.tracks[trackIndex];\n\t\tif (!current) return;\n\n\t\tthis.queue.end(current);\n\n\t\tthis.clearNext(current);\n\n\t\tlet entry = current;\n\t\twhile (true) {\n\t\t\tlet from = entry.mixingFrom;\n\t\t\tif (!from) break;\n\t\t\tthis.queue.end(from);\n\t\t\tentry.mixingFrom = null;\n\t\t\tentry.mixingTo = null;\n\t\t\tentry = from;\n\t\t}\n\n\t\tthis.tracks[current.trackIndex] = null;\n\n\t\tthis.queue.drain();\n\t}\n\n\tsetCurrent (index: number, current: TrackEntry, interrupt: boolean) {\n\t\tlet from = this.expandToIndex(index);\n\t\tthis.tracks[index] = current;\n\t\tcurrent.previous = null;\n\n\t\tif (from) {\n\t\t\tif (interrupt) this.queue.interrupt(from);\n\t\t\tcurrent.mixingFrom = from;\n\t\t\tfrom.mixingTo = current;\n\t\t\tcurrent.mixTime = 0;\n\n\t\t\t// Store the interrupted mix percentage.\n\t\t\tif (from.mixingFrom && from.mixDuration > 0)\n\t\t\t\tcurrent.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\n\n\t\t\tfrom.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\n\t\t}\n\n\t\tthis.queue.start(current);\n\t}\n\n\t/** Sets an animation by name.\n\t *\n\t * See {@link #setAnimationWith()}. */\n\tsetAnimation (trackIndex: number, animationName: string, loop: boolean = false) {\n\t\tlet animation = this.data.skeletonData.findAnimation(animationName);\n\t\tif (!animation) throw new Error(\"Animation not found: \" + animationName);\n\t\treturn this.setAnimationWith(trackIndex, animation, loop);\n\t}\n\n\t/** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never\n\t * applied to a skeleton, it is replaced (not mixed from).\n\t * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.\n\t * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\tsetAnimationWith (trackIndex: number, animation: Animation, loop: boolean = false) {\n\t\tif (!animation) throw new Error(\"animation cannot be null.\");\n\t\tlet interrupt = true;\n\t\tlet current = this.expandToIndex(trackIndex);\n\t\tif (current) {\n\t\t\tif (current.nextTrackLast == -1) {\n\t\t\t\t// Don't mix from an entry that was never applied.\n\t\t\t\tthis.tracks[trackIndex] = current.mixingFrom;\n\t\t\t\tthis.queue.interrupt(current);\n\t\t\t\tthis.queue.end(current);\n\t\t\t\tthis.clearNext(current);\n\t\t\t\tcurrent = current.mixingFrom;\n\t\t\t\tinterrupt = false;\n\t\t\t} else\n\t\t\t\tthis.clearNext(current);\n\t\t}\n\t\tlet entry = this.trackEntry(trackIndex, animation, loop, current);\n\t\tthis.setCurrent(trackIndex, entry, interrupt);\n\t\tthis.queue.drain();\n\t\treturn entry;\n\t}\n\n\t/** Queues an animation by name.\n\t *\n\t * See {@link #addAnimationWith()}. */\n\taddAnimation (trackIndex: number, animationName: string, loop: boolean = false, delay: number = 0) {\n\t\tlet animation = this.data.skeletonData.findAnimation(animationName);\n\t\tif (!animation) throw new Error(\"Animation not found: \" + animationName);\n\t\treturn this.addAnimationWith(trackIndex, animation, loop, delay);\n\t}\n\n\t/** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is\n\t * equivalent to calling {@link #setAnimationWith()}.\n\t * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\n\t * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix\n\t * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the\n\t * previous entry is looping, its next loop completion is used instead of its duration.\n\t * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\taddAnimationWith (trackIndex: number, animation: Animation, loop: boolean = false, delay: number = 0) {\n\t\tif (!animation) throw new Error(\"animation cannot be null.\");\n\n\t\tlet last = this.expandToIndex(trackIndex);\n\t\tif (last) {\n\t\t\twhile (last.next)\n\t\t\t\tlast = last.next;\n\t\t}\n\n\t\tlet entry = this.trackEntry(trackIndex, animation, loop, last);\n\n\t\tif (!last) {\n\t\t\tthis.setCurrent(trackIndex, entry, true);\n\t\t\tthis.queue.drain();\n\t\t} else {\n\t\t\tlast.next = entry;\n\t\t\tentry.previous = last;\n\t\t\tif (delay <= 0) delay += last.getTrackComplete() - entry.mixDuration;\n\t\t}\n\n\t\tentry.delay = delay;\n\t\treturn entry;\n\t}\n\n\t/** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's\n\t * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.\n\t *\n\t * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},\n\t * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes\n\t * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation\n\t * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of\n\t * 0 still mixes out over one frame.\n\t *\n\t * Mixing in is done by first setting an empty animation, then adding an animation using\n\t * {@link #addAnimation()} and on the returned track entry, set the\n\t * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and\n\t * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the\n\t * setup pose value if no lower tracks key the property to the value keyed in the new animation. */\n\tsetEmptyAnimation (trackIndex: number, mixDuration: number = 0) {\n\t\tlet entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation(), false);\n\t\tentry.mixDuration = mixDuration;\n\t\tentry.trackEnd = mixDuration;\n\t\treturn entry;\n\t}\n\n\t/** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's\n\t * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling\n\t * {@link #setEmptyAnimation()}.\n\t *\n\t * See {@link #setEmptyAnimation()}.\n\t * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\n\t * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or\n\t * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next\n\t * loop completion is used instead of its duration.\n\t * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\taddEmptyAnimation (trackIndex: number, mixDuration: number = 0, delay: number = 0) {\n\t\tlet entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation(), false, delay);\n\t\tif (delay <= 0) entry.delay += entry.mixDuration - mixDuration;\n\t\tentry.mixDuration = mixDuration;\n\t\tentry.trackEnd = mixDuration;\n\t\treturn entry;\n\t}\n\n\t/** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix\n\t * duration. */\n\tsetEmptyAnimations (mixDuration: number = 0) {\n\t\tlet oldDrainDisabled = this.queue.drainDisabled;\n\t\tthis.queue.drainDisabled = true;\n\t\tfor (let i = 0, n = this.tracks.length; i < n; i++) {\n\t\t\tlet current = this.tracks[i];\n\t\t\tif (current) this.setEmptyAnimation(current.trackIndex, mixDuration);\n\t\t}\n\t\tthis.queue.drainDisabled = oldDrainDisabled;\n\t\tthis.queue.drain();\n\t}\n\n\texpandToIndex (index: number) {\n\t\tif (index < this.tracks.length) return this.tracks[index];\n\t\tUtils.ensureArrayCapacity(this.tracks, index + 1, null);\n\t\tthis.tracks.length = index + 1;\n\t\treturn null;\n\t}\n\n\t/** @param last May be null. */\n\ttrackEntry (trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry | null) {\n\t\tlet entry = this.trackEntryPool.obtain();\n\t\tentry.reset();\n\t\tentry.trackIndex = trackIndex;\n\t\tentry.animation = animation;\n\t\tentry.loop = loop;\n\t\tentry.holdPrevious = false;\n\n\t\tentry.reverse = false;\n\t\tentry.shortestRotation = false;\n\n\t\tentry.eventThreshold = 0;\n\t\tentry.alphaAttachmentThreshold = 0;\n\t\tentry.mixAttachmentThreshold = 0;\n\t\tentry.mixDrawOrderThreshold = 0;\n\n\t\tentry.animationStart = 0;\n\t\tentry.animationEnd = animation.duration;\n\t\tentry.animationLast = -1;\n\t\tentry.nextAnimationLast = -1;\n\n\t\tentry.delay = 0;\n\t\tentry.trackTime = 0;\n\t\tentry.trackLast = -1;\n\t\tentry.nextTrackLast = -1;\n\t\tentry.trackEnd = Number.MAX_VALUE;\n\t\tentry.timeScale = 1;\n\n\t\tentry.alpha = 1;\n\t\tentry.mixTime = 0;\n\t\tentry.mixDuration = !last ? 0 : this.data.getMix(last.animation!, animation);\n\t\tentry.interruptAlpha = 1;\n\t\tentry.totalAlpha = 0;\n\t\tentry.mixBlend = MixBlend.replace;\n\t\treturn entry;\n\t}\n\n\t/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */\n\tclearNext (entry: TrackEntry) {\n\t\tlet next = entry.next;\n\t\twhile (next) {\n\t\t\tthis.queue.dispose(next);\n\t\t\tnext = next.next;\n\t\t}\n\t\tentry.next = null;\n\t}\n\n\t_animationsChanged () {\n\t\tthis.animationsChanged = false;\n\n\t\tthis.propertyIDs.clear();\n\t\tlet tracks = this.tracks;\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet entry = tracks[i];\n\t\t\tif (!entry) continue;\n\t\t\twhile (entry.mixingFrom)\n\t\t\t\tentry = entry.mixingFrom;\n\t\t\tdo {\n\t\t\t\tif (!entry.mixingTo || entry.mixBlend != MixBlend.add) this.computeHold(entry);\n\t\t\t\tentry = entry.mixingTo;\n\t\t\t} while (entry);\n\t\t}\n\t}\n\n\tcomputeHold (entry: TrackEntry) {\n\t\tlet to = entry.mixingTo;\n\t\tlet timelines = entry.animation!.timelines;\n\t\tlet timelinesCount = entry.animation!.timelines.length;\n\t\tlet timelineMode = entry.timelineMode;\n\t\ttimelineMode.length = timelinesCount;\n\t\tlet timelineHoldMix = entry.timelineHoldMix;\n\t\ttimelineHoldMix.length = 0;\n\t\tlet propertyIDs = this.propertyIDs;\n\n\t\tif (to && to.holdPrevious) {\n\t\t\tfor (let i = 0; i < timelinesCount; i++)\n\t\t\t\ttimelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT;\n\t\t\treturn;\n\t\t}\n\n\t\touter:\n\t\tfor (let i = 0; i < timelinesCount; i++) {\n\t\t\tlet timeline = timelines[i];\n\t\t\tlet ids = timeline.getPropertyIds();\n\t\t\tif (!propertyIDs.addAll(ids))\n\t\t\t\ttimelineMode[i] = SUBSEQUENT;\n\t\t\telse if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline\n\t\t\t\t|| timeline instanceof EventTimeline || !to.animation!.hasTimeline(ids)) {\n\t\t\t\ttimelineMode[i] = FIRST;\n\t\t\t} else {\n\t\t\t\tfor (let next = to.mixingTo; next; next = next!.mixingTo) {\n\t\t\t\t\tif (next.animation!.hasTimeline(ids)) continue;\n\t\t\t\t\tif (entry.mixDuration > 0) {\n\t\t\t\t\t\ttimelineMode[i] = HOLD_MIX;\n\t\t\t\t\t\ttimelineHoldMix[i] = next;\n\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttimelineMode[i] = HOLD_FIRST;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */\n\tgetCurrent (trackIndex: number) {\n\t\tif (trackIndex >= this.tracks.length) return null;\n\t\treturn this.tracks[trackIndex];\n\t}\n\n\t/** Adds a listener to receive events for all track entries. */\n\taddListener (listener: AnimationStateListener) {\n\t\tif (!listener) throw new Error(\"listener cannot be null.\");\n\t\tthis.listeners.push(listener);\n\t}\n\n\t/** Removes the listener added with {@link #addListener()}. */\n\tremoveListener (listener: AnimationStateListener) {\n\t\tlet index = this.listeners.indexOf(listener);\n\t\tif (index >= 0) this.listeners.splice(index, 1);\n\t}\n\n\t/** Removes all listeners added with {@link #addListener()}. */\n\tclearListeners () {\n\t\tthis.listeners.length = 0;\n\t}\n\n\t/** Discards all listener notifications that have not yet been delivered. This can be useful to call from an\n\t * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery\n\t * are not wanted because new animations are being set. */\n\tclearListenerNotifications () {\n\t\tthis.queue.clear();\n\t}\n}\n\n/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.\n *\n * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */\nexport class TrackEntry {\n\t/** The animation to apply for this track entry. */\n\tanimation: Animation | null = null;\n\n\tprevious: TrackEntry | null = null;\n\n\t/** The animation queued to start after this animation, or null. `next` makes up a linked list. */\n\tnext: TrackEntry | null = null;\n\n\t/** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no\n\t * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */\n\tmixingFrom: TrackEntry | null = null;\n\n\t/** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is\n\t * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */\n\tmixingTo: TrackEntry | null = null;\n\n\t/** The listener for events generated by this track entry, or null.\n\t *\n\t * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation\n\t * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */\n\tlistener: AnimationStateListener | null = null;\n\n\t/** The index of the track where this track entry is either current or queued.\n\t *\n\t * See {@link AnimationState#getCurrent()}. */\n\ttrackIndex: number = 0;\n\n\t/** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. */\n\tloop: boolean = false;\n\n\t/** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead\n\t * of being mixed out.\n\t *\n\t * When mixing between animations that key the same property, if a lower track also keys that property then the value will\n\t * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%\n\t * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation\n\t * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which\n\t * keys the property, only when a higher track also keys the property.\n\t *\n\t * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the\n\t * previous animation. */\n\tholdPrevious: boolean = false;\n\n\treverse: boolean = false;\n\n\tshortestRotation: boolean = false;\n\n\t/** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the\n\t * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event\n\t * timelines are not applied while this animation is being mixed out. */\n\teventThreshold: number = 0;\n\n\t/** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the\n\t * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to\n\t * 0, so attachment timelines are not applied while this animation is being mixed out. */\n\tmixAttachmentThreshold: number = 0;\n\n\t/** When {@link #getAlpha()} is greater than alphaAttachmentThreshold, attachment timelines are applied.\n\t * Defaults to 0, so attachment timelines are always applied. */\n\talphaAttachmentThreshold: number = 0;\n\n\t/** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the\n\t * mixDrawOrderThreshold, draw order timelines are applied while this animation is being mixed out. Defaults to\n\t * 0, so draw order timelines are not applied while this animation is being mixed out. */\n\tmixDrawOrderThreshold: number = 0;\n\n\t/** Seconds when this animation starts, both initially and after looping. Defaults to 0.\n\t *\n\t * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same\n\t * value to prevent timeline keys before the start time from triggering. */\n\tanimationStart: number = 0;\n\n\t/** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will\n\t * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */\n\tanimationEnd: number = 0;\n\n\n\t/** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this\n\t * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and\n\t * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation\n\t * is applied. */\n\tanimationLast: number = 0;\n\n\tnextAnimationLast: number = 0;\n\n\t/** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay`\n\t * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from\n\t * the start of the previous animation to when this track entry will become the current track entry (ie when the previous\n\t * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`).\n\t *\n\t * {@link #timeScale} affects the delay. */\n\tdelay: number = 0;\n\n\t/** Current time in seconds this track entry has been the current track entry. The track time determines\n\t * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting\n\t * looping. */\n\ttrackTime: number = 0;\n\n\ttrackLast: number = 0; nextTrackLast: number = 0;\n\n\t/** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float\n\t * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time\n\t * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the\n\t * properties keyed by the animation are set to the setup pose and the track is cleared.\n\t *\n\t * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation\n\t * abruptly cease being applied. */\n\ttrackEnd: number = 0;\n\n\t/** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or\n\t * faster. Defaults to 1.\n\t *\n\t * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to\n\t * match the animation speed.\n\t *\n\t * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\n\t * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If\n\t * the time scale is not 1, the delay may need to be adjusted.\n\t *\n\t * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */\n\ttimeScale: number = 0;\n\n\t/** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults\n\t * to 1, which overwrites the skeleton's current pose with this animation.\n\t *\n\t * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to\n\t * use alpha on track 0 if the skeleton pose is from the last frame render. */\n\talpha: number = 0;\n\n\t/** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be\n\t * slightly more than `mixDuration` when the mix is complete. */\n\tmixTime: number = 0;\n\n\t/** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData\n\t * {@link AnimationStateData#getMix()} based on the animation before this animation (if any).\n\t *\n\t * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the\n\t * properties it was animating.\n\t *\n\t * The `mixDuration` can be set manually rather than use the value from\n\t * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new\n\t * track entry only before {@link AnimationState#update(float)} is first called.\n\t *\n\t * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\n\t * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set\n\t * afterward. */\n\t_mixDuration: number = 0; interruptAlpha: number = 0; totalAlpha: number = 0;\n\n\tget mixDuration () {\n\t\treturn this._mixDuration;\n\t}\n\n\tset mixDuration (mixDuration: number) {\n\t\tthis._mixDuration = mixDuration;\n\t}\n\n\tsetMixDurationWithDelay (mixDuration: number, delay: number) {\n\t\tthis._mixDuration = mixDuration;\n\t\tif (this.previous != null && delay <= 0) delay += this.previous.getTrackComplete() - mixDuration;\n\t\tthis.delay = delay;\n\t}\n\n\t/** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which\n\t * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to\n\t * the values from the lower tracks.\n\t *\n\t * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first\n\t * called. */\n\tmixBlend = MixBlend.replace;\n\ttimelineMode = new Array();\n\ttimelineHoldMix = new Array();\n\ttimelinesRotation = new Array();\n\n\treset () {\n\t\tthis.next = null;\n\t\tthis.previous = null;\n\t\tthis.mixingFrom = null;\n\t\tthis.mixingTo = null;\n\t\tthis.animation = null;\n\t\tthis.listener = null;\n\t\tthis.timelineMode.length = 0;\n\t\tthis.timelineHoldMix.length = 0;\n\t\tthis.timelinesRotation.length = 0;\n\t}\n\n\t/** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}\n\t * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the\n\t * `animationStart` time. */\n\tgetAnimationTime () {\n\t\tif (this.loop) {\n\t\t\tlet duration = this.animationEnd - this.animationStart;\n\t\t\tif (duration == 0) return this.animationStart;\n\t\t\treturn (this.trackTime % duration) + this.animationStart;\n\t\t}\n\t\treturn Math.min(this.trackTime + this.animationStart, this.animationEnd);\n\t}\n\n\tsetAnimationLast (animationLast: number) {\n\t\tthis.animationLast = animationLast;\n\t\tthis.nextAnimationLast = animationLast;\n\t}\n\n\t/** Returns true if at least one loop has been completed.\n\t *\n\t * See {@link AnimationStateListener#complete()}. */\n\tisComplete () {\n\t\treturn this.trackTime >= this.animationEnd - this.animationStart;\n\t}\n\n\t/** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the\n\t * long way around when using {@link #alpha} and starting animations on other tracks.\n\t *\n\t * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:\n\t * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long\n\t * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the\n\t * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */\n\tresetRotationDirections () {\n\t\tthis.timelinesRotation.length = 0;\n\t}\n\n\tgetTrackComplete () {\n\t\tlet duration = this.animationEnd - this.animationStart;\n\t\tif (duration != 0) {\n\t\t\tif (this.loop) return duration * (1 + ((this.trackTime / duration) | 0)); // Completion of next loop.\n\t\t\tif (this.trackTime < duration) return duration; // Before duration.\n\t\t}\n\t\treturn this.trackTime; // Next update.\n\t}\n\n\t/** Returns true if this track entry has been applied at least once.\n\t *

\n\t * See {@link AnimationState#apply(Skeleton)}. */\n\twasApplied () {\n\t\treturn this.nextTrackLast != -1;\n\t}\n\n\t/** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next\n\t * {@link AnimationState#update(float)}. */\n\tisNextReady () {\n\t\treturn this.next != null && this.nextTrackLast - this.next.delay >= 0;\n\t}\n}\n\nexport class EventQueue {\n\tobjects: Array = [];\n\tdrainDisabled = false;\n\tanimState: AnimationState;\n\n\tconstructor (animState: AnimationState) {\n\t\tthis.animState = animState;\n\t}\n\n\tstart (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.start);\n\t\tthis.objects.push(entry);\n\t\tthis.animState.animationsChanged = true;\n\t}\n\n\tinterrupt (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.interrupt);\n\t\tthis.objects.push(entry);\n\t}\n\n\tend (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.end);\n\t\tthis.objects.push(entry);\n\t\tthis.animState.animationsChanged = true;\n\t}\n\n\tdispose (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.dispose);\n\t\tthis.objects.push(entry);\n\t}\n\n\tcomplete (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.complete);\n\t\tthis.objects.push(entry);\n\t}\n\n\tevent (entry: TrackEntry, event: Event) {\n\t\tthis.objects.push(EventType.event);\n\t\tthis.objects.push(entry);\n\t\tthis.objects.push(event);\n\t}\n\n\tdrain () {\n\t\tif (this.drainDisabled) return;\n\t\tthis.drainDisabled = true;\n\n\t\tlet objects = this.objects;\n\t\tlet listeners = this.animState.listeners;\n\n\t\tfor (let i = 0; i < objects.length; i += 2) {\n\t\t\tlet type = objects[i] as EventType;\n\t\t\tlet entry = objects[i + 1] as TrackEntry;\n\t\t\tswitch (type) {\n\t\t\t\tcase EventType.start:\n\t\t\t\t\tif (entry.listener && entry.listener.start) entry.listener.start(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.start) listener.start(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.interrupt:\n\t\t\t\t\tif (entry.listener && entry.listener.interrupt) entry.listener.interrupt(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.interrupt) listener.interrupt(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.end:\n\t\t\t\t\tif (entry.listener && entry.listener.end) entry.listener.end(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.end) listener.end(entry);\n\t\t\t\t\t}\n\t\t\t\t// Fall through.\n\t\t\t\tcase EventType.dispose:\n\t\t\t\t\tif (entry.listener && entry.listener.dispose) entry.listener.dispose(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.dispose) listener.dispose(entry);\n\t\t\t\t\t}\n\t\t\t\t\tthis.animState.trackEntryPool.free(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.complete:\n\t\t\t\t\tif (entry.listener && entry.listener.complete) entry.listener.complete(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.complete) listener.complete(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.event:\n\t\t\t\t\tlet event = objects[i++ + 2] as Event;\n\t\t\t\t\tif (entry.listener && entry.listener.event) entry.listener.event(entry, event);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.event) listener.event(entry, event);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.clear();\n\n\t\tthis.drainDisabled = false;\n\t}\n\n\tclear () {\n\t\tthis.objects.length = 0;\n\t}\n}\n\nexport enum EventType {\n\tstart, interrupt, end, dispose, complete, event\n}\n\n/** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving\n * events.\n *\n * See TrackEntry {@link TrackEntry#listener} and AnimationState\n * {@link AnimationState#addListener()}. */\nexport interface AnimationStateListener {\n\t/** Invoked when this entry has been set as the current entry. */\n\tstart?: (entry: TrackEntry) => void;\n\n\t/** Invoked when another entry has replaced this entry as the current entry. This entry may continue being applied for\n\t * mixing. */\n\tinterrupt?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry is no longer the current entry and will never be applied again. */\n\tend?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry will be disposed. This may occur without the entry ever being set as the current entry.\n\t * References to the entry should not be kept after dispose is called, as it may be destroyed or reused. */\n\tdispose?: (entry: TrackEntry) => void;\n\n\t/** Invoked every time this entry's animation completes a loop. */\n\tcomplete?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry's animation triggers an event. */\n\tevent?: (entry: TrackEntry, event: Event) => void;\n}\n\nexport abstract class AnimationStateAdapter implements AnimationStateListener {\n\tstart (entry: TrackEntry) {\n\t}\n\n\tinterrupt (entry: TrackEntry) {\n\t}\n\n\tend (entry: TrackEntry) {\n\t}\n\n\tdispose (entry: TrackEntry) {\n\t}\n\n\tcomplete (entry: TrackEntry) {\n\t}\n\n\tevent (entry: TrackEntry, event: Event) {\n\t}\n}\n\n/** 1. A previously applied timeline has set this property.\n *\n * Result: Mix from the current pose to the timeline pose. */\nexport const SUBSEQUENT = 0;\n/** 1. This is the first timeline to set this property.\n * 2. The next track entry applied after this one does not have a timeline to set this property.\n *\n * Result: Mix from the setup pose to the timeline pose. */\nexport const FIRST = 1;\n/** 1) A previously applied timeline has set this property.
\n * 2) The next track entry to be applied does have a timeline to set this property.
\n * 3) The next track entry after that one does not have a timeline to set this property.
\n * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading\n * animations that key the same property. A subsequent timeline will set this property using a mix. */\nexport const HOLD_SUBSEQUENT = 2;\n/** 1) This is the first timeline to set this property.
\n * 2) The next track entry to be applied does have a timeline to set this property.
\n * 3) The next track entry after that one does not have a timeline to set this property.
\n * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading animations\n * that key the same property. A subsequent timeline will set this property using a mix. */\nexport const HOLD_FIRST = 3;\n/** 1. This is the first timeline to set this property.\n * 2. The next track entry to be applied does have a timeline to set this property.\n * 3. The next track entry after that one does have a timeline to set this property.\n * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.\n *\n * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than\n * 2 track entries in a row have a timeline that sets the same property.\n *\n * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid\n * \"dipping\" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A\n * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into\n * place. */\nexport const HOLD_MIX = 4;\n\nexport const SETUP = 1;\nexport const CURRENT = 2;\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation } from \"./Animation.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { StringMap } from \"./Utils.js\";\n\n\n/** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed. */\nexport class AnimationStateData {\n\t/** The SkeletonData to look up animations when they are specified by name. */\n\tskeletonData: SkeletonData;\n\n\tanimationToMixTime: StringMap = {};\n\n\t/** The mix duration to use when no mix duration has been defined between two animations. */\n\tdefaultMix = 0;\n\n\tconstructor (skeletonData: SkeletonData) {\n\t\tif (!skeletonData) throw new Error(\"skeletonData cannot be null.\");\n\t\tthis.skeletonData = skeletonData;\n\t}\n\n\t/** Sets a mix duration by animation name.\n\t *\n\t * See {@link #setMixWith()}. */\n\tsetMix (fromName: string, toName: string, duration: number) {\n\t\tlet from = this.skeletonData.findAnimation(fromName);\n\t\tif (!from) throw new Error(\"Animation not found: \" + fromName);\n\t\tlet to = this.skeletonData.findAnimation(toName);\n\t\tif (!to) throw new Error(\"Animation not found: \" + toName);\n\t\tthis.setMixWith(from, to, duration);\n\t}\n\n\t/** Sets the mix duration when changing from the specified animation to the other.\n\t *\n\t * See {@link TrackEntry#mixDuration}. */\n\tsetMixWith (from: Animation, to: Animation, duration: number) {\n\t\tif (!from) throw new Error(\"from cannot be null.\");\n\t\tif (!to) throw new Error(\"to cannot be null.\");\n\t\tlet key = from.name + \".\" + to.name;\n\t\tthis.animationToMixTime[key] = duration;\n\t}\n\n\t/** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if\n\t * no mix duration has been set. */\n\tgetMix (from: Animation, to: Animation) {\n\t\tlet key = from.name + \".\" + to.name;\n\t\tlet value = this.animationToMixTime[key];\n\t\treturn value === undefined ? this.defaultMix : value;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment with vertices that make up a polygon. Can be used for hit detection, creating physics bodies, spawning particle\n * effects, and more.\n *\n * See {@link SkeletonBounds} and [Bounding Boxes](http://esotericsoftware.com/spine-bounding-boxes) in the Spine User\n * Guide. */\nexport class BoundingBoxAttachment extends VertexAttachment {\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new BoundingBoxAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { SlotData } from \"../SlotData.js\";\nimport { Color } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */\nexport class ClippingAttachment extends VertexAttachment {\n\t/** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of\n\t * the skeleton's rendering. */\n\tendSlot: SlotData | null = null;\n\n\t// Nonessential.\n\t/** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new ClippingAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.endSlot = this.endSlot;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport abstract class Texture {\n\tprotected _image: HTMLImageElement | ImageBitmap | any;\n\n\tconstructor (image: HTMLImageElement | ImageBitmap | any) {\n\t\tthis._image = image;\n\t}\n\n\tgetImage (): HTMLImageElement | ImageBitmap | any {\n\t\treturn this._image;\n\t}\n\n\tabstract setFilters (minFilter: TextureFilter, magFilter: TextureFilter): void;\n\tabstract setWraps (uWrap: TextureWrap, vWrap: TextureWrap): void;\n\tabstract dispose (): void;\n}\n\nexport enum TextureFilter {\n\tNearest = 9728, // WebGLRenderingContext.NEAREST\n\tLinear = 9729, // WebGLRenderingContext.LINEAR\n\tMipMap = 9987, // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\n\tMipMapNearestNearest = 9984, // WebGLRenderingContext.NEAREST_MIPMAP_NEAREST\n\tMipMapLinearNearest = 9985, // WebGLRenderingContext.LINEAR_MIPMAP_NEAREST\n\tMipMapNearestLinear = 9986, // WebGLRenderingContext.NEAREST_MIPMAP_LINEAR\n\tMipMapLinearLinear = 9987 // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\n}\n\nexport enum TextureWrap {\n\tMirroredRepeat = 33648, // WebGLRenderingContext.MIRRORED_REPEAT\n\tClampToEdge = 33071, // WebGLRenderingContext.CLAMP_TO_EDGE\n\tRepeat = 10497 // WebGLRenderingContext.REPEAT\n}\n\nexport class TextureRegion {\n\ttexture: any;\n\tu = 0; v = 0;\n\tu2 = 0; v2 = 0;\n\twidth = 0; height = 0;\n\tdegrees = 0;\n\toffsetX = 0; offsetY = 0;\n\toriginalWidth = 0; originalHeight = 0;\n}\n\nexport class FakeTexture extends Texture {\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) { }\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) { }\n\tdispose () { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AssetManagerBase } from \"./AssetManagerBase.js\";\nimport { TextureFilter, TextureWrap, Texture, TextureRegion } from \"./Texture.js\";\nimport { Disposable, Utils, StringMap } from \"./Utils.js\";\n\nexport class TextureAtlas implements Disposable {\n\tpages = new Array();\n\tregions = new Array();\n\n\tconstructor (atlasText: string) {\n\t\tlet reader = new TextureAtlasReader(atlasText);\n\t\tlet entry = new Array(4);\n\n\t\tlet pageFields: StringMap<(page: TextureAtlasPage) => void> = {};\n\t\tpageFields[\"size\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.width = parseInt(entry[1]);\n\t\t\tpage!.height = parseInt(entry[2]);\n\t\t};\n\t\tpageFields[\"format\"] = () => {\n\t\t\t// page.format = Format[tuple[0]]; we don't need format in WebGL\n\t\t};\n\t\tpageFields[\"filter\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.minFilter = Utils.enumValue(TextureFilter, entry[1]);\n\t\t\tpage!.magFilter = Utils.enumValue(TextureFilter, entry[2]);\n\t\t};\n\t\tpageFields[\"repeat\"] = (page: TextureAtlasPage) => {\n\t\t\tif (entry[1].indexOf('x') != -1) page!.uWrap = TextureWrap.Repeat;\n\t\t\tif (entry[1].indexOf('y') != -1) page!.vWrap = TextureWrap.Repeat;\n\t\t};\n\t\tpageFields[\"pma\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.pma = entry[1] == \"true\";\n\t\t};\n\n\t\tvar regionFields: StringMap<(region: TextureAtlasRegion) => void> = {};\n\t\tregionFields[\"xy\"] = (region: TextureAtlasRegion) => { // Deprecated, use bounds.\n\t\t\tregion.x = parseInt(entry[1]);\n\t\t\tregion.y = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"size\"] = (region: TextureAtlasRegion) => { // Deprecated, use bounds.\n\t\t\tregion.width = parseInt(entry[1]);\n\t\t\tregion.height = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"bounds\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.x = parseInt(entry[1]);\n\t\t\tregion.y = parseInt(entry[2]);\n\t\t\tregion.width = parseInt(entry[3]);\n\t\t\tregion.height = parseInt(entry[4]);\n\t\t};\n\t\tregionFields[\"offset\"] = (region: TextureAtlasRegion) => { // Deprecated, use offsets.\n\t\t\tregion.offsetX = parseInt(entry[1]);\n\t\t\tregion.offsetY = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"orig\"] = (region: TextureAtlasRegion) => { // Deprecated, use offsets.\n\t\t\tregion.originalWidth = parseInt(entry[1]);\n\t\t\tregion.originalHeight = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"offsets\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.offsetX = parseInt(entry[1]);\n\t\t\tregion.offsetY = parseInt(entry[2]);\n\t\t\tregion.originalWidth = parseInt(entry[3]);\n\t\t\tregion.originalHeight = parseInt(entry[4]);\n\t\t};\n\t\tregionFields[\"rotate\"] = (region: TextureAtlasRegion) => {\n\t\t\tlet value = entry[1];\n\t\t\tif (value == \"true\")\n\t\t\t\tregion.degrees = 90;\n\t\t\telse if (value != \"false\")\n\t\t\t\tregion.degrees = parseInt(value);\n\t\t};\n\t\tregionFields[\"index\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.index = parseInt(entry[1]);\n\t\t};\n\n\t\tlet line = reader.readLine();\n\t\t// Ignore empty lines before first entry.\n\t\twhile (line && line.trim().length == 0)\n\t\t\tline = reader.readLine();\n\t\t// Header entries.\n\t\twhile (true) {\n\t\t\tif (!line || line.trim().length == 0) break;\n\t\t\tif (reader.readEntry(entry, line) == 0) break; // Silently ignore all header fields.\n\t\t\tline = reader.readLine();\n\t\t}\n\n\t\t// Page and region entries.\n\t\tlet page: TextureAtlasPage | null = null;\n\t\tlet names: string[] | null = null;\n\t\tlet values: number[][] | null = null;\n\t\twhile (true) {\n\t\t\tif (line === null) break;\n\t\t\tif (line.trim().length == 0) {\n\t\t\t\tpage = null;\n\t\t\t\tline = reader.readLine();\n\t\t\t} else if (!page) {\n\t\t\t\tpage = new TextureAtlasPage(line.trim());\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (reader.readEntry(entry, line = reader.readLine()) == 0) break;\n\t\t\t\t\tlet field = pageFields[entry[0]];\n\t\t\t\t\tif (field) field(page);\n\t\t\t\t}\n\t\t\t\tthis.pages.push(page);\n\t\t\t} else {\n\t\t\t\tlet region = new TextureAtlasRegion(page, line);\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tlet count = reader.readEntry(entry, line = reader.readLine());\n\t\t\t\t\tif (count == 0) break;\n\t\t\t\t\tlet field = regionFields[entry[0]];\n\t\t\t\t\tif (field)\n\t\t\t\t\t\tfield(region);\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (!names) names = [];\n\t\t\t\t\t\tif (!values) values = [];\n\t\t\t\t\t\tnames.push(entry[0]);\n\t\t\t\t\t\tlet entryValues: number[] = [];\n\t\t\t\t\t\tfor (let i = 0; i < count; i++)\n\t\t\t\t\t\t\tentryValues.push(parseInt(entry[i + 1]));\n\t\t\t\t\t\tvalues.push(entryValues);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (region.originalWidth == 0 && region.originalHeight == 0) {\n\t\t\t\t\tregion.originalWidth = region.width;\n\t\t\t\t\tregion.originalHeight = region.height;\n\t\t\t\t}\n\t\t\t\tif (names && names.length > 0 && values && values.length > 0) {\n\t\t\t\t\tregion.names = names;\n\t\t\t\t\tregion.values = values;\n\t\t\t\t\tnames = null;\n\t\t\t\t\tvalues = null;\n\t\t\t\t}\n\t\t\t\tregion.u = region.x / page.width;\n\t\t\t\tregion.v = region.y / page.height;\n\t\t\t\tif (region.degrees == 90) {\n\t\t\t\t\tregion.u2 = (region.x + region.height) / page.width;\n\t\t\t\t\tregion.v2 = (region.y + region.width) / page.height;\n\t\t\t\t} else {\n\t\t\t\t\tregion.u2 = (region.x + region.width) / page.width;\n\t\t\t\t\tregion.v2 = (region.y + region.height) / page.height;\n\t\t\t\t}\n\t\t\t\tthis.regions.push(region);\n\t\t\t}\n\t\t}\n\t}\n\n\tfindRegion (name: string): TextureAtlasRegion | null {\n\t\tfor (let i = 0; i < this.regions.length; i++) {\n\t\t\tif (this.regions[i].name == name) {\n\t\t\t\treturn this.regions[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tsetTextures (assetManager: AssetManagerBase, pathPrefix: string = \"\") {\n\t\tfor (let page of this.pages)\n\t\t\tpage.setTexture(assetManager.get(pathPrefix + page.name));\n\t}\n\n\tdispose () {\n\t\tfor (let i = 0; i < this.pages.length; i++) {\n\t\t\tthis.pages[i].texture?.dispose();\n\t\t}\n\t}\n}\n\nclass TextureAtlasReader {\n\tlines: Array;\n\tindex: number = 0;\n\n\tconstructor (text: string) {\n\t\tthis.lines = text.split(/\\r\\n|\\r|\\n/);\n\t}\n\n\treadLine (): string | null {\n\t\tif (this.index >= this.lines.length)\n\t\t\treturn null;\n\t\treturn this.lines[this.index++];\n\t}\n\n\treadEntry (entry: string[], line: string | null): number {\n\t\tif (!line) return 0;\n\t\tline = line.trim();\n\t\tif (line.length == 0) return 0;\n\n\t\tlet colon = line.indexOf(':');\n\t\tif (colon == -1) return 0;\n\t\tentry[0] = line.substr(0, colon).trim();\n\t\tfor (let i = 1, lastMatch = colon + 1; ; i++) {\n\t\t\tlet comma = line.indexOf(',', lastMatch);\n\t\t\tif (comma == -1) {\n\t\t\t\tentry[i] = line.substr(lastMatch).trim();\n\t\t\t\treturn i;\n\t\t\t}\n\t\t\tentry[i] = line.substr(lastMatch, comma - lastMatch).trim();\n\t\t\tlastMatch = comma + 1;\n\t\t\tif (i == 4) return 4;\n\t\t}\n\t}\n}\n\nexport class TextureAtlasPage {\n\tname: string;\n\tminFilter: TextureFilter = TextureFilter.Nearest;\n\tmagFilter: TextureFilter = TextureFilter.Nearest;\n\tuWrap: TextureWrap = TextureWrap.ClampToEdge;\n\tvWrap: TextureWrap = TextureWrap.ClampToEdge;\n\ttexture: Texture | null = null;\n\twidth: number = 0;\n\theight: number = 0;\n\tpma: boolean = false;\n\tregions = new Array();\n\n\tconstructor (name: string) {\n\t\tthis.name = name;\n\t}\n\n\tsetTexture (texture: Texture) {\n\t\tthis.texture = texture;\n\t\ttexture.setFilters(this.minFilter, this.magFilter);\n\t\ttexture.setWraps(this.uWrap, this.vWrap);\n\t\tfor (let region of this.regions)\n\t\t\tregion.texture = texture;\n\t}\n}\n\nexport class TextureAtlasRegion extends TextureRegion {\n\tpage: TextureAtlasPage;\n\tname: string;\n\tx: number = 0;\n\ty: number = 0;\n\toffsetX: number = 0;\n\toffsetY: number = 0;\n\toriginalWidth: number = 0;\n\toriginalHeight: number = 0;\n\tindex: number = 0;\n\tdegrees: number = 0;\n\tnames: string[] | null = null;\n\tvalues: number[][] | null = null;\n\n\tconstructor (page: TextureAtlasPage, name: string) {\n\t\tsuper();\n\t\tthis.page = page;\n\t\tthis.name = name;\n\t\tpage.regions.push(this);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TextureRegion } from \"../Texture.js\";\nimport { TextureAtlasRegion } from \"../TextureAtlas.js\";\nimport { Color, NumberArrayLike, Utils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Sequence } from \"./Sequence.js\";\nimport { Slot } from \"../Slot.js\";\n\n/** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not\n * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.\n *\n * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */\nexport class MeshAttachment extends VertexAttachment implements HasTextureRegion {\n\tregion: TextureRegion | null = null;\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\t/** The UV pair for each vertex, normalized within the texture region. */\n\tregionUVs: NumberArrayLike = [];\n\n\t/** The UV pair for each vertex, normalized within the entire texture.\n\t *\n\t * See {@link #updateUVs}. */\n\tuvs: NumberArrayLike = [];\n\n\t/** Triplets of vertex indices which describe the mesh's triangulation. */\n\ttriangles: Array = [];\n\n\t/** The color to tint the mesh. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The width of the mesh's image. Available only when nonessential data was exported. */\n\twidth: number = 0;\n\n\t/** The height of the mesh's image. Available only when nonessential data was exported. */\n\theight: number = 0;\n\n\t/** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */\n\thullLength: number = 0;\n\n\t/** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if\n\t * nonessential data was exported. Triangulation is not performed at runtime. */\n\tedges: Array = [];\n\n\tprivate parentMesh: MeshAttachment | null = null;\n\n\tsequence: Sequence | null = null;\n\n\ttempColor = new Color(0, 0, 0, 0);\n\n\tconstructor (name: string, path: string) {\n\t\tsuper(name);\n\t\tthis.path = path;\n\t}\n\n\t/** Calculates {@link #uvs} using the {@link #regionUVs} and region. Must be called if the region, the region's properties, or\n\t * the {@link #regionUVs} are changed. */\n\tupdateRegion () {\n\t\tif (!this.region) throw new Error(\"Region not set.\");\n\t\tlet regionUVs = this.regionUVs;\n\t\tif (!this.uvs || this.uvs.length != regionUVs.length) this.uvs = Utils.newFloatArray(regionUVs.length);\n\t\tlet uvs = this.uvs;\n\t\tlet n = this.uvs.length;\n\t\tlet u = this.region.u, v = this.region.v, width = 0, height = 0;\n\t\tif (this.region instanceof TextureAtlasRegion) {\n\t\t\tlet region = this.region, page = region.page;\n\t\t\tlet textureWidth = page.width, textureHeight = page.height;\n\t\t\tswitch (region.degrees) {\n\t\t\t\tcase 90:\n\t\t\t\t\tu -= (region.originalHeight - region.offsetY - region.height) / textureWidth;\n\t\t\t\t\tv -= (region.originalWidth - region.offsetX - region.width) / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + regionUVs[i + 1] * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 180:\n\t\t\t\t\tu -= (region.originalWidth - region.offsetX - region.width) / textureWidth;\n\t\t\t\t\tv -= region.offsetY / textureHeight;\n\t\t\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\t\t\theight = region.originalHeight / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 270:\n\t\t\t\t\tu -= region.offsetY / textureWidth;\n\t\t\t\t\tv -= region.offsetX / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i + 1]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + regionUVs[i] * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tu -= region.offsetX / textureWidth;\n\t\t\tv -= (region.originalHeight - region.offsetY - region.height) / textureHeight;\n\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\theight = region.originalHeight / textureHeight;\n\t\t} else if (!this.region) {\n\t\t\tu = v = 0;\n\t\t\twidth = height = 1;\n\t\t} else {\n\t\t\twidth = this.region.u2 - u;\n\t\t\theight = this.region.v2 - v;\n\t\t}\n\n\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\tuvs[i] = u + regionUVs[i] * width;\n\t\t\tuvs[i + 1] = v + regionUVs[i + 1] * height;\n\t\t}\n\t}\n\n\t/** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},\n\t * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the\n\t * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */\n\tgetParentMesh () {\n\t\treturn this.parentMesh;\n\t}\n\n\t/** @param parentMesh May be null. */\n\tsetParentMesh (parentMesh: MeshAttachment) {\n\t\tthis.parentMesh = parentMesh;\n\t\tif (parentMesh) {\n\t\t\tthis.bones = parentMesh.bones;\n\t\t\tthis.vertices = parentMesh.vertices;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\n\t\t\tthis.regionUVs = parentMesh.regionUVs;\n\t\t\tthis.triangles = parentMesh.triangles;\n\t\t\tthis.hullLength = parentMesh.hullLength;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength\n\t\t}\n\t}\n\n\tcopy (): Attachment {\n\t\tif (this.parentMesh) return this.newLinkedMesh();\n\n\t\tlet copy = new MeshAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.color.setFromColor(this.color);\n\n\t\tthis.copyTo(copy);\n\t\tcopy.regionUVs = new Array(this.regionUVs.length);\n\t\tUtils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\n\t\tcopy.uvs = new Array(this.uvs.length);\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);\n\t\tcopy.triangles = new Array(this.triangles.length);\n\t\tUtils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\n\t\tcopy.hullLength = this.hullLength;\n\n\t\tcopy.sequence = this.sequence != null ? this.sequence.copy() : null;\n\n\t\t// Nonessential.\n\t\tif (this.edges) {\n\t\t\tcopy.edges = new Array(this.edges.length);\n\t\t\tUtils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\n\t\t}\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\n\t\treturn copy;\n\t}\n\n\tcomputeWorldVertices (slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tif (this.sequence != null) this.sequence.apply(slot, this);\n\t\tsuper.computeWorldVertices(slot, start, count, worldVertices, offset, stride);\n\t}\n\n\t/** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/\n\tnewLinkedMesh (): MeshAttachment {\n\t\tlet copy = new MeshAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.timelineAttachment = this.timelineAttachment;\n\t\tcopy.setParentMesh(this.parentMesh ? this.parentMesh : this);\n\t\tif (copy.region != null) copy.updateRegion();\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color, Utils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment whose vertices make up a composite Bezier curve.\n *\n * See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */\nexport class PathAttachment extends VertexAttachment {\n\n\t/** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */\n\tlengths: Array = [];\n\n\t/** If true, the start and end knots are connected. */\n\tclosed = false;\n\n\t/** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer\n\t * calculations are performed but calculating positions along the path is less accurate. */\n\tconstantSpeed = false;\n\n\t/** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually\n\t * rendered at runtime. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new PathAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.lengths = new Array(this.lengths.length);\n\t\tUtils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\n\t\tcopy.closed = closed;\n\t\tcopy.constantSpeed = this.constantSpeed;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"../Bone.js\";\nimport { Color, Vector2, MathUtils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be\n * used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a\n * skin.\n *\n * See [Point Attachments](http://esotericsoftware.com/spine-point-attachments) in the Spine User Guide. */\nexport class PointAttachment extends VertexAttachment {\n\tx: number = 0;\n\ty: number = 0;\n\trotation: number = 0;\n\n\t/** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.38, 0.94, 0, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcomputeWorldPosition (bone: Bone, point: Vector2) {\n\t\tpoint.x = this.x * bone.a + this.y * bone.b + bone.worldX;\n\t\tpoint.y = this.x * bone.c + this.y * bone.d + bone.worldY;\n\t\treturn point;\n\t}\n\n\tcomputeWorldRotation (bone: Bone) {\n\t\tconst r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\tconst x = cos * bone.a + sin * bone.b;\n\t\tconst y = cos * bone.c + sin * bone.d;\n\t\treturn MathUtils.atan2Deg(y, x);\t\t\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new PointAttachment(this.name);\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"../Bone.js\";\nimport { TextureRegion } from \"../Texture.js\";\nimport { Color, MathUtils, NumberArrayLike, Utils } from \"../Utils.js\";\nimport { Attachment } from \"./Attachment.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Sequence } from \"./Sequence.js\";\nimport { Slot } from \"../Slot.js\";\n\n/** An attachment that displays a textured quadrilateral.\n *\n * See [Region attachments](http://esotericsoftware.com/spine-regions) in the Spine User Guide. */\nexport class RegionAttachment extends Attachment implements HasTextureRegion {\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 1;\n\n\t/** The local scaleY. */\n\tscaleY = 1;\n\n\t/** The local rotation. */\n\trotation = 0;\n\n\t/** The width of the region attachment in Spine. */\n\twidth = 0;\n\n\t/** The height of the region attachment in Spine. */\n\theight = 0;\n\n\t/** The color to tint the region attachment. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\tregion: TextureRegion | null = null;\n\tsequence: Sequence | null = null;\n\n\t/** For each of the 4 vertices, a pair of x,y values that is the local position of the vertex.\n\t *\n\t * See {@link #updateOffset()}. */\n\toffset = Utils.newFloatArray(8);\n\n\tuvs = Utils.newFloatArray(8);\n\n\ttempColor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string, path: string) {\n\t\tsuper(name);\n\t\tthis.path = path;\n\t}\n\n\t/** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */\n\tupdateRegion (): void {\n\t\tif (!this.region) throw new Error(\"Region not set.\");\n\t\tlet region = this.region;\n\t\tlet uvs = this.uvs;\n\n\t\tif (region == null) {\n\t\t\tuvs[0] = 0;\n\t\t\tuvs[1] = 0;\n\t\t\tuvs[2] = 0;\n\t\t\tuvs[3] = 1;\n\t\t\tuvs[4] = 1;\n\t\t\tuvs[5] = 1;\n\t\t\tuvs[6] = 1;\n\t\t\tuvs[7] = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tlet regionScaleX = this.width / this.region.originalWidth * this.scaleX;\n\t\tlet regionScaleY = this.height / this.region.originalHeight * this.scaleY;\n\t\tlet localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\n\t\tlet localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\n\t\tlet localX2 = localX + this.region.width * regionScaleX;\n\t\tlet localY2 = localY + this.region.height * regionScaleY;\n\t\tlet radians = this.rotation * MathUtils.degRad;\n\t\tlet cos = Math.cos(radians);\n\t\tlet sin = Math.sin(radians);\n\t\tlet x = this.x, y = this.y;\n\t\tlet localXCos = localX * cos + x;\n\t\tlet localXSin = localX * sin;\n\t\tlet localYCos = localY * cos + y;\n\t\tlet localYSin = localY * sin;\n\t\tlet localX2Cos = localX2 * cos + x;\n\t\tlet localX2Sin = localX2 * sin;\n\t\tlet localY2Cos = localY2 * cos + y;\n\t\tlet localY2Sin = localY2 * sin;\n\t\tlet offset = this.offset;\n\t\toffset[0] = localXCos - localYSin;\n\t\toffset[1] = localYCos + localXSin;\n\t\toffset[2] = localXCos - localY2Sin;\n\t\toffset[3] = localY2Cos + localXSin;\n\t\toffset[4] = localX2Cos - localY2Sin;\n\t\toffset[5] = localY2Cos + localX2Sin;\n\t\toffset[6] = localX2Cos - localYSin;\n\t\toffset[7] = localYCos + localX2Sin;\n\n\t\tif (region.degrees == 90) {\n\t\t\tuvs[0] = region.u2;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v2;\n\t\t\tuvs[4] = region.u;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v;\n\t\t} else {\n\t\t\tuvs[0] = region.u;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v;\n\t\t\tuvs[4] = region.u2;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v2;\n\t\t}\n\t}\n\n\t/** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may\n\t * be changed.\n\t *

\n\t * See World transforms in the Spine\n\t * Runtimes Guide.\n\t * @param worldVertices The output world vertices. Must have a length >= offset + 8.\n\t * @param offset The worldVertices index to begin writing values.\n\t * @param stride The number of worldVertices entries between the value pairs written. */\n\tcomputeWorldVertices (slot: Slot, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tif (this.sequence != null)\n\t\t\tthis.sequence.apply(slot, this);\n\n\t\tlet bone = slot.bone;\n\t\tlet vertexOffset = this.offset;\n\t\tlet x = bone.worldX, y = bone.worldY;\n\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\tlet offsetX = 0, offsetY = 0;\n\n\t\toffsetX = vertexOffset[0];\n\t\toffsetY = vertexOffset[1];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // br\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[2];\n\t\toffsetY = vertexOffset[3];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // bl\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[4];\n\t\toffsetY = vertexOffset[5];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ul\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[6];\n\t\toffsetY = vertexOffset[7];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ur\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new RegionAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.scaleX = this.scaleX;\n\t\tcopy.scaleY = this.scaleY;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\n\t\tUtils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.sequence = this.sequence != null ? this.sequence.copy() : null;\n\t\treturn copy;\n\t}\n\n\tstatic X1 = 0;\n\tstatic Y1 = 1;\n\tstatic C1R = 2;\n\tstatic C1G = 3;\n\tstatic C1B = 4;\n\tstatic C1A = 5;\n\tstatic U1 = 6;\n\tstatic V1 = 7;\n\n\tstatic X2 = 8;\n\tstatic Y2 = 9;\n\tstatic C2R = 10;\n\tstatic C2G = 11;\n\tstatic C2B = 12;\n\tstatic C2A = 13;\n\tstatic U2 = 14;\n\tstatic V2 = 15;\n\n\tstatic X3 = 16;\n\tstatic Y3 = 17;\n\tstatic C3R = 18;\n\tstatic C3G = 19;\n\tstatic C3B = 20;\n\tstatic C3A = 21;\n\tstatic U3 = 22;\n\tstatic V3 = 23;\n\n\tstatic X4 = 24;\n\tstatic Y4 = 25;\n\tstatic C4R = 26;\n\tstatic C4G = 27;\n\tstatic C4B = 28;\n\tstatic C4A = 29;\n\tstatic U4 = 30;\n\tstatic V4 = 31;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { BoundingBoxAttachment } from \"./attachments/BoundingBoxAttachment.js\";\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { PointAttachment } from \"./attachments/PointAttachment.js\";\nimport { RegionAttachment } from \"./attachments/RegionAttachment.js\";\nimport { Skin } from \"./Skin.js\";\nimport { TextureAtlas } from \"./TextureAtlas.js\";\nimport { Sequence } from \"./attachments/Sequence.js\"\n\n/** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.\n *\n * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the\n * Spine Runtimes Guide. */\nexport class AtlasAttachmentLoader implements AttachmentLoader {\n\tatlas: TextureAtlas;\n\n\tconstructor (atlas: TextureAtlas) {\n\t\tthis.atlas = atlas;\n\t}\n\n\tloadSequence (name: string, basePath: string, sequence: Sequence) {\n\t\tlet regions = sequence.regions;\n\t\tfor (let i = 0, n = regions.length; i < n; i++) {\n\t\t\tlet path = sequence.getPath(basePath, i);\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (sequence: \" + name + \")\");\n\t\t\tregions[i] = region;\n\t\t}\n\t}\n\n\tnewRegionAttachment (skin: Skin, name: string, path: string, sequence: Sequence): RegionAttachment {\n\t\tlet attachment = new RegionAttachment(name, path);\n\t\tif (sequence != null) {\n\t\t\tthis.loadSequence(name, path, sequence);\n\t\t} else {\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (!region) throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\n\t\t\tattachment.region = region;\n\t\t}\n\t\treturn attachment;\n\t}\n\n\tnewMeshAttachment (skin: Skin, name: string, path: string, sequence: Sequence): MeshAttachment {\n\t\tlet attachment = new MeshAttachment(name, path);\n\t\tif (sequence != null) {\n\t\t\tthis.loadSequence(name, path, sequence);\n\t\t} else {\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (!region) throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\n\t\t\tattachment.region = region;\n\t\t}\n\t\treturn attachment;\n\t}\n\n\tnewBoundingBoxAttachment (skin: Skin, name: string): BoundingBoxAttachment {\n\t\treturn new BoundingBoxAttachment(name);\n\t}\n\n\tnewPathAttachment (skin: Skin, name: string): PathAttachment {\n\t\treturn new PathAttachment(name);\n\t}\n\n\tnewPointAttachment (skin: Skin, name: string): PointAttachment {\n\t\treturn new PointAttachment(name);\n\t}\n\n\tnewClippingAttachment (skin: Skin, name: string): ClippingAttachment {\n\t\treturn new ClippingAttachment(name);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color } from \"./Utils.js\";\n\n/** Stores the setup pose for a {@link Bone}. */\nexport class BoneData {\n\t/** The index of the bone in {@link Skeleton#getBones()}. */\n\tindex: number = 0;\n\n\t/** The name of the bone, which is unique across all bones in the skeleton. */\n\tname: string;\n\n\t/** @returns May be null. */\n\tparent: BoneData | null = null;\n\n\t/** The bone's length. */\n\tlength: number = 0;\n\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local rotation in degrees, counter clockwise. */\n\trotation = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 1;\n\n\t/** The local scaleY. */\n\tscaleY = 1;\n\n\t/** The local shearX. */\n\tshearX = 0;\n\n\t/** The local shearX. */\n\tshearY = 0;\n\n\t/** The transform mode for how parent world transforms affect this bone. */\n\tinherit = Inherit.Normal;\n\n\t/** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this\n\t * bone.\n\t * @see Skin#bones */\n\tskinRequired = false;\n\n\t/** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually\n\t * rendered at runtime. */\n\tcolor = new Color();\n\n\t/** The bone icon as it was in Spine, or null if nonessential data was not exported. */\n\ticon?: string;\n\n\t/** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */\n\tvisible = false;\n\n\tconstructor (index: number, name: string, parent: BoneData | null) {\n\t\tif (index < 0) throw new Error(\"index must be >= 0.\");\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.index = index;\n\t\tthis.name = name;\n\t\tthis.parent = parent;\n\t}\n}\n\n/** Determines how a bone inherits world transforms from parent bones. */\nexport enum Inherit { Normal, OnlyTranslation, NoRotationOrReflection, NoScale, NoScaleOrReflection }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData, Inherit } from \"./BoneData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils, Vector2 } from \"./Utils.js\";\n\n/** Stores a bone's current pose.\n *\n * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a\n * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a\n * constraint or application code modifies the world transform after it was computed from the local transform. */\nexport class Bone implements Updatable {\n\t/** The bone's setup pose data. */\n\tdata: BoneData;\n\n\t/** The skeleton this bone belongs to. */\n\tskeleton: Skeleton;\n\n\t/** The parent bone, or null if this is the root bone. */\n\tparent: Bone | null = null;\n\n\t/** The immediate children of this bone. */\n\tchildren = new Array();\n\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local rotation in degrees, counter clockwise. */\n\trotation = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 0;\n\n\t/** The local scaleY. */\n\tscaleY = 0;\n\n\t/** The local shearX. */\n\tshearX = 0;\n\n\t/** The local shearY. */\n\tshearY = 0;\n\n\t/** The applied local x translation. */\n\tax = 0;\n\n\t/** The applied local y translation. */\n\tay = 0;\n\n\t/** The applied local rotation in degrees, counter clockwise. */\n\tarotation = 0;\n\n\t/** The applied local scaleX. */\n\tascaleX = 0;\n\n\t/** The applied local scaleY. */\n\tascaleY = 0;\n\n\t/** The applied local shearX. */\n\tashearX = 0;\n\n\t/** The applied local shearY. */\n\tashearY = 0;\n\n\t/** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\ta = 0;\n\n\t/** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\tb = 0;\n\n\t/** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\tc = 0;\n\n\t/** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\td = 0;\n\n\t/** The world X position. If changed, {@link #updateAppliedTransform()} should be called. */\n\tworldY = 0;\n\n\t/** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */\n\tworldX = 0;\n\n\tinherit: Inherit = Inherit.Normal;\n\n\tsorted = false;\n\tactive = false;\n\n\t/** @param parent May be null. */\n\tconstructor (data: BoneData, skeleton: Skeleton, parent: Bone | null) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\t\tthis.skeleton = skeleton;\n\t\tthis.parent = parent;\n\t\tthis.setToSetupPose();\n\t}\n\n\t/** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the\n\t * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\t/** Computes the world transform using the parent bone and this bone's local applied transform. */\n\tupdate (physics: Physics) {\n\t\tthis.updateWorldTransformWith(this.ax, this.ay, this.arotation, this.ascaleX, this.ascaleY, this.ashearX, this.ashearY);\n\t}\n\n\t/** Computes the world transform using the parent bone and this bone's local transform.\n\t *\n\t * See {@link #updateWorldTransformWith()}. */\n\tupdateWorldTransform () {\n\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n\t}\n\n\t/** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the\n\t * specified local transform. Child bones are not updated.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide. */\n\tupdateWorldTransformWith (x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number) {\n\t\tthis.ax = x;\n\t\tthis.ay = y;\n\t\tthis.arotation = rotation;\n\t\tthis.ascaleX = scaleX;\n\t\tthis.ascaleY = scaleY;\n\t\tthis.ashearX = shearX;\n\t\tthis.ashearY = shearY;\n\n\t\tlet parent = this.parent;\n\t\tif (!parent) { // Root bone.\n\t\t\tlet skeleton = this.skeleton;\n\t\t\tconst sx = skeleton.scaleX, sy = skeleton.scaleY;\n\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\tthis.a = Math.cos(rx) * scaleX * sx;\n\t\t\tthis.b = Math.cos(ry) * scaleY * sx;\n\t\t\tthis.c = Math.sin(rx) * scaleX * sy;\n\t\t\tthis.d = Math.sin(ry) * scaleY * sy;\n\t\t\tthis.worldX = x * sx + skeleton.x;\n\t\t\tthis.worldY = y * sy + skeleton.y;\n\t\t\treturn;\n\t\t}\n\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\tthis.worldX = pa * x + pb * y + parent.worldX;\n\t\tthis.worldY = pc * x + pd * y + parent.worldY;\n\n\t\tswitch (this.inherit) {\n\t\t\tcase Inherit.Normal: {\n\t\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = pa * la + pb * lc;\n\t\t\t\tthis.b = pa * lb + pb * ld;\n\t\t\t\tthis.c = pc * la + pd * lc;\n\t\t\t\tthis.d = pc * lb + pd * ld;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase Inherit.OnlyTranslation: {\n\t\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\t\tthis.a = Math.cos(rx) * scaleX;\n\t\t\t\tthis.b = Math.cos(ry) * scaleY;\n\t\t\t\tthis.c = Math.sin(rx) * scaleX;\n\t\t\t\tthis.d = Math.sin(ry) * scaleY;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\tlet sx = 1 / this.skeleton.scaleX, sy = 1 / this.skeleton.scaleY;\n\t\t\t\tpa *= sx;\n\t\t\t\tpc *= sy;\n\t\t\t\tlet s = pa * pa + pc * pc;\n\t\t\t\tlet prx = 0;\n\t\t\t\tif (s > 0.0001) {\n\t\t\t\t\ts = Math.abs(pa * pd * sy - pb * sx * pc) / s;\n\t\t\t\t\tpb = pc * s;\n\t\t\t\t\tpd = pa * s;\n\t\t\t\t\tprx = Math.atan2(pc, pa) * MathUtils.radDeg;\n\t\t\t\t} else {\n\t\t\t\t\tpa = 0;\n\t\t\t\t\tpc = 0;\n\t\t\t\t\tprx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\n\t\t\t\t}\n\t\t\t\tconst rx = (rotation + shearX - prx) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + shearY - prx + 90) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = pa * la - pb * lc;\n\t\t\t\tthis.b = pa * lb - pb * ld;\n\t\t\t\tthis.c = pc * la + pd * lc;\n\t\t\t\tthis.d = pc * lb + pd * ld;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Inherit.NoScale:\n\t\t\tcase Inherit.NoScaleOrReflection: {\n\t\t\t\trotation *= MathUtils.degRad;\n\t\t\t\tconst cos = Math.cos(rotation), sin = Math.sin(rotation);\n\t\t\t\tlet za = (pa * cos + pb * sin) / this.skeleton.scaleX;\n\t\t\t\tlet zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\n\t\t\t\tlet s = Math.sqrt(za * za + zc * zc);\n\t\t\t\tif (s > 0.00001) s = 1 / s;\n\t\t\t\tza *= s;\n\t\t\t\tzc *= s;\n\t\t\t\ts = Math.sqrt(za * za + zc * zc);\n\t\t\t\tif (this.inherit == Inherit.NoScale\n\t\t\t\t\t&& (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) s = -s;\n\t\t\t\trotation = Math.PI / 2 + Math.atan2(zc, za);\n\t\t\t\tconst zb = Math.cos(rotation) * s;\n\t\t\t\tconst zd = Math.sin(rotation) * s;\n\t\t\t\tshearX *= MathUtils.degRad;\n\t\t\t\tshearY = (90 + shearY) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(shearX) * scaleX;\n\t\t\t\tconst lb = Math.cos(shearY) * scaleY;\n\t\t\t\tconst lc = Math.sin(shearX) * scaleX;\n\t\t\t\tconst ld = Math.sin(shearY) * scaleY;\n\t\t\t\tthis.a = za * la + zb * lc;\n\t\t\t\tthis.b = za * lb + zb * ld;\n\t\t\t\tthis.c = zc * la + zd * lc;\n\t\t\t\tthis.d = zc * lb + zd * ld;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.a *= this.skeleton.scaleX;\n\t\tthis.b *= this.skeleton.scaleX;\n\t\tthis.c *= this.skeleton.scaleY;\n\t\tthis.d *= this.skeleton.scaleY;\n\t}\n\n\t/** Sets this bone's local transform to the setup pose. */\n\tsetToSetupPose () {\n\t\tlet data = this.data;\n\t\tthis.x = data.x;\n\t\tthis.y = data.y;\n\t\tthis.rotation = data.rotation;\n\t\tthis.scaleX = data.scaleX;\n\t\tthis.scaleY = data.scaleY;\n\t\tthis.shearX = data.shearX;\n\t\tthis.shearY = data.shearY;\n\t\tthis.inherit = data.inherit;\n\t}\n\n\t/** Computes the applied transform values from the world transform.\n\t *\n\t * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so\n\t * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other\n\t * constraints).\n\t *\n\t * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after\n\t * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */\n\tupdateAppliedTransform () {\n\t\tlet parent = this.parent;\n\t\tif (!parent) {\n\t\t\tthis.ax = this.worldX - this.skeleton.x;\n\t\t\tthis.ay = this.worldY - this.skeleton.y;\n\t\t\tthis.arotation = Math.atan2(this.c, this.a) * MathUtils.radDeg;\n\t\t\tthis.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\n\t\t\tthis.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\n\t\t\tthis.ashearX = 0;\n\t\t\tthis.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * MathUtils.radDeg;\n\t\t\treturn;\n\t\t}\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\tlet pid = 1 / (pa * pd - pb * pc);\n\t\tlet ia = pd * pid, ib = pb * pid, ic = pc * pid, id = pa * pid;\n\t\tlet dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\n\t\tthis.ax = (dx * ia - dy * ib);\n\t\tthis.ay = (dy * id - dx * ic);\n\n\t\tlet ra, rb, rc, rd;\n\t\tif (this.inherit == Inherit.OnlyTranslation) {\n\t\t\tra = this.a;\n\t\t\trb = this.b;\n\t\t\trc = this.c;\n\t\t\trd = this.d;\n\t\t} else {\n\t\t\tswitch (this.inherit) {\n\t\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\t\tlet s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\n\t\t\t\t\tpb = -pc * this.skeleton.scaleX * s / this.skeleton.scaleY;\n\t\t\t\t\tpd = pa * this.skeleton.scaleY * s / this.skeleton.scaleX;\n\t\t\t\t\tpid = 1 / (pa * pd - pb * pc);\n\t\t\t\t\tia = pd * pid;\n\t\t\t\t\tib = pb * pid;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase Inherit.NoScale:\n\t\t\t\tcase Inherit.NoScaleOrReflection:\n\t\t\t\t\tlet cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\n\t\t\t\t\tpa = (pa * cos + pb * sin) / this.skeleton.scaleX;\n\t\t\t\t\tpc = (pc * cos + pd * sin) / this.skeleton.scaleY;\n\t\t\t\t\tlet s = Math.sqrt(pa * pa + pc * pc);\n\t\t\t\t\tif (s > 0.00001) s = 1 / s;\n\t\t\t\t\tpa *= s;\n\t\t\t\t\tpc *= s;\n\t\t\t\t\ts = Math.sqrt(pa * pa + pc * pc);\n\t\t\t\t\tif (this.inherit == Inherit.NoScale && pid < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) s = -s;\n\t\t\t\t\tlet r = MathUtils.PI / 2 + Math.atan2(pc, pa);\n\t\t\t\t\tpb = Math.cos(r) * s;\n\t\t\t\t\tpd = Math.sin(r) * s;\n\t\t\t\t\tpid = 1 / (pa * pd - pb * pc);\n\t\t\t\t\tia = pd * pid;\n\t\t\t\t\tib = pb * pid;\n\t\t\t\t\tic = pc * pid;\n\t\t\t\t\tid = pa * pid;\n\t\t\t}\n\t\t\tra = ia * this.a - ib * this.c;\n\t\t\trb = ia * this.b - ib * this.d;\n\t\t\trc = id * this.c - ic * this.a;\n\t\t\trd = id * this.d - ic * this.b;\n\t\t}\n\n\t\tthis.ashearX = 0;\n\t\tthis.ascaleX = Math.sqrt(ra * ra + rc * rc);\n\t\tif (this.ascaleX > 0.0001) {\n\t\t\tlet det = ra * rd - rb * rc;\n\t\t\tthis.ascaleY = det / this.ascaleX;\n\t\t\tthis.ashearY = -Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\n\t\t\tthis.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\n\t\t} else {\n\t\t\tthis.ascaleX = 0;\n\t\t\tthis.ascaleY = Math.sqrt(rb * rb + rd * rd);\n\t\t\tthis.ashearY = 0;\n\t\t\tthis.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\n\t\t}\n\t}\n\n\n\t/** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */\n\tgetWorldRotationX () {\n\t\treturn Math.atan2(this.c, this.a) * MathUtils.radDeg;\n\t}\n\n\t/** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */\n\tgetWorldRotationY () {\n\t\treturn Math.atan2(this.d, this.b) * MathUtils.radDeg;\n\t}\n\n\t/** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */\n\tgetWorldScaleX () {\n\t\treturn Math.sqrt(this.a * this.a + this.c * this.c);\n\t}\n\n\t/** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */\n\tgetWorldScaleY () {\n\t\treturn Math.sqrt(this.b * this.b + this.d * this.d);\n\t}\n\n\t/** Transforms a point from world coordinates to the bone's local coordinates. */\n\tworldToLocal (world: Vector2) {\n\t\tlet invDet = 1 / (this.a * this.d - this.b * this.c);\n\t\tlet x = world.x - this.worldX, y = world.y - this.worldY;\n\t\tworld.x = x * this.d * invDet - y * this.b * invDet;\n\t\tworld.y = y * this.a * invDet - x * this.c * invDet;\n\t\treturn world;\n\t}\n\n\t/** Transforms a point from the bone's local coordinates to world coordinates. */\n\tlocalToWorld (local: Vector2) {\n\t\tlet x = local.x, y = local.y;\n\t\tlocal.x = x * this.a + y * this.b + this.worldX;\n\t\tlocal.y = x * this.c + y * this.d + this.worldY;\n\t\treturn local;\n\t}\n\n\t/** Transforms a point from world coordinates to the parent bone's local coordinates. */\n\tworldToParent (world: Vector2) {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\treturn this.parent == null ? world : this.parent.worldToLocal(world);\n\t}\n\n\t/** Transforms a point from the parent bone's coordinates to world coordinates. */\n\tparentToWorld (world: Vector2) {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\treturn this.parent == null ? world : this.parent.localToWorld(world);\n\t}\n\n\t/** Transforms a world rotation to a local rotation. */\n\tworldToLocalRotation (worldRotation: number) {\n\t\tlet sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\n\t\treturn Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * MathUtils.radDeg + this.rotation - this.shearX;\n\t}\n\n\t/** Transforms a local rotation to a world rotation. */\n\tlocalToWorldRotation (localRotation: number) {\n\t\tlocalRotation -= this.rotation - this.shearX;\n\t\tlet sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\n\t\treturn Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * MathUtils.radDeg;\n\t}\n\n\t/** Rotates the world transform the specified amount.\n\t *

\n\t * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and\n\t * {@link #update(Physics)} will need to be called on any child bones, recursively. */\n\trotateWorld (degrees: number) {\n\t\tdegrees *= MathUtils.degRad;\n\t\tconst sin = Math.sin(degrees), cos = Math.cos(degrees);\n\t\tconst ra = this.a, rb = this.b;\n\t\tthis.a = cos * ra - sin * this.c;\n\t\tthis.b = cos * rb - sin * this.d;\n\t\tthis.c = sin * ra + cos * this.c;\n\t\tthis.d = sin * rb + cos * this.d;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** The base class for all constraint datas. */\nexport abstract class ConstraintData {\n\tconstructor (public name: string, public order: number, public skinRequired: boolean) { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture } from \"./Texture.js\";\nimport { TextureAtlas } from \"./TextureAtlas.js\";\nimport { Disposable, StringMap } from \"./Utils.js\";\n\nexport class AssetManagerBase implements Disposable {\n\tprivate pathPrefix: string = \"\";\n\tprivate textureLoader: (image: HTMLImageElement | ImageBitmap) => Texture;\n\tprivate downloader: Downloader;\n\tprivate assets: StringMap = {};\n\tprivate errors: StringMap = {};\n\tprivate toLoad = 0;\n\tprivate loaded = 0;\n\n\tconstructor (textureLoader: (image: HTMLImageElement | ImageBitmap) => Texture, pathPrefix: string = \"\", downloader: Downloader = new Downloader()) {\n\t\tthis.textureLoader = textureLoader;\n\t\tthis.pathPrefix = pathPrefix;\n\t\tthis.downloader = downloader;\n\t}\n\n\tprivate start (path: string): string {\n\t\tthis.toLoad++;\n\t\treturn this.pathPrefix + path;\n\t}\n\n\tprivate success (callback: (path: string, data: any) => void, path: string, asset: any) {\n\t\tthis.toLoad--;\n\t\tthis.loaded++;\n\t\tthis.assets[path] = asset;\n\t\tif (callback) callback(path, asset);\n\t}\n\n\tprivate error (callback: (path: string, message: string) => void, path: string, message: string) {\n\t\tthis.toLoad--;\n\t\tthis.loaded++;\n\t\tthis.errors[path] = message;\n\t\tif (callback) callback(path, message);\n\t}\n\n\tloadAll () {\n\t\tlet promise = new Promise((resolve: (assetManager: AssetManagerBase) => void, reject: (errors: StringMap) => void) => {\n\t\t\tlet check = () => {\n\t\t\t\tif (this.isLoadingComplete()) {\n\t\t\t\t\tif (this.hasErrors()) reject(this.errors);\n\t\t\t\t\telse resolve(this);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trequestAnimationFrame(check);\n\t\t\t}\n\t\t\trequestAnimationFrame(check);\n\t\t});\n\t\treturn promise;\n\t}\n\n\tsetRawDataURI (path: string, data: string) {\n\t\tthis.downloader.rawDataUris[this.pathPrefix + path] = data;\n\t}\n\n\tloadBinary (path: string,\n\t\tsuccess: (path: string, binary: Uint8Array) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadBinary(path, (data: Uint8Array): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load binary ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadText (path: string,\n\t\tsuccess: (path: string, text: string) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadText(path, (data: string): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load text ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadJson (path: string,\n\t\tsuccess: (path: string, object: object) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadJson(path, (data: object): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load JSON ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadTexture (path: string,\n\t\tsuccess: (path: string, texture: Texture) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tlet isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document);\n\t\tlet isWebWorker = !isBrowser; // && typeof importScripts !== 'undefined';\n\t\tif (isWebWorker) {\n\t\t\tfetch(path, { mode: \"cors\" }).then((response) => {\n\t\t\t\tif (response.ok) return response.blob();\n\t\t\t\tthis.error(error, path, `Couldn't load image: ${path}`);\n\t\t\t\treturn null;\n\t\t\t}).then((blob) => {\n\t\t\t\treturn blob ? createImageBitmap(blob, { premultiplyAlpha: \"none\", colorSpaceConversion: \"none\" }) : null;\n\t\t\t}).then((bitmap) => {\n\t\t\t\tif (bitmap) this.success(success, path, this.textureLoader(bitmap));\n\t\t\t});\n\t\t} else {\n\t\t\tlet image = new Image();\n\t\t\timage.crossOrigin = \"anonymous\";\n\t\t\timage.onload = () => {\n\t\t\t\tthis.success(success, path, this.textureLoader(image));\n\t\t\t};\n\t\t\timage.onerror = () => {\n\t\t\t\tthis.error(error, path, `Couldn't load image: ${path}`);\n\t\t\t};\n\t\t\tif (this.downloader.rawDataUris[path]) path = this.downloader.rawDataUris[path];\n\t\t\timage.src = path;\n\t\t}\n\t}\n\n\tloadTextureAtlas (path: string,\n\t\tsuccess: (path: string, atlas: TextureAtlas) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { },\n\t\tfileAlias?: { [keyword: string]: string }\n\t) {\n\t\tlet index = path.lastIndexOf(\"/\");\n\t\tlet parent = index >= 0 ? path.substring(0, index + 1) : \"\";\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadText(path, (atlasText: string): void => {\n\t\t\ttry {\n\t\t\t\tlet atlas = new TextureAtlas(atlasText);\n\t\t\t\tlet toLoad = atlas.pages.length, abort = false;\n\t\t\t\tfor (let page of atlas.pages) {\n\t\t\t\t\tthis.loadTexture(!fileAlias ? parent + page.name : fileAlias[page.name!],\n\t\t\t\t\t\t(imagePath: string, texture: Texture) => {\n\t\t\t\t\t\t\tif (!abort) {\n\t\t\t\t\t\t\t\tpage.setTexture(texture);\n\t\t\t\t\t\t\t\tif (--toLoad == 0) this.success(success, path, atlas);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(imagePath: string, message: string) => {\n\t\t\t\t\t\t\tif (!abort) this.error(error, path, `Couldn't load texture atlas ${path} page image: ${imagePath}`);\n\t\t\t\t\t\t\tabort = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tthis.error(error, path, `Couldn't parse texture atlas ${path}: ${(e as any).message}`);\n\t\t\t}\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tget (path: string) {\n\t\treturn this.assets[this.pathPrefix + path];\n\t}\n\n\trequire (path: string) {\n\t\tpath = this.pathPrefix + path;\n\t\tlet asset = this.assets[path];\n\t\tif (asset) return asset;\n\t\tlet error = this.errors[path];\n\t\tthrow Error(\"Asset not found: \" + path + (error ? \"\\n\" + error : \"\"));\n\t}\n\n\tremove (path: string) {\n\t\tpath = this.pathPrefix + path;\n\t\tlet asset = this.assets[path];\n\t\tif ((asset).dispose) (asset).dispose();\n\t\tdelete this.assets[path];\n\t\treturn asset;\n\t}\n\n\tremoveAll () {\n\t\tfor (let key in this.assets) {\n\t\t\tlet asset = this.assets[key];\n\t\t\tif ((asset).dispose) (asset).dispose();\n\t\t}\n\t\tthis.assets = {};\n\t}\n\n\tisLoadingComplete (): boolean {\n\t\treturn this.toLoad == 0;\n\t}\n\n\tgetToLoad (): number {\n\t\treturn this.toLoad;\n\t}\n\n\tgetLoaded (): number {\n\t\treturn this.loaded;\n\t}\n\n\tdispose () {\n\t\tthis.removeAll();\n\t}\n\n\thasErrors () {\n\t\treturn Object.keys(this.errors).length > 0;\n\t}\n\n\tgetErrors () {\n\t\treturn this.errors;\n\t}\n}\n\nexport class Downloader {\n\tprivate callbacks: StringMap> = {};\n\trawDataUris: StringMap = {};\n\n\tdataUriToString (dataUri: string) {\n\t\tif (!dataUri.startsWith(\"data:\")) {\n\t\t\tthrow new Error(\"Not a data URI.\");\n\t\t}\n\n\t\tlet base64Idx = dataUri.indexOf(\"base64,\");\n\t\tif (base64Idx != -1) {\n\t\t\tbase64Idx += \"base64,\".length;\n\t\t\treturn atob(dataUri.substr(base64Idx));\n\t\t} else {\n\t\t\treturn dataUri.substr(dataUri.indexOf(\",\") + 1);\n\t\t}\n\t}\n\n\tbase64ToUint8Array (base64: string) {\n\t\tvar binary_string = window.atob(base64);\n\t\tvar len = binary_string.length;\n\t\tvar bytes = new Uint8Array(len);\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tbytes[i] = binary_string.charCodeAt(i);\n\t\t}\n\t\treturn bytes;\n\t}\n\n\tdataUriToUint8Array (dataUri: string) {\n\t\tif (!dataUri.startsWith(\"data:\")) {\n\t\t\tthrow new Error(\"Not a data URI.\");\n\t\t}\n\n\t\tlet base64Idx = dataUri.indexOf(\"base64,\");\n\t\tif (base64Idx == -1) throw new Error(\"Not a binary data URI.\");\n\t\tbase64Idx += \"base64,\".length;\n\t\treturn this.base64ToUint8Array(dataUri.substr(base64Idx));\n\t}\n\n\tdownloadText (url: string, success: (data: string) => void, error: (status: number, responseText: string) => void) {\n\t\tif (this.start(url, success, error)) return;\n\t\tif (this.rawDataUris[url]) {\n\t\t\ttry {\n\t\t\t\tlet dataUri = this.rawDataUris[url];\n\t\t\t\tthis.finish(url, 200, this.dataUriToString(dataUri));\n\t\t\t} catch (e) {\n\t\t\t\tthis.finish(url, 400, JSON.stringify(e));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet request = new XMLHttpRequest();\n\t\trequest.overrideMimeType(\"text/html\");\n\t\trequest.open(\"GET\", url, true);\n\t\tlet done = () => {\n\t\t\tthis.finish(url, request.status, request.responseText);\n\t\t};\n\t\trequest.onload = done;\n\t\trequest.onerror = done;\n\t\trequest.send();\n\t}\n\n\tdownloadJson (url: string, success: (data: object) => void, error: (status: number, responseText: string) => void) {\n\t\tthis.downloadText(url, (data: string): void => {\n\t\t\tsuccess(JSON.parse(data));\n\t\t}, error);\n\t}\n\n\tdownloadBinary (url: string, success: (data: Uint8Array) => void, error: (status: number, responseText: string) => void) {\n\t\tif (this.start(url, success, error)) return;\n\t\tif (this.rawDataUris[url]) {\n\t\t\ttry {\n\t\t\t\tlet dataUri = this.rawDataUris[url];\n\t\t\t\tthis.finish(url, 200, this.dataUriToUint8Array(dataUri));\n\t\t\t} catch (e) {\n\t\t\t\tthis.finish(url, 400, JSON.stringify(e));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet request = new XMLHttpRequest();\n\t\trequest.open(\"GET\", url, true);\n\t\trequest.responseType = \"arraybuffer\";\n\t\tlet onerror = () => {\n\t\t\tthis.finish(url, request.status, request.response);\n\t\t};\n\t\trequest.onload = () => {\n\t\t\tif (request.status == 200 || request.status == 0)\n\t\t\t\tthis.finish(url, 200, new Uint8Array(request.response as ArrayBuffer));\n\t\t\telse\n\t\t\t\tonerror();\n\t\t};\n\t\trequest.onerror = onerror;\n\t\trequest.send();\n\t}\n\n\tprivate start (url: string, success: any, error: any) {\n\t\tlet callbacks = this.callbacks[url];\n\t\ttry {\n\t\t\tif (callbacks) return true;\n\t\t\tthis.callbacks[url] = callbacks = [];\n\t\t} finally {\n\t\t\tcallbacks.push(success, error);\n\t\t}\n\t}\n\n\tprivate finish (url: string, status: number, data: any) {\n\t\tlet callbacks = this.callbacks[url];\n\t\tdelete this.callbacks[url];\n\t\tlet args = status == 200 || status == 0 ? [data] : [status, data];\n\t\tfor (let i = args.length - 1, n = callbacks.length; i < n; i += 2)\n\t\t\tcallbacks[i].apply(null, args);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { EventData } from \"./EventData.js\";\n\n/** Stores the current pose values for an {@link Event}.\n *\n * See Timeline {@link Timeline#apply()},\n * AnimationStateListener {@link AnimationStateListener#event()}, and\n * [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */\nexport class Event {\n\tdata: EventData;\n\tintValue: number = 0;\n\tfloatValue: number = 0;\n\tstringValue: string | null = null;\n\ttime: number = 0;\n\tvolume: number = 0;\n\tbalance: number = 0;\n\n\tconstructor (time: number, data: EventData) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tthis.time = time;\n\t\tthis.data = data;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** Stores the setup pose values for an {@link Event}.\n *\n * See [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */\nexport class EventData {\n\tname: string;\n\tintValue: number = 0;\n\tfloatValue: number = 0;\n\tstringValue: string | null = null;\n\taudioPath: string | null = null;\n\tvolume: number = 0;\n\tbalance: number = 0;\n\n\tconstructor (name: string) {\n\t\tthis.name = name;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { Inherit } from \"./BoneData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n/** Stores the current pose for an IK constraint. An IK constraint adjusts the rotation of 1 or 2 constrained bones so the tip of\n * the last bone is as close to the target bone as possible.\n *\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide. */\nexport class IkConstraint implements Updatable {\n\t/** The IK constraint's setup pose data. */\n\tdata: IkConstraintData;\n\n\t/** The bones that will be modified by this IK constraint. */\n\tbones: Array;\n\n\t/** The bone that is the IK target. */\n\ttarget: Bone;\n\n\t/** Controls the bend direction of the IK bones, either 1 or -1. */\n\tbendDirection = 0;\n\n\t/** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\n\tcompress = false;\n\n\t/** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\n\t * and the parent bone has local nonuniform scale, stretch is not applied. */\n\tstretch = false;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\n\tmix = 1;\n\n\t/** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\n\tsoftness = 0;\n\tactive = false;\n\n\tconstructor (data: IkConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findBone(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find bone ${data.target.name}`);\n\n\t\tthis.target = target;\n\t\tthis.mix = data.mix;\n\t\tthis.softness = data.softness;\n\t\tthis.bendDirection = data.bendDirection;\n\t\tthis.compress = data.compress;\n\t\tthis.stretch = data.stretch;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.mix = data.mix;\n\t\tthis.softness = data.softness;\n\t\tthis.bendDirection = data.bendDirection;\n\t\tthis.compress = data.compress;\n\t\tthis.stretch = data.stretch;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tif (this.mix == 0) return;\n\t\tlet target = this.target;\n\t\tlet bones = this.bones;\n\t\tswitch (bones.length) {\n\t\t\tcase 1:\n\t\t\t\tthis.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tthis.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.data.uniform, this.softness, this.mix);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** Applies 1 bone IK. The target is specified in the world coordinate system. */\n\tapply1 (bone: Bone, targetX: number, targetY: number, compress: boolean, stretch: boolean, uniform: boolean, alpha: number) {\n\t\tlet p = bone.parent;\n\t\tif (!p) throw new Error(\"IK bone must have parent.\");\n\t\tlet pa = p.a, pb = p.b, pc = p.c, pd = p.d;\n\t\tlet rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\n\n\t\tswitch (bone.inherit) {\n\t\t\tcase Inherit.OnlyTranslation:\n\t\t\t\ttx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX);\n\t\t\t\tty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY);\n\t\t\t\tbreak;\n\t\t\tcase Inherit.NoRotationOrReflection:\n\t\t\t\tlet s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc);\n\t\t\t\tlet sa = pa / bone.skeleton.scaleX;\n\t\t\t\tlet sc = pc / bone.skeleton.scaleY;\n\t\t\t\tpb = -sc * s * bone.skeleton.scaleX;\n\t\t\t\tpd = sa * s * bone.skeleton.scaleY;\n\t\t\t\trotationIK += Math.atan2(sc, sa) * MathUtils.radDeg;\n\t\t\t// Fall through\n\t\t\tdefault:\n\t\t\t\tlet x = targetX - p.worldX, y = targetY - p.worldY;\n\t\t\t\tlet d = pa * pd - pb * pc;\n\t\t\t\tif (Math.abs(d) <= 0.0001) {\n\t\t\t\t\ttx = 0;\n\t\t\t\t\tty = 0;\n\t\t\t\t} else {\n\t\t\t\t\ttx = (x * pd - y * pb) / d - bone.ax;\n\t\t\t\t\tty = (y * pa - x * pc) / d - bone.ay;\n\t\t\t\t}\n\t\t}\n\t\trotationIK += Math.atan2(ty, tx) * MathUtils.radDeg;\n\t\tif (bone.ascaleX < 0) rotationIK += 180;\n\t\tif (rotationIK > 180)\n\t\t\trotationIK -= 360;\n\t\telse if (rotationIK < -180)\n\t\t\trotationIK += 360;\n\t\tlet sx = bone.ascaleX, sy = bone.ascaleY;\n\t\tif (compress || stretch) {\n\t\t\tswitch (bone.inherit) {\n\t\t\t\tcase Inherit.NoScale:\n\t\t\t\tcase Inherit.NoScaleOrReflection:\n\t\t\t\t\ttx = targetX - bone.worldX;\n\t\t\t\t\tty = targetY - bone.worldY;\n\t\t\t}\n\t\t\tconst b = bone.data.length * sx;\n\t\t\tif (b > 0.0001) {\n\t\t\t\tconst dd = tx * tx + ty * ty;\n\t\t\t\tif ((compress && dd < b * b) || (stretch && dd > b * b)) {\n\t\t\t\t\tconst s = (Math.sqrt(dd) / b - 1) * alpha + 1;\n\t\t\t\t\tsx *= s;\n\t\t\t\t\tif (uniform) sy *= s;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX,\n\t\t\tbone.ashearY);\n\t}\n\n\t/** Applies 2 bone IK. The target is specified in the world coordinate system.\n\t * @param child A direct descendant of the parent bone. */\n\tapply2 (parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, stretch: boolean, uniform: boolean, softness: number, alpha: number) {\n\t\tif (parent.inherit != Inherit.Normal || child.inherit != Inherit.Normal) return;\n\t\tlet px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX;\n\t\tlet os1 = 0, os2 = 0, s2 = 0;\n\t\tif (psx < 0) {\n\t\t\tpsx = -psx;\n\t\t\tos1 = 180;\n\t\t\ts2 = -1;\n\t\t} else {\n\t\t\tos1 = 0;\n\t\t\ts2 = 1;\n\t\t}\n\t\tif (psy < 0) {\n\t\t\tpsy = -psy;\n\t\t\ts2 = -s2;\n\t\t}\n\t\tif (csx < 0) {\n\t\t\tcsx = -csx;\n\t\t\tos2 = 180;\n\t\t} else\n\t\t\tos2 = 0;\n\t\tlet cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\n\t\tlet u = Math.abs(psx - psy) <= 0.0001;\n\t\tif (!u || stretch) {\n\t\t\tcy = 0;\n\t\t\tcwx = a * cx + parent.worldX;\n\t\t\tcwy = c * cx + parent.worldY;\n\t\t} else {\n\t\t\tcy = child.ay;\n\t\t\tcwx = a * cx + b * cy + parent.worldX;\n\t\t\tcwy = c * cx + d * cy + parent.worldY;\n\t\t}\n\t\tlet pp = parent.parent;\n\t\tif (!pp) throw new Error(\"IK parent must itself have a parent.\");\n\t\ta = pp.a;\n\t\tb = pp.b;\n\t\tc = pp.c;\n\t\td = pp.d;\n\t\tlet id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY;\n\t\tid = Math.abs(id) <= 0.0001 ? 0 : 1 / id;\n\t\tlet dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\n\t\tlet l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\n\t\tif (l1 < 0.0001) {\n\t\t\tthis.apply1(parent, targetX, targetY, false, stretch, false, alpha);\n\t\t\tchild.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n\t\t\treturn;\n\t\t}\n\t\tx = targetX - pp.worldX;\n\t\ty = targetY - pp.worldY;\n\t\tlet tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\n\t\tlet dd = tx * tx + ty * ty;\n\t\tif (softness != 0) {\n\t\t\tsoftness *= psx * (csx + 1) * 0.5;\n\t\t\tlet td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\n\t\t\tif (sd > 0) {\n\t\t\t\tlet p = Math.min(1, sd / (softness * 2)) - 1;\n\t\t\t\tp = (sd - softness * (1 - p * p)) / td;\n\t\t\t\ttx -= p * tx;\n\t\t\t\tty -= p * ty;\n\t\t\t\tdd = tx * tx + ty * ty;\n\t\t\t}\n\t\t}\n\t\touter:\n\t\tif (u) {\n\t\t\tl2 *= psx;\n\t\t\tlet cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\n\t\t\tif (cos < -1) {\n\t\t\t\tcos = -1;\n\t\t\t\ta2 = Math.PI * bendDir;\n\t\t\t} else if (cos > 1) {\n\t\t\t\tcos = 1;\n\t\t\t\ta2 = 0;\n\t\t\t\tif (stretch) {\n\t\t\t\t\ta = (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\n\t\t\t\t\tsx *= a;\n\t\t\t\t\tif (uniform) sy *= a;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\ta2 = Math.acos(cos) * bendDir;\n\t\t\ta = l1 + l2 * cos;\n\t\t\tb = l2 * Math.sin(a2);\n\t\t\ta1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\n\t\t} else {\n\t\t\ta = psx * l2;\n\t\t\tb = psy * l2;\n\t\t\tlet aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\n\t\t\tc = bb * l1 * l1 + aa * dd - aa * bb;\n\t\t\tlet c1 = -2 * bb * l1, c2 = bb - aa;\n\t\t\td = c1 * c1 - 4 * c2 * c;\n\t\t\tif (d >= 0) {\n\t\t\t\tlet q = Math.sqrt(d);\n\t\t\t\tif (c1 < 0) q = -q;\n\t\t\t\tq = -(c1 + q) * 0.5;\n\t\t\t\tlet r0 = q / c2, r1 = c / q;\n\t\t\t\tlet r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\n\t\t\t\tr0 = dd - r * r;\n\t\t\t\tif (r0 >= 0) {\n\t\t\t\t\ty = Math.sqrt(r0) * bendDir;\n\t\t\t\t\ta1 = ta - Math.atan2(y, r);\n\t\t\t\t\ta2 = Math.atan2(y / psy, (r - l1) / psx);\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\n\t\t\tlet maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\n\t\t\tc = -a * l1 / (aa - bb);\n\t\t\tif (c >= -1 && c <= 1) {\n\t\t\t\tc = Math.acos(c);\n\t\t\t\tx = a * Math.cos(c) + l1;\n\t\t\t\ty = b * Math.sin(c);\n\t\t\t\td = x * x + y * y;\n\t\t\t\tif (d < minDist) {\n\t\t\t\t\tminAngle = c;\n\t\t\t\t\tminDist = d;\n\t\t\t\t\tminX = x;\n\t\t\t\t\tminY = y;\n\t\t\t\t}\n\t\t\t\tif (d > maxDist) {\n\t\t\t\t\tmaxAngle = c;\n\t\t\t\t\tmaxDist = d;\n\t\t\t\t\tmaxX = x;\n\t\t\t\t\tmaxY = y;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dd <= (minDist + maxDist) * 0.5) {\n\t\t\t\ta1 = ta - Math.atan2(minY * bendDir, minX);\n\t\t\t\ta2 = minAngle * bendDir;\n\t\t\t} else {\n\t\t\t\ta1 = ta - Math.atan2(maxY * bendDir, maxX);\n\t\t\t\ta2 = maxAngle * bendDir;\n\t\t\t}\n\t\t}\n\t\tlet os = Math.atan2(cy, cx) * s2;\n\t\tlet rotation = parent.arotation;\n\t\ta1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\n\t\tif (a1 > 180)\n\t\t\ta1 -= 360;\n\t\telse if (a1 < -180) //\n\t\t\ta1 += 360;\n\t\tparent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, sy, 0, 0);\n\t\trotation = child.arotation;\n\t\ta2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\n\t\tif (a2 > 180)\n\t\t\ta2 -= 360;\n\t\telse if (a2 < -180) //\n\t\t\ta2 += 360;\n\t\tchild.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\n\n\n/** Stores the setup pose for an {@link IkConstraint}.\n *

\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide. */\nexport class IkConstraintData extends ConstraintData {\n\t/** The bones that are constrained by this IK constraint. */\n\tbones = new Array();\n\n\t/** The bone that is the IK target. */\n\tprivate _target: BoneData | null = null;\n\tpublic set target (boneData: BoneData) { this._target = boneData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"BoneData not set.\")\n\t\telse return this._target;\n\t}\n\n\t/** Controls the bend direction of the IK bones, either 1 or -1. */\n\tbendDirection = 0;\n\n\t/** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\n\tcompress = false;\n\n\t/** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\n\t * and the parent bone has local nonuniform scale, stretch is not applied. */\n\tstretch = false;\n\n\t/** When true, only a single bone is being constrained, and {@link #getCompress()} or {@link #getStretch()} is used, the bone\n\t * is scaled on both the X and Y axes. */\n\tuniform = false;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\n\tmix = 0;\n\n\t/** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\n\tsoftness = 0;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { SlotData } from \"./SlotData.js\";\n\n\n/** Stores the setup pose for a {@link PathConstraint}.\n *\n * See [path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide. */\nexport class PathConstraintData extends ConstraintData {\n\n\t/** The bones that will be modified by this path constraint. */\n\tbones = new Array();\n\n\t/** The slot whose path attachment will be used to constrained the bones. */\n\tprivate _target: SlotData | null = null;\n\tpublic set target (slotData: SlotData) { this._target = slotData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"SlotData not set.\")\n\t\telse return this._target;\n\t}\n\n\t/** The mode for positioning the first bone on the path. */\n\tpositionMode: PositionMode = PositionMode.Fixed;\n\n\t/** The mode for positioning the bones after the first bone on the path. */\n\tspacingMode: SpacingMode = SpacingMode.Fixed;\n\n\t/** The mode for adjusting the rotation of the bones. */\n\trotateMode: RotateMode = RotateMode.Chain;\n\n\t/** An offset added to the constrained bone rotation. */\n\toffsetRotation: number = 0;\n\n\t/** The position along the path. */\n\tposition: number = 0;\n\n\t/** The spacing between bones. */\n\tspacing: number = 0;\n\n\tmixRotate = 0;\n\tmixX = 0;\n\tmixY = 0;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n\n/** Controls how the first bone is positioned along the path.\n *\n * See [position](http://esotericsoftware.com/spine-path-constraints#Position) in the Spine User Guide. */\nexport enum PositionMode { Fixed, Percent }\n\n/** Controls how bones after the first bone are positioned along the path.\n *\n * See [spacing](http://esotericsoftware.com/spine-path-constraints#Spacing) in the Spine User Guide. */\nexport enum SpacingMode { Length, Fixed, Percent, Proportional }\n\n/** Controls how bones are rotated, translated, and scaled to match the path.\n *\n * See [rotate mix](http://esotericsoftware.com/spine-path-constraints#Rotate-mix) in the Spine User Guide. */\nexport enum RotateMode { Tangent, Chain, ChainScale }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { PathConstraintData, RotateMode, SpacingMode, PositionMode } from \"./PathConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Utils, MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the\n * constrained bones so they follow a {@link PathAttachment}.\n *\n * See [Path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide. */\nexport class PathConstraint implements Updatable {\n\tstatic NONE = -1; static BEFORE = -2; static AFTER = -3;\n\tstatic epsilon = 0.00001;\n\n\t/** The path constraint's setup pose data. */\n\tdata: PathConstraintData;\n\n\t/** The bones that will be modified by this path constraint. */\n\tbones: Array;\n\n\t/** The slot whose path attachment will be used to constrained the bones. */\n\ttarget: Slot;\n\n\t/** The position along the path. */\n\tposition = 0;\n\n\t/** The spacing between bones. */\n\tspacing = 0;\n\n\tmixRotate = 0;\n\n\tmixX = 0;\n\n\tmixY = 0;\n\n\tspaces = new Array(); positions = new Array();\n\tworld = new Array(); curves = new Array(); lengths = new Array();\n\tsegments = new Array();\n\n\tactive = false;\n\n\tconstructor (data: PathConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array();\n\t\tfor (let i = 0, n = data.bones.length; i < n; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}.`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findSlot(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find target bone ${data.target.name}`);\n\t\tthis.target = target;\n\n\t\tthis.position = data.position;\n\t\tthis.spacing = data.spacing;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.position = data.position;\n\t\tthis.spacing = data.spacing;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tlet attachment = this.target.getAttachment();\n\t\tif (!(attachment instanceof PathAttachment)) return;\n\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY;\n\t\tif (mixRotate == 0 && mixX == 0 && mixY == 0) return;\n\n\t\tlet data = this.data;\n\t\tlet tangents = data.rotateMode == RotateMode.Tangent, scale = data.rotateMode == RotateMode.ChainScale;\n\n\t\tlet bones = this.bones;\n\t\tlet boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\n\t\tlet spaces = Utils.setArraySize(this.spaces, spacesCount), lengths: Array = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : [];\n\t\tlet spacing = this.spacing;\n\n\t\tswitch (data.spacingMode) {\n\t\t\tcase SpacingMode.Percent:\n\t\t\t\tif (scale) {\n\t\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n; i++) {\n\t\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlengths[i] = Math.sqrt(x * x + y * y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tUtils.arrayFill(spaces, 1, spacesCount, spacing);\n\t\t\t\tbreak;\n\t\t\tcase SpacingMode.Proportional:\n\t\t\t\tlet sum = 0;\n\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n;) {\n\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\n\t\t\t\t\t\tif (scale) lengths[i] = 0;\n\t\t\t\t\t\tspaces[++i] = spacing;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlet length = Math.sqrt(x * x + y * y);\n\t\t\t\t\t\tif (scale) lengths[i] = length;\n\t\t\t\t\t\tspaces[++i] = length;\n\t\t\t\t\t\tsum += length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (sum > 0) {\n\t\t\t\t\tsum = spacesCount / sum * spacing;\n\t\t\t\t\tfor (let i = 1; i < spacesCount; i++)\n\t\t\t\t\t\tspaces[i] *= sum;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlet lengthSpacing = data.spacingMode == SpacingMode.Length;\n\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n;) {\n\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\n\t\t\t\t\t\tif (scale) lengths[i] = 0;\n\t\t\t\t\t\tspaces[++i] = spacing;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlet length = Math.sqrt(x * x + y * y);\n\t\t\t\t\t\tif (scale) lengths[i] = length;\n\t\t\t\t\t\tspaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\tlet positions = this.computeWorldPositions(attachment, spacesCount, tangents);\n\t\tlet boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\n\t\tlet tip = false;\n\t\tif (offsetRotation == 0)\n\t\t\ttip = data.rotateMode == RotateMode.Chain;\n\t\telse {\n\t\t\ttip = false;\n\t\t\tlet p = this.target.bone;\n\t\t\toffsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\t}\n\t\tfor (let i = 0, p = 3; i < boneCount; i++, p += 3) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.worldX += (boneX - bone.worldX) * mixX;\n\t\t\tbone.worldY += (boneY - bone.worldY) * mixY;\n\t\t\tlet x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\n\t\t\tif (scale) {\n\t\t\t\tlet length = lengths[i];\n\t\t\t\tif (length != 0) {\n\t\t\t\t\tlet s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * mixRotate + 1;\n\t\t\t\t\tbone.a *= s;\n\t\t\t\t\tbone.c *= s;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboneX = x;\n\t\t\tboneY = y;\n\t\t\tif (mixRotate > 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\n\t\t\t\tif (tangents)\n\t\t\t\t\tr = positions[p - 1];\n\t\t\t\telse if (spaces[i + 1] == 0)\n\t\t\t\t\tr = positions[p + 2];\n\t\t\t\telse\n\t\t\t\t\tr = Math.atan2(dy, dx);\n\t\t\t\tr -= Math.atan2(c, a);\n\t\t\t\tif (tip) {\n\t\t\t\t\tcos = Math.cos(r);\n\t\t\t\t\tsin = Math.sin(r);\n\t\t\t\t\tlet length = bone.data.length;\n\t\t\t\t\tboneX += (length * (cos * a - sin * c) - dx) * mixRotate;\n\t\t\t\t\tboneY += (length * (sin * a + cos * c) - dy) * mixRotate;\n\t\t\t\t} else {\n\t\t\t\t\tr += offsetRotation;\n\t\t\t\t}\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tcos = Math.cos(r);\n\t\t\t\tsin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tcomputeWorldPositions (path: PathAttachment, spacesCount: number, tangents: boolean) {\n\t\tlet target = this.target;\n\t\tlet position = this.position;\n\t\tlet spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world: Array = this.world;\n\t\tlet closed = path.closed;\n\t\tlet verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\n\n\t\tif (!path.constantSpeed) {\n\t\t\tlet lengths = path.lengths;\n\t\t\tcurveCount -= closed ? 1 : 2;\n\t\t\tlet pathLength = lengths[curveCount];\n\t\t\tif (this.data.positionMode == PositionMode.Percent) position *= pathLength;\n\n\t\t\tlet multiplier;\n\t\t\tswitch (this.data.spacingMode) {\n\t\t\t\tcase SpacingMode.Percent:\n\t\t\t\t\tmultiplier = pathLength;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SpacingMode.Proportional:\n\t\t\t\t\tmultiplier = pathLength / spacesCount;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tmultiplier = 1;\n\t\t\t}\n\t\t\tworld = Utils.setArraySize(this.world, 8);\n\t\t\tfor (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\n\t\t\t\tlet space = spaces[i] * multiplier;\n\t\t\t\tposition += space;\n\t\t\t\tlet p = position;\n\n\t\t\t\tif (closed) {\n\t\t\t\t\tp %= pathLength;\n\t\t\t\t\tif (p < 0) p += pathLength;\n\t\t\t\t\tcurve = 0;\n\t\t\t\t} else if (p < 0) {\n\t\t\t\t\tif (prevCurve != PathConstraint.BEFORE) {\n\t\t\t\t\t\tprevCurve = PathConstraint.BEFORE;\n\t\t\t\t\t\tpath.computeWorldVertices(target, 2, 4, world, 0, 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (p > pathLength) {\n\t\t\t\t\tif (prevCurve != PathConstraint.AFTER) {\n\t\t\t\t\t\tprevCurve = PathConstraint.AFTER;\n\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addAfterPosition(p - pathLength, world, 0, out, o);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Determine curve containing position.\n\t\t\t\tfor (; ; curve++) {\n\t\t\t\t\tlet length = lengths[curve];\n\t\t\t\t\tif (p > length) continue;\n\t\t\t\t\tif (curve == 0)\n\t\t\t\t\t\tp /= length;\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet prev = lengths[curve - 1];\n\t\t\t\t\t\tp = (p - prev) / (length - prev);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (curve != prevCurve) {\n\t\t\t\t\tprevCurve = curve;\n\t\t\t\t\tif (closed && curve == curveCount) {\n\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\n\t\t\t\t\t\tpath.computeWorldVertices(target, 0, 4, world, 4, 2);\n\t\t\t\t\t} else\n\t\t\t\t\t\tpath.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\n\t\t\t\t}\n\t\t\t\tthis.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o,\n\t\t\t\t\ttangents || (i > 0 && space == 0));\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t// World vertices.\n\t\tif (closed) {\n\t\t\tverticesLength += 2;\n\t\t\tworld = Utils.setArraySize(this.world, verticesLength);\n\t\t\tpath.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\n\t\t\tpath.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\n\t\t\tworld[verticesLength - 2] = world[0];\n\t\t\tworld[verticesLength - 1] = world[1];\n\t\t} else {\n\t\t\tcurveCount--;\n\t\t\tverticesLength -= 4;\n\t\t\tworld = Utils.setArraySize(this.world, verticesLength);\n\t\t\tpath.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\n\t\t}\n\n\t\t// Curve lengths.\n\t\tlet curves = Utils.setArraySize(this.curves, curveCount);\n\t\tlet pathLength = 0;\n\t\tlet x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\n\t\tlet tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\n\t\tfor (let i = 0, w = 2; i < curveCount; i++, w += 6) {\n\t\t\tcx1 = world[w];\n\t\t\tcy1 = world[w + 1];\n\t\t\tcx2 = world[w + 2];\n\t\t\tcy2 = world[w + 3];\n\t\t\tx2 = world[w + 4];\n\t\t\ty2 = world[w + 5];\n\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\n\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\n\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\n\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\n\t\t\tddfx = tmpx * 2 + dddfx;\n\t\t\tddfy = tmpy * 2 + dddfy;\n\t\t\tdfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\n\t\t\tdfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tddfx += dddfx;\n\t\t\tddfy += dddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx + dddfx;\n\t\t\tdfy += ddfy + dddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tcurves[i] = pathLength;\n\t\t\tx1 = x2;\n\t\t\ty1 = y2;\n\t\t}\n\n\t\tif (this.data.positionMode == PositionMode.Percent) position *= pathLength;\n\n\t\tlet multiplier;\n\t\tswitch (this.data.spacingMode) {\n\t\t\tcase SpacingMode.Percent:\n\t\t\t\tmultiplier = pathLength;\n\t\t\t\tbreak;\n\t\t\tcase SpacingMode.Proportional:\n\t\t\t\tmultiplier = pathLength / spacesCount;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmultiplier = 1;\n\t\t}\n\n\t\tlet segments = this.segments;\n\t\tlet curveLength = 0;\n\t\tfor (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\n\t\t\tlet space = spaces[i] * multiplier;\n\t\t\tposition += space;\n\t\t\tlet p = position;\n\n\t\t\tif (closed) {\n\t\t\t\tp %= pathLength;\n\t\t\t\tif (p < 0) p += pathLength;\n\t\t\t\tcurve = 0;\n\t\t\t} else if (p < 0) {\n\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\n\t\t\t\tcontinue;\n\t\t\t} else if (p > pathLength) {\n\t\t\t\tthis.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Determine curve containing position.\n\t\t\tfor (; ; curve++) {\n\t\t\t\tlet length = curves[curve];\n\t\t\t\tif (p > length) continue;\n\t\t\t\tif (curve == 0)\n\t\t\t\t\tp /= length;\n\t\t\t\telse {\n\t\t\t\t\tlet prev = curves[curve - 1];\n\t\t\t\t\tp = (p - prev) / (length - prev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Curve segment lengths.\n\t\t\tif (curve != prevCurve) {\n\t\t\t\tprevCurve = curve;\n\t\t\t\tlet ii = curve * 6;\n\t\t\t\tx1 = world[ii];\n\t\t\t\ty1 = world[ii + 1];\n\t\t\t\tcx1 = world[ii + 2];\n\t\t\t\tcy1 = world[ii + 3];\n\t\t\t\tcx2 = world[ii + 4];\n\t\t\t\tcy2 = world[ii + 5];\n\t\t\t\tx2 = world[ii + 6];\n\t\t\t\ty2 = world[ii + 7];\n\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.03;\n\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.03;\n\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\n\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\n\t\t\t\tddfx = tmpx * 2 + dddfx;\n\t\t\t\tddfy = tmpy * 2 + dddfy;\n\t\t\t\tdfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\n\t\t\t\tdfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\n\t\t\t\tcurveLength = Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[0] = curveLength;\n\t\t\t\tfor (ii = 1; ii < 8; ii++) {\n\t\t\t\t\tdfx += ddfx;\n\t\t\t\t\tdfy += ddfy;\n\t\t\t\t\tddfx += dddfx;\n\t\t\t\t\tddfy += dddfy;\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\t\tsegments[ii] = curveLength;\n\t\t\t\t}\n\t\t\t\tdfx += ddfx;\n\t\t\t\tdfy += ddfy;\n\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[8] = curveLength;\n\t\t\t\tdfx += ddfx + dddfx;\n\t\t\t\tdfy += ddfy + dddfy;\n\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[9] = curveLength;\n\t\t\t\tsegment = 0;\n\t\t\t}\n\n\t\t\t// Weight by segment length.\n\t\t\tp *= curveLength;\n\t\t\tfor (; ; segment++) {\n\t\t\t\tlet length = segments[segment];\n\t\t\t\tif (p > length) continue;\n\t\t\t\tif (segment == 0)\n\t\t\t\t\tp /= length;\n\t\t\t\telse {\n\t\t\t\t\tlet prev = segments[segment - 1];\n\t\t\t\t\tp = segment + (p - prev) / (length - prev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\n\t\t}\n\t\treturn out;\n\t}\n\n\taddBeforePosition (p: number, temp: Array, i: number, out: Array, o: number) {\n\t\tlet x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\n\t\tout[o] = x1 + p * Math.cos(r);\n\t\tout[o + 1] = y1 + p * Math.sin(r);\n\t\tout[o + 2] = r;\n\t}\n\n\taddAfterPosition (p: number, temp: Array, i: number, out: Array, o: number) {\n\t\tlet x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\n\t\tout[o] = x1 + p * Math.cos(r);\n\t\tout[o + 1] = y1 + p * Math.sin(r);\n\t\tout[o + 2] = r;\n\t}\n\n\taddCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,\n\t\tout: Array, o: number, tangents: boolean) {\n\t\tif (p == 0 || isNaN(p)) {\n\t\t\tout[o] = x1;\n\t\t\tout[o + 1] = y1;\n\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n\t\t\treturn;\n\t\t}\n\t\tlet tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\n\t\tlet ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\n\t\tlet x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\n\t\tout[o] = x;\n\t\tout[o + 1] = y;\n\t\tif (tangents) {\n\t\t\tif (p < 0.001)\n\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n\t\t\telse\n\t\t\t\tout[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a physics constraint. A physics constraint applies physics to bones.\n *

\n * See Physics constraints in the Spine User Guide. */\nexport class PhysicsConstraint implements Updatable {\n\treadonly data: PhysicsConstraintData;\n\tprivate _bone: Bone | null = null;\n\t/** The bone constrained by this physics constraint. */\n\tpublic set bone (bone: Bone) { this._bone = bone; }\n\tpublic get bone () {\n\t\tif (!this._bone) throw new Error(\"Bone not set.\")\n\t\telse return this._bone;\n\t}\n\tinertia = 0;\n\tstrength = 0;\n\tdamping = 0;\n\tmassInverse = 0;\n\twind = 0;\n\tgravity = 0;\n\tmix = 0;\n\n\t_reset = true;\n\tux = 0;\n\tuy = 0;\n\tcx = 0;\n\tcy = 0;\n\ttx = 0;\n\tty = 0;\n\txOffset = 0;\n\txVelocity = 0;\n\tyOffset = 0;\n\tyVelocity = 0;\n\trotateOffset = 0;\n\trotateVelocity = 0;\n\tscaleOffset = 0\n\tscaleVelocity = 0;\n\n\tactive = false;\n\n\treadonly skeleton: Skeleton;\n\tremaining = 0;\n\tlastTime = 0;\n\n\tconstructor (data: PhysicsConstraintData, skeleton: Skeleton) {\n\t\tthis.data = data;\n\t\tthis.skeleton = skeleton;\n\n\t\tthis.bone = skeleton.bones[data.bone.index];\n\n\t\tthis.inertia = data.inertia;\n\t\tthis.strength = data.strength;\n\t\tthis.damping = data.damping;\n\t\tthis.massInverse = data.massInverse;\n\t\tthis.wind = data.wind;\n\t\tthis.gravity = data.gravity;\n\t\tthis.mix = data.mix;\n\t}\n\n\treset () {\n\t\tthis.remaining = 0;\n\t\tthis.lastTime = this.skeleton.time;\n\t\tthis._reset = true;\n\t\tthis.xOffset = 0;\n\t\tthis.xVelocity = 0;\n\t\tthis.yOffset = 0;\n\t\tthis.yVelocity = 0;\n\t\tthis.rotateOffset = 0;\n\t\tthis.rotateVelocity = 0;\n\t\tthis.scaleOffset = 0;\n\t\tthis.scaleVelocity = 0;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.inertia = data.inertia;\n\t\tthis.strength = data.strength;\n\t\tthis.damping = data.damping;\n\t\tthis.massInverse = data.massInverse;\n\t\tthis.wind = data.wind;\n\t\tthis.gravity = data.gravity;\n\t\tthis.mix = data.mix;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\t/** Applies the constraint to the constrained bones. */\n\tupdate (physics: Physics) {\n\t\tconst mix = this.mix;\n\t\tif (mix == 0) return;\n\n\t\tconst x = this.data.x > 0, y = this.data.y > 0, rotateOrShearX = this.data.rotate > 0 || this.data.shearX > 0, scaleX = this.data.scaleX > 0;\n\t\tconst bone = this.bone;\n\t\tconst l = bone.data.length;\n\n\t\tswitch (physics) {\n\t\t\tcase Physics.none:\n\t\t\t\treturn;\n\t\t\tcase Physics.reset:\n\t\t\t\tthis.reset();\n\t\t\t// Fall through.\n\t\t\tcase Physics.update:\n\t\t\t\tconst skeleton = this.skeleton;\n\t\t\t\tconst delta = Math.max(this.skeleton.time - this.lastTime, 0);\n\t\t\t\tthis.remaining += delta;\n\t\t\t\tthis.lastTime = skeleton.time;\n\n\t\t\t\tconst bx = bone.worldX, by = bone.worldY;\n\t\t\t\tif (this._reset) {\n\t\t\t\t\tthis._reset = false;\n\t\t\t\t\tthis.ux = bx;\n\t\t\t\t\tthis.uy = by;\n\t\t\t\t} else {\n\t\t\t\t\tlet a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;\n\t\t\t\t\tlet qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY);\n\t\t\t\t\tqx *= Math.abs(skeleton.scaleX);\n\t\t\t\t\tif (x || y) {\n\t\t\t\t\t\tif (x) {\n\t\t\t\t\t\t\tconst u = (this.ux - bx) * i;\n\t\t\t\t\t\t\tthis.xOffset += u > qx ? qx : u < -qx ? -qx : u;\n\t\t\t\t\t\t\tthis.ux = bx;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (y) {\n\t\t\t\t\t\t\tconst u = (this.uy - by) * i;\n\t\t\t\t\t\t\tthis.yOffset += u > qy ? qy : u < -qy ? -qy : u;\n\t\t\t\t\t\t\tthis.uy = by;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (a >= t) {\n\t\t\t\t\t\t\td = Math.pow(this.damping, 60 * t);\n\t\t\t\t\t\t\tconst m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = this.gravity * f * skeleton.scaleY;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tif (x) {\n\t\t\t\t\t\t\t\t\tthis.xVelocity += (w - this.xOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.xOffset += this.xVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.xVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (y) {\n\t\t\t\t\t\t\t\t\tthis.yVelocity -= (g + this.yOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.yOffset += this.yVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.yVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ta -= t;\n\t\t\t\t\t\t\t} while (a >= t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (x) bone.worldX += this.xOffset * mix * this.data.x;\n\t\t\t\t\t\tif (y) bone.worldY += this.yOffset * mix * this.data.y;\n\t\t\t\t\t}\n\t\t\t\t\tif (rotateOrShearX || scaleX) {\n\t\t\t\t\t\tlet ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0;\n\t\t\t\t\t\tlet dx = this.cx - bone.worldX, dy = this.cy - bone.worldY;\n\t\t\t\t\t\tif (dx > qx)\n\t\t\t\t\t\t\tdx = qx;\n\t\t\t\t\t\telse if (dx < -qx) //\n\t\t\t\t\t\t\tdx = -qx;\n\t\t\t\t\t\tif (dy > qy)\n\t\t\t\t\t\t\tdy = qy;\n\t\t\t\t\t\telse if (dy < -qy) //\n\t\t\t\t\t\t\tdy = -qy;\n\t\t\t\t\t\tif (rotateOrShearX) {\n\t\t\t\t\t\t\tmr = (this.data.rotate + this.data.shearX) * mix;\n\t\t\t\t\t\t\tlet r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr;\n\t\t\t\t\t\t\tthis.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i;\n\t\t\t\t\t\t\tr = this.rotateOffset * mr + ca;\n\t\t\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\t\t\tif (scaleX) {\n\t\t\t\t\t\t\t\tr = l * bone.getWorldScaleX();\n\t\t\t\t\t\t\t\tif (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc = Math.cos(ca);\n\t\t\t\t\t\t\ts = Math.sin(ca);\n\t\t\t\t\t\t\tconst r = l * bone.getWorldScaleX();\n\t\t\t\t\t\t\tif (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ta = this.remaining;\n\t\t\t\t\t\tif (a >= t) {\n\t\t\t\t\t\t\tif (d == -1) d = Math.pow(this.damping, 60 * t);\n\t\t\t\t\t\t\tconst m = this.massInverse * t, e = this.strength, w = this.wind, g = (Skeleton.yDown ? -this.gravity : this.gravity), h = l / f;\n\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\ta -= t;\n\t\t\t\t\t\t\t\tif (scaleX) {\n\t\t\t\t\t\t\t\t\tthis.scaleVelocity += (w * c - g * s - this.scaleOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.scaleOffset += this.scaleVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.scaleVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (rotateOrShearX) {\n\t\t\t\t\t\t\t\t\tthis.rotateVelocity -= ((w * s + g * c) * h + this.rotateOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.rotateOffset += this.rotateVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.rotateVelocity *= d;\n\t\t\t\t\t\t\t\t\tif (a < t) break;\n\t\t\t\t\t\t\t\t\tconst r = this.rotateOffset * mr + ca;\n\t\t\t\t\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\t\t\t\t} else if (a < t) //\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.remaining = a;\n\t\t\t\t}\n\t\t\t\tthis.cx = bone.worldX;\n\t\t\t\tthis.cy = bone.worldY;\n\t\t\t\tbreak;\n\t\t\tcase Physics.pose:\n\t\t\t\tif (x) bone.worldX += this.xOffset * mix * this.data.x;\n\t\t\t\tif (y) bone.worldY += this.yOffset * mix * this.data.y;\n\t\t}\n\n\t\tif (rotateOrShearX) {\n\t\t\tlet o = this.rotateOffset * mix, s = 0, c = 0, a = 0;\n\t\t\tif (this.data.shearX > 0) {\n\t\t\t\tlet r = 0;\n\t\t\t\tif (this.data.rotate > 0) {\n\t\t\t\t\tr = o * this.data.rotate;\n\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\ta = bone.b;\n\t\t\t\t\tbone.b = c * a - s * bone.d;\n\t\t\t\t\tbone.d = s * a + c * bone.d;\n\t\t\t\t}\n\t\t\t\tr += o * this.data.shearX;\n\t\t\t\ts = Math.sin(r);\n\t\t\t\tc = Math.cos(r);\n\t\t\t\ta = bone.a;\n\t\t\t\tbone.a = c * a - s * bone.c;\n\t\t\t\tbone.c = s * a + c * bone.c;\n\t\t\t} else {\n\t\t\t\to *= this.data.rotate;\n\t\t\t\ts = Math.sin(o);\n\t\t\t\tc = Math.cos(o);\n\t\t\t\ta = bone.a;\n\t\t\t\tbone.a = c * a - s * bone.c;\n\t\t\t\tbone.c = s * a + c * bone.c;\n\t\t\t\ta = bone.b;\n\t\t\t\tbone.b = c * a - s * bone.d;\n\t\t\t\tbone.d = s * a + c * bone.d;\n\t\t\t}\n\t\t}\n\t\tif (scaleX) {\n\t\t\tconst s = 1 + this.scaleOffset * mix * this.data.scaleX;\n\t\t\tbone.a *= s;\n\t\t\tbone.c *= s;\n\t\t}\n\t\tif (physics != Physics.pose) {\n\t\t\tthis.tx = l * bone.a;\n\t\t\tthis.ty = l * bone.c;\n\t\t}\n\t\tbone.updateAppliedTransform();\n\t}\n\n\t/** Translates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone moved an additional\n\t * amount in world space. */\n\ttranslate (x: number, y: number) {\n\t\tthis.ux -= x;\n\t\tthis.uy -= y;\n\t\tthis.cx -= x;\n\t\tthis.cy -= y;\n\t}\n\n\t/** Rotates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone rotated around the\n\t * specified point in world space. */\n\trotate (x: number, y: number, degrees: number) {\n\t\tconst r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\tconst dx = this.cx - x, dy = this.cy - y;\n\t\tthis.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment, VertexAttachment } from \"./attachments/Attachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { Color } from \"./Utils.js\";\n\n/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store\n * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared\n * across multiple skeletons. */\nexport class Slot {\n\t/** The slot's setup pose data. */\n\tdata: SlotData;\n\n\t/** The bone this slot belongs to. */\n\tbone: Bone;\n\n\t/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two\n\t * color tinting. */\n\tcolor: Color;\n\n\t/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\n\t * color's alpha is not used. */\n\tdarkColor: Color | null = null;\n\n\tattachment: Attachment | null = null;\n\n\tattachmentState: number = 0;\n\n\t/** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the\n\t * {@link Sequence#getSetupIndex()}. */\n\tsequenceIndex: number = -1;\n\n\t/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a\n\t * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.\n\t *\n\t * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */\n\tdeform = new Array();\n\n\tconstructor (data: SlotData, bone: Bone) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!bone) throw new Error(\"bone cannot be null.\");\n\t\tthis.data = data;\n\t\tthis.bone = bone;\n\t\tthis.color = new Color();\n\t\tthis.darkColor = !data.darkColor ? null : new Color();\n\t\tthis.setToSetupPose();\n\t}\n\n\t/** The skeleton this slot belongs to. */\n\tgetSkeleton (): Skeleton {\n\t\treturn this.bone.skeleton;\n\t}\n\n\t/** The current attachment for the slot, or null if the slot has no attachment. */\n\tgetAttachment (): Attachment | null {\n\t\treturn this.attachment;\n\t}\n\n\t/** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.\n\t * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the\n\t * specified attachment. */\n\tsetAttachment (attachment: Attachment | null) {\n\t\tif (this.attachment == attachment) return;\n\t\tif (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)\n\t\t\t|| (attachment).timelineAttachment != (this.attachment).timelineAttachment) {\n\t\t\tthis.deform.length = 0;\n\t\t}\n\t\tthis.attachment = attachment;\n\t\tthis.sequenceIndex = -1;\n\t}\n\n\t/** Sets this slot to the setup pose. */\n\tsetToSetupPose () {\n\t\tthis.color.setFromColor(this.data.color);\n\t\tif (this.darkColor) this.darkColor.setFromColor(this.data.darkColor!);\n\t\tif (!this.data.attachmentName)\n\t\t\tthis.attachment = null;\n\t\telse {\n\t\t\tthis.attachment = null;\n\t\t\tthis.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Vector2, MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained\n * bones to match that of the target bone.\n *\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */\nexport class TransformConstraint implements Updatable {\n\n\t/** The transform constraint's setup pose data. */\n\tdata: TransformConstraintData;\n\n\t/** The bones that will be modified by this transform constraint. */\n\tbones: Array;\n\n\t/** The target bone whose world transform will be copied to the constrained bones. */\n\ttarget: Bone;\n\n\tmixRotate = 0; mixX = 0; mixY = 0; mixScaleX = 0; mixScaleY = 0; mixShearY = 0;\n\n\ttemp = new Vector2();\n\tactive = false;\n\n\tconstructor (data: TransformConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}.`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findBone(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find target bone ${data.target.name}.`);\n\t\tthis.target = target;\n\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t\tthis.mixScaleX = data.mixScaleX;\n\t\tthis.mixScaleY = data.mixScaleY;\n\t\tthis.mixShearY = data.mixShearY;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t\tthis.mixScaleX = data.mixScaleX;\n\t\tthis.mixScaleY = data.mixScaleY;\n\t\tthis.mixShearY = data.mixShearY;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tif (this.mixRotate == 0 && this.mixX == 0 && this.mixY == 0 && this.mixScaleX == 0 && this.mixScaleY == 0 && this.mixShearY == 0) return;\n\n\t\tif (this.data.local) {\n\t\t\tif (this.data.relative)\n\t\t\t\tthis.applyRelativeLocal();\n\t\t\telse\n\t\t\t\tthis.applyAbsoluteLocal();\n\t\t} else {\n\t\t\tif (this.data.relative)\n\t\t\t\tthis.applyRelativeWorld();\n\t\t\telse\n\t\t\t\tthis.applyAbsoluteWorld();\n\t\t}\n\t}\n\n\tapplyAbsoluteWorld () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\t\tlet translate = mixX != 0 || mixY != 0;\n\n\t\tlet target = this.target;\n\t\tlet ta = target.a, tb = target.b, tc = target.c, td = target.d;\n\t\tlet degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\tlet offsetRotation = this.data.offsetRotation * degRadReflect;\n\t\tlet offsetShearY = this.data.offsetShearY * degRadReflect;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tif (mixRotate != 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\t\tlet r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tlet cos = Math.cos(r), sin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\n\t\t\tif (translate) {\n\t\t\t\tlet temp = this.temp;\n\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n\t\t\t\tbone.worldX += (temp.x - bone.worldX) * mixX;\n\t\t\t\tbone.worldY += (temp.y - bone.worldY) * mixY;\n\t\t\t}\n\n\t\t\tif (mixScaleX != 0) {\n\t\t\t\tlet s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\n\t\t\t\tif (s != 0) s = (s + (Math.sqrt(ta * ta + tc * tc) - s + this.data.offsetScaleX) * mixScaleX) / s;\n\t\t\t\tbone.a *= s;\n\t\t\t\tbone.c *= s;\n\t\t\t}\n\t\t\tif (mixScaleY != 0) {\n\t\t\t\tlet s = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\n\t\t\t\tif (s != 0) s = (s + (Math.sqrt(tb * tb + td * td) - s + this.data.offsetScaleY) * mixScaleY) / s;\n\t\t\t\tbone.b *= s;\n\t\t\t\tbone.d *= s;\n\t\t\t}\n\n\t\t\tif (mixShearY > 0) {\n\t\t\t\tlet b = bone.b, d = bone.d;\n\t\t\t\tlet by = Math.atan2(d, b);\n\t\t\t\tlet r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr = by + (r + offsetShearY) * mixShearY;\n\t\t\t\tlet s = Math.sqrt(b * b + d * d);\n\t\t\t\tbone.b = Math.cos(r) * s;\n\t\t\t\tbone.d = Math.sin(r) * s;\n\t\t\t}\n\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tapplyRelativeWorld () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\t\tlet translate = mixX != 0 || mixY != 0;\n\n\t\tlet target = this.target;\n\t\tlet ta = target.a, tb = target.b, tc = target.c, td = target.d;\n\t\tlet degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\tlet offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tif (mixRotate != 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\t\tlet r = Math.atan2(tc, ta) + offsetRotation;\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tlet cos = Math.cos(r), sin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\n\t\t\tif (translate) {\n\t\t\t\tlet temp = this.temp;\n\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n\t\t\t\tbone.worldX += temp.x * mixX;\n\t\t\t\tbone.worldY += temp.y * mixY;\n\t\t\t}\n\n\t\t\tif (mixScaleX != 0) {\n\t\t\t\tlet s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * mixScaleX + 1;\n\t\t\t\tbone.a *= s;\n\t\t\t\tbone.c *= s;\n\t\t\t}\n\t\t\tif (mixScaleY != 0) {\n\t\t\t\tlet s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * mixScaleY + 1;\n\t\t\t\tbone.b *= s;\n\t\t\t\tbone.d *= s;\n\t\t\t}\n\n\t\t\tif (mixShearY > 0) {\n\t\t\t\tlet r = Math.atan2(td, tb) - Math.atan2(tc, ta);\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tlet b = bone.b, d = bone.d;\n\t\t\t\tr = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * mixShearY;\n\t\t\t\tlet s = Math.sqrt(b * b + d * d);\n\t\t\t\tbone.b = Math.cos(r) * s;\n\t\t\t\tbone.d = Math.sin(r) * s;\n\t\t\t}\n\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tapplyAbsoluteLocal () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\n\t\tlet target = this.target;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tlet rotation = bone.arotation;\n\t\t\tif (mixRotate != 0) rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate;\n\n\t\t\tlet x = bone.ax, y = bone.ay;\n\t\t\tx += (target.ax - x + this.data.offsetX) * mixX;\n\t\t\ty += (target.ay - y + this.data.offsetY) * mixY;\n\n\t\t\tlet scaleX = bone.ascaleX, scaleY = bone.ascaleY;\n\t\t\tif (mixScaleX != 0 && scaleX != 0)\n\t\t\t\tscaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * mixScaleX) / scaleX;\n\t\t\tif (mixScaleY != 0 && scaleY != 0)\n\t\t\t\tscaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;\n\n\t\t\tlet shearY = bone.ashearY;\n\t\t\tif (mixShearY != 0) shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY;\n\n\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\n\t\t}\n\t}\n\n\tapplyRelativeLocal () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\n\t\tlet target = this.target;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tlet rotation = bone.arotation + (target.arotation + this.data.offsetRotation) * mixRotate;\n\t\t\tlet x = bone.ax + (target.ax + this.data.offsetX) * mixX;\n\t\t\tlet y = bone.ay + (target.ay + this.data.offsetY) * mixY;\n\t\t\tlet scaleX = bone.ascaleX * (((target.ascaleX - 1 + this.data.offsetScaleX) * mixScaleX) + 1);\n\t\t\tlet scaleY = bone.ascaleY * (((target.ascaleY - 1 + this.data.offsetScaleY) * mixScaleY) + 1);\n\t\t\tlet shearY = bone.ashearY + (target.ashearY + this.data.offsetShearY) * mixShearY;\n\n\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment } from \"./attachments/Attachment.js\";\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { RegionAttachment } from \"./attachments/RegionAttachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { IkConstraint } from \"./IkConstraint.js\";\nimport { PathConstraint } from \"./PathConstraint.js\";\nimport { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport { SkeletonClipping } from \"./SkeletonClipping.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { Slot } from \"./Slot.js\";\nimport { TransformConstraint } from \"./TransformConstraint.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Color, Utils, MathUtils, Vector2, NumberArrayLike } from \"./Utils.js\";\n\n/** Stores the current pose for a skeleton.\n *\n * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide. */\nexport class Skeleton {\n\tprivate static quadTriangles = [0, 1, 2, 2, 3, 0];\n\tstatic yDown = false;\n\n\t/** The skeleton's setup pose data. */\n\tdata: SkeletonData;\n\n\t/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\n\tbones: Array;\n\n\t/** The skeleton's slots in the setup pose draw order. */\n\tslots: Array;\n\n\t/** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */\n\tdrawOrder: Array;\n\n\t/** The skeleton's IK constraints. */\n\tikConstraints: Array;\n\n\t/** The skeleton's transform constraints. */\n\ttransformConstraints: Array;\n\n\t/** The skeleton's path constraints. */\n\tpathConstraints: Array;\n\n\n\t/** The skeleton's physics constraints. */\n\tphysicsConstraints: Array;\n\n\t/** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}. */\n\t_updateCache = new Array();\n\n\t/** The skeleton's current skin. May be null. */\n\tskin: Skin | null = null;\n\n\t/** The color to tint all the skeleton's attachments. */\n\tcolor: Color;\n\n\t/** Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale\n\t * inheritance. */\n\tscaleX = 1;\n\n\t/** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale\n\t * inheritance. */\n\tprivate _scaleY = 1;\n\n\tpublic get scaleY () {\n\t\treturn Skeleton.yDown ? -this._scaleY : this._scaleY;\n\t}\n\n\tpublic set scaleY (scaleY: number) {\n\t\tthis._scaleY = scaleY;\n\t}\n\n\t/** Sets the skeleton X position, which is added to the root bone worldX position. */\n\tx = 0;\n\n\t/** Sets the skeleton Y position, which is added to the root bone worldY position. */\n\ty = 0;\n\n\t/** Returns the skeleton's time. This is used for time-based manipulations, such as {@link PhysicsConstraint}.\n\t *

\n\t * See {@link #update(float)}. */\n\ttime = 0;\n\n\tconstructor (data: SkeletonData) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet boneData = data.bones[i];\n\t\t\tlet bone: Bone;\n\t\t\tif (!boneData.parent)\n\t\t\t\tbone = new Bone(boneData, this, null);\n\t\t\telse {\n\t\t\t\tlet parent = this.bones[boneData.parent.index];\n\t\t\t\tbone = new Bone(boneData, this, parent);\n\t\t\t\tparent.children.push(bone);\n\t\t\t}\n\t\t\tthis.bones.push(bone);\n\t\t}\n\n\t\tthis.slots = new Array();\n\t\tthis.drawOrder = new Array();\n\t\tfor (let i = 0; i < data.slots.length; i++) {\n\t\t\tlet slotData = data.slots[i];\n\t\t\tlet bone = this.bones[slotData.boneData.index];\n\t\t\tlet slot = new Slot(slotData, bone);\n\t\t\tthis.slots.push(slot);\n\t\t\tthis.drawOrder.push(slot);\n\t\t}\n\n\t\tthis.ikConstraints = new Array();\n\t\tfor (let i = 0; i < data.ikConstraints.length; i++) {\n\t\t\tlet ikConstraintData = data.ikConstraints[i];\n\t\t\tthis.ikConstraints.push(new IkConstraint(ikConstraintData, this));\n\t\t}\n\n\t\tthis.transformConstraints = new Array();\n\t\tfor (let i = 0; i < data.transformConstraints.length; i++) {\n\t\t\tlet transformConstraintData = data.transformConstraints[i];\n\t\t\tthis.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\n\t\t}\n\n\t\tthis.pathConstraints = new Array();\n\t\tfor (let i = 0; i < data.pathConstraints.length; i++) {\n\t\t\tlet pathConstraintData = data.pathConstraints[i];\n\t\t\tthis.pathConstraints.push(new PathConstraint(pathConstraintData, this));\n\t\t}\n\n\t\tthis.physicsConstraints = new Array();\n\t\tfor (let i = 0; i < data.physicsConstraints.length; i++) {\n\t\t\tlet physicsConstraintData = data.physicsConstraints[i];\n\t\t\tthis.physicsConstraints.push(new PhysicsConstraint(physicsConstraintData, this));\n\t\t}\n\n\t\tthis.color = new Color(1, 1, 1, 1);\n\t\tthis.updateCache();\n\t}\n\n\t/** Caches information about bones and constraints. Must be called if the {@link #getSkin()} is modified or if bones,\n\t * constraints, or weighted path attachments are added or removed. */\n\tupdateCache () {\n\t\tlet updateCache = this._updateCache;\n\t\tupdateCache.length = 0;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.sorted = bone.data.skinRequired;\n\t\t\tbone.active = !bone.sorted;\n\t\t}\n\n\t\tif (this.skin) {\n\t\t\tlet skinBones = this.skin.bones;\n\t\t\tfor (let i = 0, n = this.skin.bones.length; i < n; i++) {\n\t\t\t\tlet bone: Bone | null = this.bones[skinBones[i].index];\n\t\t\t\tdo {\n\t\t\t\t\tbone.sorted = false;\n\t\t\t\t\tbone.active = true;\n\t\t\t\t\tbone = bone.parent;\n\t\t\t\t} while (bone);\n\t\t\t}\n\t\t}\n\n\t\t// IK first, lowest hierarchy depth first.\n\t\tlet ikConstraints = this.ikConstraints;\n\t\tlet transformConstraints = this.transformConstraints;\n\t\tlet pathConstraints = this.pathConstraints;\n\t\tlet physicsConstraints = this.physicsConstraints;\n\t\tlet ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length, physicsCount = this.physicsConstraints.length;\n\t\tlet constraintCount = ikCount + transformCount + pathCount + physicsCount;\n\n\t\touter:\n\t\tfor (let i = 0; i < constraintCount; i++) {\n\t\t\tfor (let ii = 0; ii < ikCount; ii++) {\n\t\t\t\tlet constraint = ikConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortIkConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < transformCount; ii++) {\n\t\t\t\tlet constraint = transformConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortTransformConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < pathCount; ii++) {\n\t\t\t\tlet constraint = pathConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortPathConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < physicsCount; ii++) {\n\t\t\t\tconst constraint = physicsConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortPhysicsConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0, n = bones.length; i < n; i++)\n\t\t\tthis.sortBone(bones[i]);\n\t}\n\n\tsortIkConstraint (constraint: IkConstraint) {\n\t\tconstraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tlet target = constraint.target;\n\t\tthis.sortBone(target);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet parent = constrained[0];\n\t\tthis.sortBone(parent);\n\n\t\tif (constrained.length == 1) {\n\t\t\tthis._updateCache.push(constraint);\n\t\t\tthis.sortReset(parent.children);\n\t\t} else {\n\t\t\tlet child = constrained[constrained.length - 1];\n\t\t\tthis.sortBone(child);\n\n\t\t\tthis._updateCache.push(constraint);\n\n\t\t\tthis.sortReset(parent.children);\n\t\t\tchild.sorted = true;\n\t\t}\n\t}\n\n\tsortPathConstraint (constraint: PathConstraint) {\n\t\tconstraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tlet slot = constraint.target;\n\t\tlet slotIndex = slot.data.index;\n\t\tlet slotBone = slot.bone;\n\t\tif (this.skin) this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\n\t\tif (this.data.defaultSkin && this.data.defaultSkin != this.skin)\n\t\t\tthis.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\n\t\tfor (let i = 0, n = this.data.skins.length; i < n; i++)\n\t\t\tthis.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\n\n\t\tlet attachment = slot.getAttachment();\n\t\tif (attachment instanceof PathAttachment) this.sortPathConstraintAttachmentWith(attachment, slotBone);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet boneCount = constrained.length;\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortBone(constrained[i]);\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortReset(constrained[i].children);\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tconstrained[i].sorted = true;\n\t}\n\n\tsortTransformConstraint (constraint: TransformConstraint) {\n\t\tconstraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tthis.sortBone(constraint.target);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet boneCount = constrained.length;\n\t\tif (constraint.data.local) {\n\t\t\tfor (let i = 0; i < boneCount; i++) {\n\t\t\t\tlet child = constrained[i];\n\t\t\t\tthis.sortBone(child.parent!);\n\t\t\t\tthis.sortBone(child);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let i = 0; i < boneCount; i++) {\n\t\t\t\tthis.sortBone(constrained[i]);\n\t\t\t}\n\t\t}\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortReset(constrained[i].children);\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tconstrained[i].sorted = true;\n\t}\n\n\tsortPathConstraintAttachment (skin: Skin, slotIndex: number, slotBone: Bone) {\n\t\tlet attachments = skin.attachments[slotIndex];\n\t\tif (!attachments) return;\n\t\tfor (let key in attachments) {\n\t\t\tthis.sortPathConstraintAttachmentWith(attachments[key], slotBone);\n\t\t}\n\t}\n\n\tsortPathConstraintAttachmentWith (attachment: Attachment, slotBone: Bone) {\n\t\tif (!(attachment instanceof PathAttachment)) return;\n\t\tlet pathBones = (attachment).bones;\n\t\tif (!pathBones)\n\t\t\tthis.sortBone(slotBone);\n\t\telse {\n\t\t\tlet bones = this.bones;\n\t\t\tfor (let i = 0, n = pathBones.length; i < n;) {\n\t\t\t\tlet nn = pathBones[i++];\n\t\t\t\tnn += i;\n\t\t\t\twhile (i < nn)\n\t\t\t\t\tthis.sortBone(bones[pathBones[i++]]);\n\t\t\t}\n\t\t}\n\t}\n\n\tsortPhysicsConstraint (constraint: PhysicsConstraint) {\n\t\tconst bone = constraint.bone;\n\t\tconstraint.active = bone.active && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\n\t\tif (!constraint.active) return;\n\n\t\tthis.sortBone(bone);\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tthis.sortReset(bone.children);\n\t\tbone.sorted = true;\n\t}\n\n\tsortBone (bone: Bone) {\n\t\tif (!bone) return;\n\t\tif (bone.sorted) return;\n\t\tlet parent = bone.parent;\n\t\tif (parent) this.sortBone(parent);\n\t\tbone.sorted = true;\n\t\tthis._updateCache.push(bone);\n\t}\n\n\tsortReset (bones: Array) {\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (!bone.active) continue;\n\t\t\tif (bone.sorted) this.sortReset(bone.children);\n\t\t\tbone.sorted = false;\n\t\t}\n\t}\n\n\t/** Updates the world transform for each bone and applies all constraints.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide. */\n\tupdateWorldTransform (physics: Physics) {\n\t\tif (physics === undefined || physics === null) throw new Error(\"physics is undefined\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.ax = bone.x;\n\t\t\tbone.ay = bone.y;\n\t\t\tbone.arotation = bone.rotation;\n\t\t\tbone.ascaleX = bone.scaleX;\n\t\t\tbone.ascaleY = bone.scaleY;\n\t\t\tbone.ashearX = bone.shearX;\n\t\t\tbone.ashearY = bone.shearY;\n\t\t}\n\n\t\tlet updateCache = this._updateCache;\n\t\tfor (let i = 0, n = updateCache.length; i < n; i++)\n\t\t\tupdateCache[i].update(physics);\n\t}\n\n\tupdateWorldTransformWith (physics: Physics, parent: Bone) {\n\t\tif (!parent) throw new Error(\"parent cannot be null.\");\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 1, n = bones.length; i < n; i++) { // Skip root bone.\n\t\t\tlet bone = bones[i];\n\t\t\tbone.ax = bone.x;\n\t\t\tbone.ay = bone.y;\n\t\t\tbone.arotation = bone.rotation;\n\t\t\tbone.ascaleX = bone.scaleX;\n\t\t\tbone.ascaleY = bone.scaleY;\n\t\t\tbone.ashearX = bone.shearX;\n\t\t\tbone.ashearY = bone.shearY;\n\t\t}\n\n\t\t// Apply the parent bone transform to the root bone. The root bone always inherits scale, rotation and reflection.\n\t\tlet rootBone = this.getRootBone();\n\t\tif (!rootBone) throw new Error(\"Root bone must not be null.\");\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\trootBone.worldX = pa * this.x + pb * this.y + parent.worldX;\n\t\trootBone.worldY = pc * this.x + pd * this.y + parent.worldY;\n\n\t\tconst rx = (rootBone.rotation + rootBone.shearX) * MathUtils.degRad;\n\t\tconst ry = (rootBone.rotation + 90 + rootBone.shearY) * MathUtils.degRad;\n\t\tconst la = Math.cos(rx) * rootBone.scaleX;\n\t\tconst lb = Math.cos(ry) * rootBone.scaleY;\n\t\tconst lc = Math.sin(rx) * rootBone.scaleX;\n\t\tconst ld = Math.sin(ry) * rootBone.scaleY;\n\t\trootBone.a = (pa * la + pb * lc) * this.scaleX;\n\t\trootBone.b = (pa * lb + pb * ld) * this.scaleX;\n\t\trootBone.c = (pc * la + pd * lc) * this.scaleY;\n\t\trootBone.d = (pc * lb + pd * ld) * this.scaleY;\n\n\t\t// Update everything except root bone.\n\t\tlet updateCache = this._updateCache;\n\t\tfor (let i = 0, n = updateCache.length; i < n; i++) {\n\t\t\tlet updatable = updateCache[i];\n\t\t\tif (updatable != rootBone) updatable.update(physics);\n\t\t}\n\t}\n\n\t/** Sets the bones, constraints, and slots to their setup pose values. */\n\tsetToSetupPose () {\n\t\tthis.setBonesToSetupPose();\n\t\tthis.setSlotsToSetupPose();\n\t}\n\n\t/** Sets the bones and constraints to their setup pose values. */\n\tsetBonesToSetupPose () {\n\t\tfor (const bone of this.bones) bone.setToSetupPose();\n\t\tfor (const constraint of this.ikConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.transformConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.pathConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.physicsConstraints) constraint.setToSetupPose();\n\t}\n\n\t/** Sets the slots and draw order to their setup pose values. */\n\tsetSlotsToSetupPose () {\n\t\tlet slots = this.slots;\n\t\tUtils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\n\t\tfor (let i = 0, n = slots.length; i < n; i++)\n\t\t\tslots[i].setToSetupPose();\n\t}\n\n\t/** @returns May return null. */\n\tgetRootBone () {\n\t\tif (this.bones.length == 0) return null;\n\t\treturn this.bones[0];\n\t}\n\n\t/** @returns May be null. */\n\tfindBone (boneName: string) {\n\t\tif (!boneName) throw new Error(\"boneName cannot be null.\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (bone.data.name == boneName) return bone;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\n\t * repeatedly.\n\t * @returns May be null. */\n\tfindSlot (slotName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.data.name == slotName) return slot;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Sets a skin by name.\n\t *\n\t * See {@link #setSkin()}. */\n\tsetSkinByName (skinName: string) {\n\t\tlet skin = this.data.findSkin(skinName);\n\t\tif (!skin) throw new Error(\"Skin not found: \" + skinName);\n\t\tthis.setSkin(skin);\n\t}\n\n\t/** Sets the skin used to look up attachments before looking in the {@link SkeletonData#defaultSkin default skin}. If the\n\t * skin is changed, {@link #updateCache()} is called.\n\t *\n\t * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\n\t * old skin, each slot's setup mode attachment is attached from the new skin.\n\t *\n\t * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling\n\t * {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply()} is called before the next time the\n\t * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.\n\t * @param newSkin May be null. */\n\tsetSkin (newSkin: Skin) {\n\t\tif (newSkin == this.skin) return;\n\t\tif (newSkin) {\n\t\t\tif (this.skin)\n\t\t\t\tnewSkin.attachAll(this, this.skin);\n\t\t\telse {\n\t\t\t\tlet slots = this.slots;\n\t\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\t\tlet slot = slots[i];\n\t\t\t\t\tlet name = slot.data.attachmentName;\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tlet attachment = newSkin.getAttachment(i, name);\n\t\t\t\t\t\tif (attachment) slot.setAttachment(attachment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.skin = newSkin;\n\t\tthis.updateCache();\n\t}\n\n\n\t/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment\n\t * name.\n\t *\n\t * See {@link #getAttachment()}.\n\t * @returns May be null. */\n\tgetAttachmentByName (slotName: string, attachmentName: string): Attachment | null {\n\t\tlet slot = this.data.findSlot(slotName);\n\t\tif (!slot) throw new Error(`Can't find slot with name ${slotName}`);\n\t\treturn this.getAttachment(slot.index, attachmentName);\n\t}\n\n\t/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and\n\t * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.\n\t *\n\t * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.\n\t * @returns May be null. */\n\tgetAttachment (slotIndex: number, attachmentName: string): Attachment | null {\n\t\tif (!attachmentName) throw new Error(\"attachmentName cannot be null.\");\n\t\tif (this.skin) {\n\t\t\tlet attachment = this.skin.getAttachment(slotIndex, attachmentName);\n\t\t\tif (attachment) return attachment;\n\t\t}\n\t\tif (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\n\t\treturn null;\n\t}\n\n\t/** A convenience method to set an attachment by finding the slot with {@link #findSlot()}, finding the attachment with\n\t * {@link #getAttachment()}, then setting the slot's {@link Slot#attachment}.\n\t * @param attachmentName May be null to clear the slot's attachment. */\n\tsetAttachment (slotName: string, attachmentName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.data.name == slotName) {\n\t\t\t\tlet attachment: Attachment | null = null;\n\t\t\t\tif (attachmentName) {\n\t\t\t\t\tattachment = this.getAttachment(i, attachmentName);\n\t\t\t\t\tif (!attachment) throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\n\t\t\t\t}\n\t\t\t\tslot.setAttachment(attachment);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"Slot not found: \" + slotName);\n\t}\n\n\n\t/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\n\t * than to call it repeatedly.\n\t * @return May be null. */\n\tfindIkConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.ikConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\n\t * this method than to call it repeatedly.\n\t * @return May be null. */\n\tfindTransformConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.transformConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\n\t * than to call it repeatedly.\n\t * @return May be null. */\n\tfindPathConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.pathConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this\n\t * method than to call it repeatedly. */\n\tfindPhysicsConstraint (constraintName: string) {\n\t\tif (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.physicsConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`.\n\t * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */\n\tgetBoundsRect (clipper?: SkeletonClipping) {\n\t\tlet offset = new Vector2();\n\t\tlet size = new Vector2();\n\t\tthis.getBounds(offset, size, undefined, clipper);\n\t\treturn { x: offset.x, y: offset.y, width: size.x, height: size.y };\n\t}\n\n\t/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\n\t * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB.\n\t * @param size An output value, the width and height of the AABB.\n\t * @param temp Working memory to temporarily store attachments' computed world vertices.\n\t * @param clipper {@link SkeletonClipping} to use. If null, no clipping is applied. */\n\tgetBounds (offset: Vector2, size: Vector2, temp: Array = new Array(2), clipper: SkeletonClipping | null = null) {\n\t\tif (!offset) throw new Error(\"offset cannot be null.\");\n\t\tif (!size) throw new Error(\"size cannot be null.\");\n\t\tlet drawOrder = this.drawOrder;\n\t\tlet minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tif (!slot.bone.active) continue;\n\t\t\tlet verticesLength = 0;\n\t\t\tlet vertices: NumberArrayLike | null = null;\n\t\t\tlet triangles: NumberArrayLike | null = null;\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tverticesLength = 8;\n\t\t\t\tvertices = Utils.setArraySize(temp, verticesLength, 0);\n\t\t\t\tattachment.computeWorldVertices(slot, vertices, 0, 2);\n\t\t\t\ttriangles = Skeleton.quadTriangles;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = (attachment);\n\t\t\t\tverticesLength = mesh.worldVerticesLength;\n\t\t\t\tvertices = Utils.setArraySize(temp, verticesLength, 0);\n\t\t\t\tmesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t} else if (attachment instanceof ClippingAttachment && clipper != null) {\n\t\t\t\tclipper.clipStart(slot, attachment);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (vertices && triangles) {\n\t\t\t\tif (clipper != null && clipper.isClipping()) {\n\t\t\t\t\tclipper.clipTriangles(vertices, triangles, triangles.length);\n\t\t\t\t\tvertices = clipper.clippedVertices;\n\t\t\t\t\tverticesLength = clipper.clippedVertices.length;\n\t\t\t\t}\n\t\t\t\tfor (let ii = 0, nn = vertices.length; ii < nn; ii += 2) {\n\t\t\t\t\tlet x = vertices[ii], y = vertices[ii + 1];\n\t\t\t\t\tminX = Math.min(minX, x);\n\t\t\t\t\tminY = Math.min(minY, y);\n\t\t\t\t\tmaxX = Math.max(maxX, x);\n\t\t\t\t\tmaxY = Math.max(maxY, y);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (clipper != null) clipper.clipEndWithSlot(slot);\n\t\t}\n\t\tif (clipper != null) clipper.clipEnd();\n\t\toffset.set(minX, minY);\n\t\tsize.set(maxX - minX, maxY - minY);\n\t}\n\n\t/** Increments the skeleton's {@link #time}. */\n\tupdate (delta: number) {\n\t\tthis.time += delta;\n\t}\n\n\tphysicsTranslate (x: number, y: number) {\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++)\n\t\t\tphysicsConstraints[i].translate(x, y);\n\t}\n\n\t/** Calls {@link PhysicsConstraint#rotate(float, float, float)} for each physics constraint. */\n\tphysicsRotate (x: number, y: number, degrees: number) {\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++)\n\t\t\tphysicsConstraints[i].rotate(x, y, degrees);\n\t}\n}\n\n/** Determines how physics and other non-deterministic updates are applied. */\nexport enum Physics {\n\t/** Physics are not updated or applied. */\n\tnone,\n\n\t/** Physics are reset to the current pose. */\n\treset,\n\n\t/** Physics are updated and the pose from physics is applied. */\n\tupdate,\n\n\t/** Physics are not updated but the pose from physics is applied. */\n\tpose\n}", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\n\n\n/** Stores the setup pose for a {@link PhysicsConstraint}.\n *

\n * See Physics constraints in the Spine User Guide. */\nexport class PhysicsConstraintData extends ConstraintData {\n\tprivate _bone: BoneData | null = null;\n\t/** The bone constrained by this physics constraint. */\n\tpublic set bone (boneData: BoneData) { this._bone = boneData; }\n\tpublic get bone () {\n\t\tif (!this._bone) throw new Error(\"BoneData not set.\")\n\t\telse return this._bone;\n\t}\n\n\tx = 0;\n\ty = 0;\n\trotate = 0;\n\tscaleX = 0;\n\tshearX = 0;\n\tlimit = 0;\n\tstep = 0;\n\tinertia = 0;\n\tstrength = 0;\n\tdamping = 0;\n\tmassInverse = 0;\n\twind = 0;\n\tgravity = 0;\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */\n\tmix = 0;\n\tinertiaGlobal = false;\n\tstrengthGlobal = false;\n\tdampingGlobal = false;\n\tmassGlobal = false;\n\twindGlobal = false;\n\tgravityGlobal = false;\n\tmixGlobal = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation } from \"./Animation\"\nimport { BoneData } from \"./BoneData.js\";\nimport { EventData } from \"./EventData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData } from \"./PathConstraintData.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\n\n/** Stores the setup pose and all of the stateless data for a skeleton.\n *\n * See [Data objects](http://esotericsoftware.com/spine-runtime-architecture#Data-objects) in the Spine Runtimes\n * Guide. */\nexport class SkeletonData {\n\n\t/** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */\n\tname: string | null = null;\n\n\t/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\n\tbones = new Array(); // Ordered parents first.\n\n\t/** The skeleton's slots in the setup pose draw order. */\n\tslots = new Array(); // Setup pose draw order.\n\n\tskins = new Array();\n\n\t/** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.\n\t *\n\t * See {@link Skeleton#getAttachmentByName()}.\n\t * May be null. */\n\tdefaultSkin: Skin | null = null;\n\n\t/** The skeleton's events. */\n\tevents = new Array();\n\n\t/** The skeleton's animations. */\n\tanimations = new Array();\n\n\t/** The skeleton's IK constraints. */\n\tikConstraints = new Array();\n\n\t/** The skeleton's transform constraints. */\n\ttransformConstraints = new Array();\n\n\t/** The skeleton's path constraints. */\n\tpathConstraints = new Array();\n\n\t/** The skeleton's physics constraints. */\n\tphysicsConstraints = new Array();\n\n\t/** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */\n\tx: number = 0;\n\n\t/** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */\n\ty: number = 0;\n\n\t/** The width of the skeleton's axis aligned bounding box in the setup pose. */\n\twidth: number = 0;\n\n\t/** The height of the skeleton's axis aligned bounding box in the setup pose. */\n\theight: number = 0;\n\n\t/** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default\n\t * is 100. */\n\treferenceScale = 100;\n\n\t/** The Spine version used to export the skeleton data, or null. */\n\tversion: string | null = null;\n\n\t/** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */\n\thash: string | null = null;\n\n\t// Nonessential\n\t/** The dopesheet FPS in Spine. Available only when nonessential data was exported. */\n\tfps = 0;\n\n\t/** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */\n\timagesPath: string | null = null;\n\n\t/** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */\n\taudioPath: string | null = null;\n\n\t/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindBone (boneName: string) {\n\t\tif (!boneName) throw new Error(\"boneName cannot be null.\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (bone.name == boneName) return bone;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindSlot (slotName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.name == slotName) return slot;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindSkin (skinName: string) {\n\t\tif (!skinName) throw new Error(\"skinName cannot be null.\");\n\t\tlet skins = this.skins;\n\t\tfor (let i = 0, n = skins.length; i < n; i++) {\n\t\t\tlet skin = skins[i];\n\t\t\tif (skin.name == skinName) return skin;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindEvent (eventDataName: string) {\n\t\tif (!eventDataName) throw new Error(\"eventDataName cannot be null.\");\n\t\tlet events = this.events;\n\t\tfor (let i = 0, n = events.length; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.name == eventDataName) return event;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to\n\t * call it multiple times.\n\t * @returns May be null. */\n\tfindAnimation (animationName: string) {\n\t\tif (!animationName) throw new Error(\"animationName cannot be null.\");\n\t\tlet animations = this.animations;\n\t\tfor (let i = 0, n = animations.length; i < n; i++) {\n\t\t\tlet animation = animations[i];\n\t\t\tif (animation.name == animationName) return animation;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindIkConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst ikConstraints = this.ikConstraints;\n\t\tfor (let i = 0, n = ikConstraints.length; i < n; i++) {\n\t\t\tconst constraint = ikConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\n\t * this method than to call it multiple times.\n\t * @return May be null. */\n\tfindTransformConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst transformConstraints = this.transformConstraints;\n\t\tfor (let i = 0, n = transformConstraints.length; i < n; i++) {\n\t\t\tconst constraint = transformConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindPathConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst pathConstraints = this.pathConstraints;\n\t\tfor (let i = 0, n = pathConstraints.length; i < n; i++) {\n\t\t\tconst constraint = pathConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindPhysicsConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++) {\n\t\t\tconst constraint = physicsConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment } from \"./attachments/Attachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Color, StringMap } from \"./Utils.js\";\n\n/** Stores an entry in the skin consisting of the slot index, name, and attachment **/\nexport class SkinEntry {\n\tconstructor (public slotIndex: number = 0, public name: string, public attachment: Attachment) { }\n}\n\n/** Stores attachments by slot index and attachment name.\n *\n * See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and\n * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. */\nexport class Skin {\n\t/** The skin's name, which is unique across all skins in the skeleton. */\n\tname: string;\n\n\tattachments = new Array>();\n\tbones = Array();\n\tconstraints = new Array();\n\n\t/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */\n\tcolor = new Color(0.99607843, 0.61960787, 0.30980393, 1); // fe9e4fff\n\n\tconstructor (name: string) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t}\n\n\t/** Adds an attachment to the skin for the specified slot index and name. */\n\tsetAttachment (slotIndex: number, name: string, attachment: Attachment) {\n\t\tif (!attachment) throw new Error(\"attachment cannot be null.\");\n\t\tlet attachments = this.attachments;\n\t\tif (slotIndex >= attachments.length) attachments.length = slotIndex + 1;\n\t\tif (!attachments[slotIndex]) attachments[slotIndex] = {};\n\t\tattachments[slotIndex][name] = attachment;\n\t}\n\n\t/** Adds all attachments, bones, and constraints from the specified skin to this skin. */\n\taddSkin (skin: Skin) {\n\t\tfor (let i = 0; i < skin.bones.length; i++) {\n\t\t\tlet bone = skin.bones[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.bones.length; ii++) {\n\t\t\t\tif (this.bones[ii] == bone) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.bones.push(bone);\n\t\t}\n\n\t\tfor (let i = 0; i < skin.constraints.length; i++) {\n\t\t\tlet constraint = skin.constraints[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.constraints.length; ii++) {\n\t\t\t\tif (this.constraints[ii] == constraint) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.constraints.push(constraint);\n\t\t}\n\n\t\tlet attachments = skin.getAttachments();\n\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\tvar attachment = attachments[i];\n\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t}\n\t}\n\n\t/** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not\n\t * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */\n\tcopySkin (skin: Skin) {\n\t\tfor (let i = 0; i < skin.bones.length; i++) {\n\t\t\tlet bone = skin.bones[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.bones.length; ii++) {\n\t\t\t\tif (this.bones[ii] == bone) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.bones.push(bone);\n\t\t}\n\n\t\tfor (let i = 0; i < skin.constraints.length; i++) {\n\t\t\tlet constraint = skin.constraints[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.constraints.length; ii++) {\n\t\t\t\tif (this.constraints[ii] == constraint) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.constraints.push(constraint);\n\t\t}\n\n\t\tlet attachments = skin.getAttachments();\n\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\tvar attachment = attachments[i];\n\t\t\tif (!attachment.attachment) continue;\n\t\t\tif (attachment.attachment instanceof MeshAttachment) {\n\t\t\t\tattachment.attachment = attachment.attachment.newLinkedMesh();\n\t\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t\t} else {\n\t\t\t\tattachment.attachment = attachment.attachment.copy();\n\t\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns the attachment for the specified slot index and name, or null. */\n\tgetAttachment (slotIndex: number, name: string): Attachment | null {\n\t\tlet dictionary = this.attachments[slotIndex];\n\t\treturn dictionary ? dictionary[name] : null;\n\t}\n\n\t/** Removes the attachment in the skin for the specified slot index and name, if any. */\n\tremoveAttachment (slotIndex: number, name: string) {\n\t\tlet dictionary = this.attachments[slotIndex];\n\t\tif (dictionary) delete dictionary[name];\n\t}\n\n\t/** Returns all attachments in this skin. */\n\tgetAttachments (): Array {\n\t\tlet entries = new Array();\n\t\tfor (var i = 0; i < this.attachments.length; i++) {\n\t\t\tlet slotAttachments = this.attachments[i];\n\t\t\tif (slotAttachments) {\n\t\t\t\tfor (let name in slotAttachments) {\n\t\t\t\t\tlet attachment = slotAttachments[name];\n\t\t\t\t\tif (attachment) entries.push(new SkinEntry(i, name, attachment));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn entries;\n\t}\n\n\t/** Returns all attachments in this skin for the specified slot index. */\n\tgetAttachmentsForSlot (slotIndex: number, attachments: Array) {\n\t\tlet slotAttachments = this.attachments[slotIndex];\n\t\tif (slotAttachments) {\n\t\t\tfor (let name in slotAttachments) {\n\t\t\t\tlet attachment = slotAttachments[name];\n\t\t\t\tif (attachment) attachments.push(new SkinEntry(slotIndex, name, attachment));\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Clears all attachments, bones, and constraints. */\n\tclear () {\n\t\tthis.attachments.length = 0;\n\t\tthis.bones.length = 0;\n\t\tthis.constraints.length = 0;\n\t}\n\n\t/** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\n\tattachAll (skeleton: Skeleton, oldSkin: Skin) {\n\t\tlet slotIndex = 0;\n\t\tfor (let i = 0; i < skeleton.slots.length; i++) {\n\t\t\tlet slot = skeleton.slots[i];\n\t\t\tlet slotAttachment = slot.getAttachment();\n\t\t\tif (slotAttachment && slotIndex < oldSkin.attachments.length) {\n\t\t\t\tlet dictionary = oldSkin.attachments[slotIndex];\n\t\t\t\tfor (let key in dictionary) {\n\t\t\t\t\tlet skinAttachment: Attachment = dictionary[key];\n\t\t\t\t\tif (slotAttachment == skinAttachment) {\n\t\t\t\t\t\tlet attachment = this.getAttachment(slotIndex, key);\n\t\t\t\t\t\tif (attachment) slot.setAttachment(attachment);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tslotIndex++;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { Color } from \"./Utils.js\";\n\n/** Stores the setup pose for a {@link Slot}. */\nexport class SlotData {\n\t/** The index of the slot in {@link Skeleton#getSlots()}. */\n\tindex: number = 0;\n\n\t/** The name of the slot, which is unique across all slots in the skeleton. */\n\tname: string;\n\n\t/** The bone this slot belongs to. */\n\tboneData: BoneData;\n\n\t/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two\n\t * color tinting. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\n\t * color's alpha is not used. */\n\tdarkColor: Color | null = null;\n\n\t/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */\n\tattachmentName: string | null = null;\n\n\t/** The blend mode for drawing the slot's attachment. */\n\tblendMode: BlendMode = BlendMode.Normal;\n\n\t/** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */\n\tvisible = true;\n\n\tconstructor (index: number, name: string, boneData: BoneData) {\n\t\tif (index < 0) throw new Error(\"index must be >= 0.\");\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tif (!boneData) throw new Error(\"boneData cannot be null.\");\n\t\tthis.index = index;\n\t\tthis.name = name;\n\t\tthis.boneData = boneData;\n\t}\n}\n\n/** Determines how images are blended with existing pixels when drawn. */\nexport enum BlendMode { Normal, Additive, Multiply, Screen }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { BoneData } from \"./BoneData.js\";\n\n/** Stores the setup pose for a {@link TransformConstraint}.\n *\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */\nexport class TransformConstraintData extends ConstraintData {\n\n\t/** The bones that will be modified by this transform constraint. */\n\tbones = new Array();\n\n\t/** The target bone whose world transform will be copied to the constrained bones. */\n\tprivate _target: BoneData | null = null;\n\tpublic set target (boneData: BoneData) { this._target = boneData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"BoneData not set.\")\n\t\telse return this._target;\n\t}\n\n\tmixRotate = 0;\n\tmixX = 0;\n\tmixY = 0;\n\tmixScaleX = 0;\n\tmixScaleY = 0;\n\tmixShearY = 0;\n\n\t/** An offset added to the constrained bone rotation. */\n\toffsetRotation = 0;\n\n\t/** An offset added to the constrained bone X translation. */\n\toffsetX = 0;\n\n\t/** An offset added to the constrained bone Y translation. */\n\toffsetY = 0;\n\n\t/** An offset added to the constrained bone scaleX. */\n\toffsetScaleX = 0;\n\n\t/** An offset added to the constrained bone scaleY. */\n\toffsetScaleY = 0;\n\n\t/** An offset added to the constrained bone shearY. */\n\toffsetShearY = 0;\n\n\trelative = false;\n\tlocal = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, Timeline, InheritTimeline, AttachmentTimeline, RGBATimeline, RGBTimeline, RGBA2Timeline, RGB2Timeline, AlphaTimeline, RotateTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline, CurveTimeline1, CurveTimeline2, CurveTimeline, SequenceTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintDampingTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintWindTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintMixTimeline } from \"./Animation.js\";\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { Sequence, SequenceModeValues } from \"./attachments/Sequence.js\";\nimport { BoneData } from \"./BoneData.js\";\nimport { Event } from \"./Event.js\";\nimport { EventData } from \"./EventData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData, PositionMode, SpacingMode } from \"./PathConstraintData.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Color, Utils } from \"./Utils.js\";\n\n/** Loads skeleton data in the Spine binary format.\n *\n * See [Spine binary format](http://esotericsoftware.com/spine-binary-format) and\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\n * Runtimes Guide. */\nexport class SkeletonBinary {\n\t/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\n\t * runtime than were used in Spine.\n\t *\n\t * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\n\tscale = 1;\n\n\tattachmentLoader: AttachmentLoader;\n\tprivate linkedMeshes = new Array();\n\n\tconstructor (attachmentLoader: AttachmentLoader) {\n\t\tthis.attachmentLoader = attachmentLoader;\n\t}\n\n\treadSkeletonData (binary: Uint8Array | ArrayBuffer): SkeletonData {\n\t\tlet scale = this.scale;\n\n\t\tlet skeletonData = new SkeletonData();\n\t\tskeletonData.name = \"\"; // BOZO\n\n\t\tlet input = new BinaryInput(binary);\n\n\t\tlet lowHash = input.readInt32();\n\t\tlet highHash = input.readInt32();\n\t\tskeletonData.hash = highHash == 0 && lowHash == 0 ? null : highHash.toString(16) + lowHash.toString(16);\n\t\tskeletonData.version = input.readString();\n\t\tskeletonData.x = input.readFloat();\n\t\tskeletonData.y = input.readFloat();\n\t\tskeletonData.width = input.readFloat();\n\t\tskeletonData.height = input.readFloat();\n\t\tskeletonData.referenceScale = input.readFloat() * scale;\n\n\t\tlet nonessential = input.readBoolean();\n\t\tif (nonessential) {\n\t\t\tskeletonData.fps = input.readFloat();\n\t\t\tskeletonData.imagesPath = input.readString();\n\t\t\tskeletonData.audioPath = input.readString();\n\t\t}\n\n\t\tlet n = 0;\n\t\t// Strings.\n\t\tn = input.readInt(true)\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet str = input.readString();\n\t\t\tif (!str) throw new Error(\"String in string table must not be null.\");\n\t\t\tinput.strings.push(str);\n\t\t}\n\n\t\t// Bones.\n\t\tn = input.readInt(true)\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Bone name must not be null.\");\n\t\t\tlet parent = i == 0 ? null : skeletonData.bones[input.readInt(true)];\n\t\t\tlet data = new BoneData(i, name, parent);\n\t\t\tdata.rotation = input.readFloat();\n\t\t\tdata.x = input.readFloat() * scale;\n\t\t\tdata.y = input.readFloat() * scale;\n\t\t\tdata.scaleX = input.readFloat();\n\t\t\tdata.scaleY = input.readFloat();\n\t\t\tdata.shearX = input.readFloat();\n\t\t\tdata.shearY = input.readFloat();\n\t\t\tdata.length = input.readFloat() * scale;\n\t\t\tdata.inherit = input.readByte();\n\t\t\tdata.skinRequired = input.readBoolean();\n\t\t\tif (nonessential) {\n\t\t\t\tColor.rgba8888ToColor(data.color, input.readInt32());\n\t\t\t\tdata.icon = input.readString() ?? undefined;\n\t\t\t\tdata.visible = input.readBoolean();\n\t\t\t}\n\t\t\tskeletonData.bones.push(data);\n\t\t}\n\n\t\t// Slots.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet slotName = input.readString();\n\t\t\tif (!slotName) throw new Error(\"Slot name must not be null.\");\n\t\t\tlet boneData = skeletonData.bones[input.readInt(true)];\n\t\t\tlet data = new SlotData(i, slotName, boneData);\n\t\t\tColor.rgba8888ToColor(data.color, input.readInt32());\n\n\t\t\tlet darkColor = input.readInt32();\n\t\t\tif (darkColor != -1) Color.rgb888ToColor(data.darkColor = new Color(), darkColor);\n\n\t\t\tdata.attachmentName = input.readStringRef();\n\t\t\tdata.blendMode = input.readInt(true);\n\t\t\tif (nonessential) data.visible = input.readBoolean();\n\t\t\tskeletonData.slots.push(data);\n\t\t}\n\n\t\t// IK constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"IK constraint data name must not be null.\");\n\t\t\tlet data = new IkConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tdata.bendDirection = (flags & 2) != 0 ? 1 : -1;\n\t\t\tdata.compress = (flags & 4) != 0;\n\t\t\tdata.stretch = (flags & 8) != 0;\n\t\t\tdata.uniform = (flags & 16) != 0;\n\t\t\tif ((flags & 32) != 0) data.mix = (flags & 64) != 0 ? input.readFloat() : 1;\n\t\t\tif ((flags & 128) != 0) data.softness = input.readFloat() * scale;\n\t\t\tskeletonData.ikConstraints.push(data);\n\t\t}\n\n\t\t// Transform constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Transform constraint data name must not be null.\");\n\t\t\tlet data = new TransformConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tdata.local = (flags & 2) != 0;\n\t\t\tdata.relative = (flags & 4) != 0;\n\t\t\tif ((flags & 8) != 0) data.offsetRotation = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.offsetX = input.readFloat() * scale;\n\t\t\tif ((flags & 32) != 0) data.offsetY = input.readFloat() * scale;\n\t\t\tif ((flags & 64) != 0) data.offsetScaleX = input.readFloat();\n\t\t\tif ((flags & 128) != 0) data.offsetScaleY = input.readFloat();\n\t\t\tflags = input.readByte();\n\t\t\tif ((flags & 1) != 0) data.offsetShearY = input.readFloat();\n\t\t\tif ((flags & 2) != 0) data.mixRotate = input.readFloat();\n\t\t\tif ((flags & 4) != 0) data.mixX = input.readFloat();\n\t\t\tif ((flags & 8) != 0) data.mixY = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.mixScaleX = input.readFloat();\n\t\t\tif ((flags & 32) != 0) data.mixScaleY = input.readFloat();\n\t\t\tif ((flags & 64) != 0) data.mixShearY = input.readFloat();\n\t\t\tskeletonData.transformConstraints.push(data);\n\t\t}\n\n\t\t// Path constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Path constraint data name must not be null.\");\n\t\t\tlet data = new PathConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tdata.skinRequired = input.readBoolean();\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.slots[input.readInt(true)];\n\t\t\tconst flags = input.readByte();\n\t\t\tdata.positionMode = flags & 1;\n\t\t\tdata.spacingMode = (flags >> 1) & 3;\n\t\t\tdata.rotateMode = (flags >> 3) & 3;\n\t\t\tif ((flags & 128) != 0) data.offsetRotation = input.readFloat();\n\t\t\tdata.position = input.readFloat();\n\t\t\tif (data.positionMode == PositionMode.Fixed) data.position *= scale;\n\t\t\tdata.spacing = input.readFloat();\n\t\t\tif (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\n\t\t\tdata.mixRotate = input.readFloat();\n\t\t\tdata.mixX = input.readFloat();\n\t\t\tdata.mixY = input.readFloat();\n\t\t\tskeletonData.pathConstraints.push(data);\n\t\t}\n\n\t\t// Physics constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tconst name = input.readString();\n\t\t\tif (!name) throw new Error(\"Physics constraint data name must not be null.\");\n\t\t\tconst data = new PhysicsConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tdata.bone = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tif ((flags & 2) != 0) data.x = input.readFloat();\n\t\t\tif ((flags & 4) != 0) data.y = input.readFloat();\n\t\t\tif ((flags & 8) != 0) data.rotate = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.scaleX = input.readFloat();\n\t\t\tif ((flags & 32) != 0) data.shearX = input.readFloat();\n\t\t\tdata.limit = ((flags & 64) != 0 ? input.readFloat() : 5000) * scale;\n\t\t\tdata.step = 1 / input.readUnsignedByte();\n\t\t\tdata.inertia = input.readFloat();\n\t\t\tdata.strength = input.readFloat();\n\t\t\tdata.damping = input.readFloat();\n\t\t\tdata.massInverse = (flags & 128) != 0 ? input.readFloat() : 1;\n\t\t\tdata.wind = input.readFloat();\n\t\t\tdata.gravity = input.readFloat();\n\t\t\tflags = input.readByte();\n\t\t\tif ((flags & 1) != 0) data.inertiaGlobal = true;\n\t\t\tif ((flags & 2) != 0) data.strengthGlobal = true;\n\t\t\tif ((flags & 4) != 0) data.dampingGlobal = true;\n\t\t\tif ((flags & 8) != 0) data.massGlobal = true;\n\t\t\tif ((flags & 16) != 0) data.windGlobal = true;\n\t\t\tif ((flags & 32) != 0) data.gravityGlobal = true;\n\t\t\tif ((flags & 64) != 0) data.mixGlobal = true;\n\t\t\tdata.mix = (flags & 128) != 0 ? input.readFloat() : 1;\n\t\t\tskeletonData.physicsConstraints.push(data);\n\t\t}\n\n\t\t// Default skin.\n\t\tlet defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\n\t\tif (defaultSkin) {\n\t\t\tskeletonData.defaultSkin = defaultSkin;\n\t\t\tskeletonData.skins.push(defaultSkin);\n\t\t}\n\n\t\t// Skins.\n\t\t{\n\t\t\tlet i = skeletonData.skins.length;\n\t\t\tUtils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\n\t\t\tfor (; i < n; i++) {\n\t\t\t\tlet skin = this.readSkin(input, skeletonData, false, nonessential);\n\t\t\t\tif (!skin) throw new Error(\"readSkin() should not have returned null.\");\n\t\t\t\tskeletonData.skins[i] = skin;\n\t\t\t}\n\t\t}\n\n\t\t// Linked meshes.\n\t\tn = this.linkedMeshes.length;\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet linkedMesh = this.linkedMeshes[i];\n\t\t\tconst skin = skeletonData.skins[linkedMesh.skinIndex];\n\t\t\tif (!linkedMesh.parent) throw new Error(\"Linked mesh parent must not be null\");\n\t\t\tlet parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n\t\t\tif (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);\n\t\t\tlinkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent as VertexAttachment : linkedMesh.mesh;\n\t\t\tlinkedMesh.mesh.setParentMesh(parent as MeshAttachment);\n\t\t\tif (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\n\t\t}\n\t\tthis.linkedMeshes.length = 0;\n\n\t\t// Events.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet eventName = input.readString();\n\t\t\tif (!eventName) throw new Error(\"Event data name must not be null\");\n\t\t\tlet data = new EventData(eventName);\n\t\t\tdata.intValue = input.readInt(false);\n\t\t\tdata.floatValue = input.readFloat();\n\t\t\tdata.stringValue = input.readString();\n\t\t\tdata.audioPath = input.readString();\n\t\t\tif (data.audioPath) {\n\t\t\t\tdata.volume = input.readFloat();\n\t\t\t\tdata.balance = input.readFloat();\n\t\t\t}\n\t\t\tskeletonData.events.push(data);\n\t\t}\n\n\t\t// Animations.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet animationName = input.readString();\n\t\t\tif (!animationName) throw new Error(\"Animatio name must not be null.\");\n\t\t\tskeletonData.animations.push(this.readAnimation(input, animationName, skeletonData));\n\t\t}\n\t\treturn skeletonData;\n\t}\n\n\tprivate readSkin (input: BinaryInput, skeletonData: SkeletonData, defaultSkin: boolean, nonessential: boolean): Skin | null {\n\t\tlet skin = null;\n\t\tlet slotCount = 0;\n\n\t\tif (defaultSkin) {\n\t\t\tslotCount = input.readInt(true)\n\t\t\tif (slotCount == 0) return null;\n\t\t\tskin = new Skin(\"default\");\n\t\t} else {\n\t\t\tlet skinName = input.readString();\n\t\t\tif (!skinName) throw new Error(\"Skin name must not be null.\");\n\t\t\tskin = new Skin(skinName);\n\t\t\tif (nonessential) Color.rgba8888ToColor(skin.color, input.readInt32());\n\t\t\tskin.bones.length = input.readInt(true);\n\t\t\tfor (let i = 0, n = skin.bones.length; i < n; i++)\n\t\t\t\tskin.bones[i] = skeletonData.bones[input.readInt(true)];\n\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.physicsConstraints[input.readInt(true)]);\n\n\t\t\tslotCount = input.readInt(true);\n\t\t}\n\n\t\tfor (let i = 0; i < slotCount; i++) {\n\t\t\tlet slotIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet name = input.readStringRef();\n\t\t\t\tif (!name)\n\t\t\t\t\tthrow new Error(\"Attachment name must not be null\");\n\t\t\t\tlet attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name, nonessential);\n\t\t\t\tif (attachment) skin.setAttachment(slotIndex, name, attachment);\n\t\t\t}\n\t\t}\n\t\treturn skin;\n\t}\n\n\tprivate readAttachment (input: BinaryInput, skeletonData: SkeletonData, skin: Skin, slotIndex: number, attachmentName: string | null | undefined, nonessential: boolean): Attachment | null {\n\t\tlet scale = this.scale;\n\n\t\tlet flags = input.readByte();\n\t\tconst name = (flags & 8) != 0 ? input.readStringRef() : attachmentName;\n\t\tif (!name) throw new Error(\"Attachment name must not be null\");\n\t\tswitch ((flags & 0b111) as AttachmentType) { // BUG?\n\t\t\tcase AttachmentType.Region: {\n\t\t\t\tlet path = (flags & 16) != 0 ? input.readStringRef() : null;\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tlet rotation = (flags & 128) != 0 ? input.readFloat() : 0;\n\t\t\t\tlet x = input.readFloat();\n\t\t\t\tlet y = input.readFloat();\n\t\t\t\tlet scaleX = input.readFloat();\n\t\t\t\tlet scaleY = input.readFloat();\n\t\t\t\tlet width = input.readFloat();\n\t\t\t\tlet height = input.readFloat();\n\n\t\t\t\tif (!path) path = name;\n\t\t\t\tlet region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\n\t\t\t\tif (!region) return null;\n\t\t\t\tregion.path = path;\n\t\t\t\tregion.x = x * scale;\n\t\t\t\tregion.y = y * scale;\n\t\t\t\tregion.scaleX = scaleX;\n\t\t\t\tregion.scaleY = scaleY;\n\t\t\t\tregion.rotation = rotation;\n\t\t\t\tregion.width = width * scale;\n\t\t\t\tregion.height = height * scale;\n\t\t\t\tColor.rgba8888ToColor(region.color, color);\n\t\t\t\tregion.sequence = sequence;\n\t\t\t\tif (sequence == null) region.updateRegion();\n\t\t\t\treturn region;\n\t\t\t}\n\t\t\tcase AttachmentType.BoundingBox: {\n\t\t\t\tlet vertices = this.readVertices(input, (flags & 16) != 0);\n\t\t\t\tlet color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tlet box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n\t\t\t\tif (!box) return null;\n\t\t\t\tbox.worldVerticesLength = vertices.length;\n\t\t\t\tbox.vertices = vertices.vertices!;\n\t\t\t\tbox.bones = vertices.bones;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(box.color, color);\n\t\t\t\treturn box;\n\t\t\t}\n\t\t\tcase AttachmentType.Mesh: {\n\t\t\t\tlet path = (flags & 16) != 0 ? input.readStringRef() : name;\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tconst hullLength = input.readInt(true);\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 128) != 0);\n\t\t\t\tconst uvs = this.readFloatArray(input, vertices.length, 1);\n\t\t\t\tconst triangles = this.readShortArray(input, (vertices.length - hullLength - 2) * 3);\n\t\t\t\tlet edges: number[] = [];\n\t\t\t\tlet width = 0, height = 0;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tedges = this.readShortArray(input, input.readInt(true));\n\t\t\t\t\twidth = input.readFloat();\n\t\t\t\t\theight = input.readFloat();\n\t\t\t\t}\n\n\t\t\t\tif (!path) path = name;\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\t\t\t\tColor.rgba8888ToColor(mesh.color, color);\n\t\t\t\tmesh.bones = vertices.bones;\n\t\t\t\tmesh.vertices = vertices.vertices!;\n\t\t\t\tmesh.worldVerticesLength = vertices.length;\n\t\t\t\tmesh.triangles = triangles;\n\t\t\t\tmesh.regionUVs = uvs;\n\t\t\t\tif (sequence == null) mesh.updateRegion();\n\t\t\t\tmesh.hullLength = hullLength << 1;\n\t\t\t\tmesh.sequence = sequence;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tmesh.edges = edges;\n\t\t\t\t\tmesh.width = width * scale;\n\t\t\t\t\tmesh.height = height * scale;\n\t\t\t\t}\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase AttachmentType.LinkedMesh: {\n\t\t\t\tconst path = (flags & 16) != 0 ? input.readStringRef() : name;\n\t\t\t\tif (path == null) throw new Error(\"Path of linked mesh must not be null\");\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tconst inheritTimelines = (flags & 128) != 0;\n\t\t\t\tconst skinIndex = input.readInt(true);\n\t\t\t\tconst parent = input.readStringRef();\n\t\t\t\tlet width = 0, height = 0;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\twidth = input.readFloat();\n\t\t\t\t\theight = input.readFloat();\n\t\t\t\t}\n\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\t\t\t\tColor.rgba8888ToColor(mesh.color, color);\n\t\t\t\tmesh.sequence = sequence;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tmesh.width = width * scale;\n\t\t\t\t\tmesh.height = height * scale;\n\t\t\t\t}\n\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, skinIndex, slotIndex, parent, inheritTimelines));\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase AttachmentType.Path: {\n\t\t\t\tconst closed = (flags & 16) != 0;\n\t\t\t\tconst constantSpeed = (flags & 32) != 0;\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 64) != 0);\n\n\t\t\t\tconst lengths = Utils.newArray(vertices.length / 6, 0);\n\t\t\t\tfor (let i = 0, n = lengths.length; i < n; i++)\n\t\t\t\t\tlengths[i] = input.readFloat() * scale;\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst path = this.attachmentLoader.newPathAttachment(skin, name);\n\t\t\t\tif (!path) return null;\n\t\t\t\tpath.closed = closed;\n\t\t\t\tpath.constantSpeed = constantSpeed;\n\t\t\t\tpath.worldVerticesLength = vertices.length;\n\t\t\t\tpath.vertices = vertices.vertices!;\n\t\t\t\tpath.bones = vertices.bones;\n\t\t\t\tpath.lengths = lengths;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(path.color, color);\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tcase AttachmentType.Point: {\n\t\t\t\tconst rotation = input.readFloat();\n\t\t\t\tconst x = input.readFloat();\n\t\t\t\tconst y = input.readFloat();\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst point = this.attachmentLoader.newPointAttachment(skin, name);\n\t\t\t\tif (!point) return null;\n\t\t\t\tpoint.x = x * scale;\n\t\t\t\tpoint.y = y * scale;\n\t\t\t\tpoint.rotation = rotation;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(point.color, color);\n\t\t\t\treturn point;\n\t\t\t}\n\t\t\tcase AttachmentType.Clipping: {\n\t\t\t\tconst endSlotIndex = input.readInt(true);\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 16) != 0);\n\t\t\t\tlet color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tlet clip = this.attachmentLoader.newClippingAttachment(skin, name);\n\t\t\t\tif (!clip) return null;\n\t\t\t\tclip.endSlot = skeletonData.slots[endSlotIndex];\n\t\t\t\tclip.worldVerticesLength = vertices.length;\n\t\t\t\tclip.vertices = vertices.vertices!;\n\t\t\t\tclip.bones = vertices.bones;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(clip.color, color);\n\t\t\t\treturn clip;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate readSequence (input: BinaryInput) {\n\t\tlet sequence = new Sequence(input.readInt(true));\n\t\tsequence.start = input.readInt(true);\n\t\tsequence.digits = input.readInt(true);\n\t\tsequence.setupIndex = input.readInt(true);\n\t\treturn sequence;\n\t}\n\n\tprivate readVertices (input: BinaryInput, weighted: boolean): Vertices {\n\t\tconst scale = this.scale;\n\t\tconst vertexCount = input.readInt(true);\n\t\tconst vertices = new Vertices();\n\t\tvertices.length = vertexCount << 1;\n\t\tif (!weighted) {\n\t\t\tvertices.vertices = this.readFloatArray(input, vertices.length, scale);\n\t\t\treturn vertices;\n\t\t}\n\t\tlet weights = new Array();\n\t\tlet bonesArray = new Array();\n\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\tlet boneCount = input.readInt(true);\n\t\t\tbonesArray.push(boneCount);\n\t\t\tfor (let ii = 0; ii < boneCount; ii++) {\n\t\t\t\tbonesArray.push(input.readInt(true));\n\t\t\t\tweights.push(input.readFloat() * scale);\n\t\t\t\tweights.push(input.readFloat() * scale);\n\t\t\t\tweights.push(input.readFloat());\n\t\t\t}\n\t\t}\n\t\tvertices.vertices = Utils.toFloatArray(weights);\n\t\tvertices.bones = bonesArray;\n\t\treturn vertices;\n\t}\n\n\tprivate readFloatArray (input: BinaryInput, n: number, scale: number): number[] {\n\t\tlet array = new Array(n);\n\t\tif (scale == 1) {\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tarray[i] = input.readFloat();\n\t\t} else {\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tarray[i] = input.readFloat() * scale;\n\t\t}\n\t\treturn array;\n\t}\n\n\tprivate readShortArray (input: BinaryInput, n: number): number[] {\n\t\tlet array = new Array(n);\n\t\tfor (let i = 0; i < n; i++)\n\t\t\tarray[i] = input.readInt(true);\n\t\treturn array;\n\t}\n\n\tprivate readAnimation (input: BinaryInput, name: string, skeletonData: SkeletonData): Animation {\n\t\tinput.readInt(true); // Number of timelines.\n\t\tlet timelines = new Array();\n\t\tlet scale = this.scale;\n\n\t\t// Slot timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet slotIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet timelineType = input.readByte();\n\t\t\t\tlet frameCount = input.readInt(true);\n\t\t\t\tlet frameLast = frameCount - 1;\n\t\t\t\tswitch (timelineType) {\n\t\t\t\t\tcase SLOT_ATTACHMENT: {\n\t\t\t\t\t\tlet timeline = new AttachmentTimeline(frameCount, slotIndex);\n\t\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++)\n\t\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat(), input.readStringRef());\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGBA: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBATimeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet a = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, a);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet a2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = r2;\n\t\t\t\t\t\t\tg = g2;\n\t\t\t\t\t\t\tb = b2;\n\t\t\t\t\t\t\ta = a2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGB: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBTimeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = r2;\n\t\t\t\t\t\t\tg = g2;\n\t\t\t\t\t\t\tb = b2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGBA2: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet a = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, a, r2, g2, b2);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet nr = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet na = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nr2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = nr;\n\t\t\t\t\t\t\tg = ng;\n\t\t\t\t\t\t\tb = nb;\n\t\t\t\t\t\t\ta = na;\n\t\t\t\t\t\t\tr2 = nr2;\n\t\t\t\t\t\t\tg2 = ng2;\n\t\t\t\t\t\t\tb2 = nb2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGB2: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, r2, g2, b2);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet nr = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nr2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = nr;\n\t\t\t\t\t\t\tg = ng;\n\t\t\t\t\t\t\tb = nb;\n\t\t\t\t\t\t\tr2 = nr2;\n\t\t\t\t\t\t\tg2 = ng2;\n\t\t\t\t\t\t\tb2 = nb2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_ALPHA: {\n\t\t\t\t\t\tlet timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex);\n\t\t\t\t\t\tlet time = input.readFloat(), a = input.readUnsignedByte() / 255;\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, a);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet a2 = input.readUnsignedByte() / 255;\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\ta = a2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bone timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet boneIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet type = input.readByte(), frameCount = input.readInt(true);\n\t\t\t\tif (type == BONE_INHERIT) {\n\t\t\t\t\tlet timeline = new InheritTimeline(frameCount, boneIndex);\n\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++) {\n\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat(), input.readByte());\n\t\t\t\t\t}\n\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase BONE_ROTATE:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATE:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATEX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATEY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALE:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALEX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALEY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEAR:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEARX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEARY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// IK constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\n\t\t\tlet timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);\n\t\t\tlet flags = input.readByte();\n\t\t\tlet time = input.readFloat(), mix = (flags & 1) != 0 ? ((flags & 2) != 0 ? input.readFloat() : 1) : 0;\n\t\t\tlet softness = (flags & 4) != 0 ? input.readFloat() * scale : 0;\n\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\ttimeline.setFrame(frame, time, mix, softness, (flags & 8) != 0 ? 1 : -1, (flags & 16) != 0, (flags & 32) != 0);\n\t\t\t\tif (frame == frameLast) break;\n\t\t\t\tflags = input.readByte();\n\t\t\t\tconst time2 = input.readFloat(), mix2 = (flags & 1) != 0 ? ((flags & 2) != 0 ? input.readFloat() : 1) : 0;\n\t\t\t\tconst softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0;\n\t\t\t\tif ((flags & 64) != 0) {\n\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t} else if ((flags & 128) != 0) {\n\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);\n\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);\n\t\t\t\t}\n\t\t\t\ttime = time2;\n\t\t\t\tmix = mix2;\n\t\t\t\tsoftness = softness2;\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Transform constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\n\t\t\tlet timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index);\n\t\t\tlet time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(),\n\t\t\t\tmixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat();\n\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\n\t\t\t\tif (frame == frameLast) break;\n\t\t\t\tlet time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(),\n\t\t\t\t\tmixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat();\n\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);\n\t\t\t\t}\n\t\t\t\ttime = time2;\n\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\tmixX = mixX2;\n\t\t\t\tmixY = mixY2;\n\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\tmixScaleY = mixScaleY2;\n\t\t\t\tmixShearY = mixShearY2;\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Path constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true);\n\t\t\tlet data = skeletonData.pathConstraints[index];\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase PATH_POSITION:\n\t\t\t\t\t\ttimelines\n\t\t\t\t\t\t\t.push(readTimeline1(input, new PathConstraintPositionTimeline(frameCount, bezierCount, index),\n\t\t\t\t\t\t\t\tdata.positionMode == PositionMode.Fixed ? scale : 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PATH_SPACING:\n\t\t\t\t\t\ttimelines\n\t\t\t\t\t\t\t.push(readTimeline1(input, new PathConstraintSpacingTimeline(frameCount, bezierCount, index),\n\t\t\t\t\t\t\t\tdata.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed ? scale : 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PATH_MIX:\n\t\t\t\t\t\tlet timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index);\n\t\t\t\t\t\tlet time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat();\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(),\n\t\t\t\t\t\t\t\tmixY2 = input.readFloat();\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Physics timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst index = input.readInt(true) - 1;\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true);\n\t\t\t\tif (type == PHYSICS_RESET) {\n\t\t\t\t\tconst timeline = new PhysicsConstraintResetTimeline(frameCount, index);\n\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++)\n\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat());\n\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase PHYSICS_INERTIA:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_STRENGTH:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_DAMPING:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_MASS:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_WIND:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_GRAVITY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_MIX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Deform timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet skin = skeletonData.skins[input.readInt(true)];\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet slotIndex = input.readInt(true);\n\t\t\t\tfor (let iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\n\t\t\t\t\tlet attachmentName = input.readStringRef();\n\t\t\t\t\tif (!attachmentName) throw new Error(\"attachmentName must not be null.\");\n\t\t\t\t\tlet attachment = skin.getAttachment(slotIndex, attachmentName);\n\t\t\t\t\tlet timelineType = input.readByte();\n\t\t\t\t\tlet frameCount = input.readInt(true);\n\t\t\t\t\tlet frameLast = frameCount - 1;\n\n\t\t\t\t\tswitch (timelineType) {\n\t\t\t\t\t\tcase ATTACHMENT_DEFORM: {\n\t\t\t\t\t\t\tlet vertexAttachment = attachment as VertexAttachment;\n\t\t\t\t\t\t\tlet weighted = vertexAttachment.bones;\n\t\t\t\t\t\t\tlet vertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tlet deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n\n\t\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\t\tlet timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment);\n\n\t\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\tlet deform;\n\t\t\t\t\t\t\t\tlet end = input.readInt(true);\n\t\t\t\t\t\t\t\tif (end == 0)\n\t\t\t\t\t\t\t\t\tdeform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tdeform = Utils.newFloatArray(deformLength);\n\t\t\t\t\t\t\t\t\tlet start = input.readInt(true);\n\t\t\t\t\t\t\t\t\tend += start;\n\t\t\t\t\t\t\t\t\tif (scale == 1) {\n\t\t\t\t\t\t\t\t\t\tfor (let v = start; v < end; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] = input.readFloat();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tfor (let v = start; v < end; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] = input.readFloat() * scale;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (!weighted) {\n\t\t\t\t\t\t\t\t\t\tfor (let v = 0, vn = deform.length; v < vn; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] += vertices[v];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, deform);\n\t\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase ATTACHMENT_SEQUENCE: {\n\t\t\t\t\t\t\tlet timeline = new SequenceTimeline(frameCount, slotIndex, attachment as unknown as HasTextureRegion);\n\t\t\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++) {\n\t\t\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\t\t\tlet modeAndIndex = input.readInt32();\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, SequenceModeValues[modeAndIndex & 0xf], modeAndIndex >> 4,\n\t\t\t\t\t\t\t\t\tinput.readFloat());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw order timeline.\n\t\tlet drawOrderCount = input.readInt(true);\n\t\tif (drawOrderCount > 0) {\n\t\t\tlet timeline = new DrawOrderTimeline(drawOrderCount);\n\t\t\tlet slotCount = skeletonData.slots.length;\n\t\t\tfor (let i = 0; i < drawOrderCount; i++) {\n\t\t\t\tlet time = input.readFloat();\n\t\t\t\tlet offsetCount = input.readInt(true);\n\t\t\t\tlet drawOrder = Utils.newArray(slotCount, 0);\n\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tdrawOrder[ii] = -1;\n\t\t\t\tlet unchanged = Utils.newArray(slotCount - offsetCount, 0);\n\t\t\t\tlet originalIndex = 0, unchangedIndex = 0;\n\t\t\t\tfor (let ii = 0; ii < offsetCount; ii++) {\n\t\t\t\t\tlet slotIndex = input.readInt(true);\n\t\t\t\t\t// Collect unchanged items.\n\t\t\t\t\twhile (originalIndex != slotIndex)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t// Set changed items.\n\t\t\t\t\tdrawOrder[originalIndex + input.readInt(true)] = originalIndex++;\n\t\t\t\t}\n\t\t\t\t// Collect remaining unchanged items.\n\t\t\t\twhile (originalIndex < slotCount)\n\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t// Fill in unchanged items.\n\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tif (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex];\n\t\t\t\ttimeline.setFrame(i, time, drawOrder);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Event timeline.\n\t\tlet eventCount = input.readInt(true);\n\t\tif (eventCount > 0) {\n\t\t\tlet timeline = new EventTimeline(eventCount);\n\t\t\tfor (let i = 0; i < eventCount; i++) {\n\t\t\t\tlet time = input.readFloat();\n\t\t\t\tlet eventData = skeletonData.events[input.readInt(true)];\n\t\t\t\tlet event = new Event(time, eventData);\n\t\t\t\tevent.intValue = input.readInt(false);\n\t\t\t\tevent.floatValue = input.readFloat();\n\t\t\t\tevent.stringValue = input.readString();\n\t\t\t\tif (event.stringValue == null) event.stringValue = eventData.stringValue;\n\t\t\t\tif (event.data.audioPath) {\n\t\t\t\t\tevent.volume = input.readFloat();\n\t\t\t\t\tevent.balance = input.readFloat();\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(i, event);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\tlet duration = 0;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\tduration = Math.max(duration, timelines[i].getDuration());\n\t\treturn new Animation(name, timelines, duration);\n\t}\n}\n\nexport class BinaryInput {\n\tconstructor (data: Uint8Array | ArrayBuffer, public strings = new Array(), private index: number = 0, private buffer = new DataView(data instanceof ArrayBuffer ? data : data.buffer)) {\n\t}\n\n\treadByte (): number {\n\t\treturn this.buffer.getInt8(this.index++);\n\t}\n\n\treadUnsignedByte (): number {\n\t\treturn this.buffer.getUint8(this.index++);\n\t}\n\n\treadShort (): number {\n\t\tlet value = this.buffer.getInt16(this.index);\n\t\tthis.index += 2;\n\t\treturn value;\n\t}\n\n\treadInt32 (): number {\n\t\tlet value = this.buffer.getInt32(this.index)\n\t\tthis.index += 4;\n\t\treturn value;\n\t}\n\n\treadInt (optimizePositive: boolean) {\n\t\tlet b = this.readByte();\n\t\tlet result = b & 0x7F;\n\t\tif ((b & 0x80) != 0) {\n\t\t\tb = this.readByte();\n\t\t\tresult |= (b & 0x7F) << 7;\n\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\tb = this.readByte();\n\t\t\t\tresult |= (b & 0x7F) << 14;\n\t\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\t\tb = this.readByte();\n\t\t\t\t\tresult |= (b & 0x7F) << 21;\n\t\t\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\t\t\tb = this.readByte();\n\t\t\t\t\t\tresult |= (b & 0x7F) << 28;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn optimizePositive ? result : ((result >>> 1) ^ -(result & 1));\n\t}\n\n\treadStringRef (): string | null {\n\t\tlet index = this.readInt(true);\n\t\treturn index == 0 ? null : this.strings[index - 1];\n\t}\n\n\treadString (): string | null {\n\t\tlet byteCount = this.readInt(true);\n\t\tswitch (byteCount) {\n\t\t\tcase 0:\n\t\t\t\treturn null;\n\t\t\tcase 1:\n\t\t\t\treturn \"\";\n\t\t}\n\t\tbyteCount--;\n\t\tlet chars = \"\";\n\t\tlet charCount = 0;\n\t\tfor (let i = 0; i < byteCount;) {\n\t\t\tlet b = this.readUnsignedByte();\n\t\t\tswitch (b >> 4) {\n\t\t\t\tcase 12:\n\t\t\t\tcase 13:\n\t\t\t\t\tchars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));\n\t\t\t\t\ti += 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 14:\n\t\t\t\t\tchars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));\n\t\t\t\t\ti += 3;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tchars += String.fromCharCode(b);\n\t\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn chars;\n\t}\n\n\treadFloat (): number {\n\t\tlet value = this.buffer.getFloat32(this.index);\n\t\tthis.index += 4;\n\t\treturn value;\n\t}\n\n\treadBoolean (): boolean {\n\t\treturn this.readByte() != 0;\n\t}\n}\n\nclass LinkedMesh {\n\tparent: string | null; skinIndex: number;\n\tslotIndex: number;\n\tmesh: MeshAttachment;\n\tinheritTimeline: boolean;\n\n\tconstructor (mesh: MeshAttachment, skinIndex: number, slotIndex: number, parent: string | null, inheritDeform: boolean) {\n\t\tthis.mesh = mesh;\n\t\tthis.skinIndex = skinIndex;\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.parent = parent;\n\t\tthis.inheritTimeline = inheritDeform;\n\t}\n}\n\nclass Vertices {\n\tconstructor (public bones: Array | null = null, public vertices: Array | Float32Array | null = null, public length: number = 0) { }\n}\n\nenum AttachmentType { Region, BoundingBox, Mesh, LinkedMesh, Path, Point, Clipping }\n\nfunction readTimeline1 (input: BinaryInput, timeline: CurveTimeline1, scale: number): CurveTimeline1 {\n\tlet time = input.readFloat(), value = input.readFloat() * scale;\n\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value);\n\t\tif (frame == frameLast) break;\n\t\tlet time2 = input.readFloat(), value2 = input.readFloat() * scale;\n\t\tswitch (input.readByte()) {\n\t\t\tcase CURVE_STEPPED:\n\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\tbreak;\n\t\t\tcase CURVE_BEZIER:\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue = value2;\n\t}\n\treturn timeline;\n}\n\nfunction readTimeline2 (input: BinaryInput, timeline: CurveTimeline2, scale: number): CurveTimeline2 {\n\tlet time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale;\n\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value1, value2);\n\t\tif (frame == frameLast) break;\n\t\tlet time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale;\n\t\tswitch (input.readByte()) {\n\t\t\tcase CURVE_STEPPED:\n\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\tbreak;\n\t\t\tcase CURVE_BEZIER:\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue1 = nvalue1;\n\t\tvalue2 = nvalue2;\n\t}\n\treturn timeline;\n}\n\nfunction setBezier (input: BinaryInput, timeline: CurveTimeline, bezier: number, frame: number, value: number,\n\ttime1: number, time2: number, value1: number, value2: number, scale: number) {\n\ttimeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2);\n}\n\nconst BONE_ROTATE = 0;\nconst BONE_TRANSLATE = 1;\nconst BONE_TRANSLATEX = 2;\nconst BONE_TRANSLATEY = 3;\nconst BONE_SCALE = 4;\nconst BONE_SCALEX = 5;\nconst BONE_SCALEY = 6;\nconst BONE_SHEAR = 7;\nconst BONE_SHEARX = 8;\nconst BONE_SHEARY = 9;\nconst BONE_INHERIT = 10;\n\nconst SLOT_ATTACHMENT = 0;\nconst SLOT_RGBA = 1;\nconst SLOT_RGB = 2;\nconst SLOT_RGBA2 = 3;\nconst SLOT_RGB2 = 4;\nconst SLOT_ALPHA = 5;\n\nconst ATTACHMENT_DEFORM = 0;\nconst ATTACHMENT_SEQUENCE = 1;\n\nconst PATH_POSITION = 0;\nconst PATH_SPACING = 1;\nconst PATH_MIX = 2;\n\nconst PHYSICS_INERTIA = 0;\nconst PHYSICS_STRENGTH = 1;\nconst PHYSICS_DAMPING = 2;\nconst PHYSICS_MASS = 4;\nconst PHYSICS_WIND = 5;\nconst PHYSICS_GRAVITY = 6;\nconst PHYSICS_MIX = 7;\nconst PHYSICS_RESET = 8;\n\nconst CURVE_LINEAR = 0;\nconst CURVE_STEPPED = 1;\nconst CURVE_BEZIER = 2;\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoundingBoxAttachment } from \"./attachments/BoundingBoxAttachment.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { NumberArrayLike, Pool, Utils } from \"./Utils.js\";\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\n * provided along with convenience methods for doing hit detection. */\nexport class SkeletonBounds {\n\n\t/** The left edge of the axis aligned bounding box. */\n\tminX = 0;\n\n\t/** The bottom edge of the axis aligned bounding box. */\n\tminY = 0;\n\n\t/** The right edge of the axis aligned bounding box. */\n\tmaxX = 0;\n\n\t/** The top edge of the axis aligned bounding box. */\n\tmaxY = 0;\n\n\t/** The visible bounding boxes. */\n\tboundingBoxes = new Array();\n\n\t/** The world vertices for the bounding box polygons. */\n\tpolygons = new Array();\n\n\tprivate polygonPool = new Pool(() => {\n\t\treturn Utils.newFloatArray(16);\n\t});\n\n\t/** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding\n\t * box's polygon.\n\t * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the\n\t * SkeletonBounds AABB methods will always return true. */\n\tupdate (skeleton: Skeleton, updateAabb: boolean) {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tlet boundingBoxes = this.boundingBoxes;\n\t\tlet polygons = this.polygons;\n\t\tlet polygonPool = this.polygonPool;\n\t\tlet slots = skeleton.slots;\n\t\tlet slotCount = slots.length;\n\n\t\tboundingBoxes.length = 0;\n\t\tpolygonPool.freeAll(polygons);\n\t\tpolygons.length = 0;\n\n\t\tfor (let i = 0; i < slotCount; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (!slot.bone.active) continue;\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (attachment instanceof BoundingBoxAttachment) {\n\t\t\t\tlet boundingBox = attachment as BoundingBoxAttachment;\n\t\t\t\tboundingBoxes.push(boundingBox);\n\n\t\t\t\tlet polygon = polygonPool.obtain();\n\t\t\t\tif (polygon.length != boundingBox.worldVerticesLength) {\n\t\t\t\t\tpolygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\n\t\t\t\t}\n\t\t\t\tpolygons.push(polygon);\n\t\t\t\tboundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\n\t\t\t}\n\t\t}\n\n\t\tif (updateAabb) {\n\t\t\tthis.aabbCompute();\n\t\t} else {\n\t\t\tthis.minX = Number.POSITIVE_INFINITY;\n\t\t\tthis.minY = Number.POSITIVE_INFINITY;\n\t\t\tthis.maxX = Number.NEGATIVE_INFINITY;\n\t\t\tthis.maxY = Number.NEGATIVE_INFINITY;\n\t\t}\n\t}\n\n\taabbCompute () {\n\t\tlet minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++) {\n\t\t\tlet polygon = polygons[i];\n\t\t\tlet vertices = polygon;\n\t\t\tfor (let ii = 0, nn = polygon.length; ii < nn; ii += 2) {\n\t\t\t\tlet x = vertices[ii];\n\t\t\t\tlet y = vertices[ii + 1];\n\t\t\t\tminX = Math.min(minX, x);\n\t\t\t\tminY = Math.min(minY, y);\n\t\t\t\tmaxX = Math.max(maxX, x);\n\t\t\t\tmaxY = Math.max(maxY, y);\n\t\t\t}\n\t\t}\n\t\tthis.minX = minX;\n\t\tthis.minY = minY;\n\t\tthis.maxX = maxX;\n\t\tthis.maxY = maxY;\n\t}\n\n\t/** Returns true if the axis aligned bounding box contains the point. */\n\taabbContainsPoint (x: number, y: number) {\n\t\treturn x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\n\t}\n\n\t/** Returns true if the axis aligned bounding box intersects the line segment. */\n\taabbIntersectsSegment (x1: number, y1: number, x2: number, y2: number) {\n\t\tlet minX = this.minX;\n\t\tlet minY = this.minY;\n\t\tlet maxX = this.maxX;\n\t\tlet maxY = this.maxY;\n\t\tif ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\n\t\t\treturn false;\n\t\tlet m = (y2 - y1) / (x2 - x1);\n\t\tlet y = m * (minX - x1) + y1;\n\t\tif (y > minY && y < maxY) return true;\n\t\ty = m * (maxX - x1) + y1;\n\t\tif (y > minY && y < maxY) return true;\n\t\tlet x = (minY - y1) / m + x1;\n\t\tif (x > minX && x < maxX) return true;\n\t\tx = (maxY - y1) / m + x1;\n\t\tif (x > minX && x < maxX) return true;\n\t\treturn false;\n\t}\n\n\t/** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\n\taabbIntersectsSkeleton (bounds: SkeletonBounds) {\n\t\treturn this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\n\t}\n\n\t/** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\n\t * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */\n\tcontainsPoint (x: number, y: number): BoundingBoxAttachment | null {\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++)\n\t\t\tif (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i];\n\t\treturn null;\n\t}\n\n\t/** Returns true if the polygon contains the point. */\n\tcontainsPointPolygon (polygon: NumberArrayLike, x: number, y: number) {\n\t\tlet vertices = polygon;\n\t\tlet nn = polygon.length;\n\n\t\tlet prevIndex = nn - 2;\n\t\tlet inside = false;\n\t\tfor (let ii = 0; ii < nn; ii += 2) {\n\t\t\tlet vertexY = vertices[ii + 1];\n\t\t\tlet prevY = vertices[prevIndex + 1];\n\t\t\tif ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\n\t\t\t\tlet vertexX = vertices[ii];\n\t\t\t\tif (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside;\n\t\t\t}\n\t\t\tprevIndex = ii;\n\t\t}\n\t\treturn inside;\n\t}\n\n\t/** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\n\t * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns\n\t * true. */\n\tintersectsSegment (x1: number, y1: number, x2: number, y2: number) {\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++)\n\t\t\tif (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i];\n\t\treturn null;\n\t}\n\n\t/** Returns true if the polygon contains any part of the line segment. */\n\tintersectsSegmentPolygon (polygon: NumberArrayLike, x1: number, y1: number, x2: number, y2: number) {\n\t\tlet vertices = polygon;\n\t\tlet nn = polygon.length;\n\n\t\tlet width12 = x1 - x2, height12 = y1 - y2;\n\t\tlet det1 = x1 * y2 - y1 * x2;\n\t\tlet x3 = vertices[nn - 2], y3 = vertices[nn - 1];\n\t\tfor (let ii = 0; ii < nn; ii += 2) {\n\t\t\tlet x4 = vertices[ii], y4 = vertices[ii + 1];\n\t\t\tlet det2 = x3 * y4 - y3 * x4;\n\t\t\tlet width34 = x3 - x4, height34 = y3 - y4;\n\t\t\tlet det3 = width12 * height34 - height12 * width34;\n\t\t\tlet x = (det1 * width34 - width12 * det2) / det3;\n\t\t\tif (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\n\t\t\t\tlet y = (det1 * height34 - height12 * det2) / det3;\n\t\t\t\tif (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true;\n\t\t\t}\n\t\t\tx3 = x4;\n\t\t\ty3 = y4;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Returns the polygon for the specified bounding box, or null. */\n\tgetPolygon (boundingBox: BoundingBoxAttachment) {\n\t\tif (!boundingBox) throw new Error(\"boundingBox cannot be null.\");\n\t\tlet index = this.boundingBoxes.indexOf(boundingBox);\n\t\treturn index == -1 ? null : this.polygons[index];\n\t}\n\n\t/** The width of the axis aligned bounding box. */\n\tgetWidth () {\n\t\treturn this.maxX - this.minX;\n\t}\n\n\t/** The height of the axis aligned bounding box. */\n\tgetHeight () {\n\t\treturn this.maxY - this.minY;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { NumberArrayLike, Pool } from \"./Utils.js\";\n\nexport class Triangulator {\n\tprivate convexPolygons = new Array>();\n\tprivate convexPolygonsIndices = new Array>();\n\n\tprivate indicesArray = new Array();\n\tprivate isConcaveArray = new Array();\n\tprivate triangles = new Array();\n\n\tprivate polygonPool = new Pool>(() => {\n\t\treturn new Array();\n\t});\n\n\tprivate polygonIndicesPool = new Pool>(() => {\n\t\treturn new Array();\n\t});\n\n\tpublic triangulate (verticesArray: NumberArrayLike): Array {\n\t\tlet vertices = verticesArray;\n\t\tlet vertexCount = verticesArray.length >> 1;\n\n\t\tlet indices = this.indicesArray;\n\t\tindices.length = 0;\n\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\tindices[i] = i;\n\n\t\tlet isConcave = this.isConcaveArray;\n\t\tisConcave.length = 0;\n\t\tfor (let i = 0, n = vertexCount; i < n; ++i)\n\t\t\tisConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\n\n\t\tlet triangles = this.triangles;\n\t\ttriangles.length = 0;\n\n\t\twhile (vertexCount > 3) {\n\t\t\t// Find ear tip.\n\t\t\tlet previous = vertexCount - 1, i = 0, next = 1;\n\t\t\twhile (true) {\n\t\t\t\touter:\n\t\t\t\tif (!isConcave[i]) {\n\t\t\t\t\tlet p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\n\t\t\t\t\tlet p1x = vertices[p1], p1y = vertices[p1 + 1];\n\t\t\t\t\tlet p2x = vertices[p2], p2y = vertices[p2 + 1];\n\t\t\t\t\tlet p3x = vertices[p3], p3y = vertices[p3 + 1];\n\t\t\t\t\tfor (let ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\n\t\t\t\t\t\tif (!isConcave[ii]) continue;\n\t\t\t\t\t\tlet v = indices[ii] << 1;\n\t\t\t\t\t\tlet vx = vertices[v], vy = vertices[v + 1];\n\t\t\t\t\t\tif (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\n\t\t\t\t\t\t\tif (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\n\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) break outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (next == 0) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (!isConcave[i]) break;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t} while (i > 0);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tprevious = i;\n\t\t\t\ti = next;\n\t\t\t\tnext = (next + 1) % vertexCount;\n\t\t\t}\n\n\t\t\t// Cut ear tip.\n\t\t\ttriangles.push(indices[(vertexCount + i - 1) % vertexCount]);\n\t\t\ttriangles.push(indices[i]);\n\t\t\ttriangles.push(indices[(i + 1) % vertexCount]);\n\t\t\tindices.splice(i, 1);\n\t\t\tisConcave.splice(i, 1);\n\t\t\tvertexCount--;\n\n\t\t\tlet previousIndex = (vertexCount + i - 1) % vertexCount;\n\t\t\tlet nextIndex = i == vertexCount ? 0 : i;\n\t\t\tisConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\n\t\t\tisConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\n\t\t}\n\n\t\tif (vertexCount == 3) {\n\t\t\ttriangles.push(indices[2]);\n\t\t\ttriangles.push(indices[0]);\n\t\t\ttriangles.push(indices[1]);\n\t\t}\n\n\t\treturn triangles;\n\t}\n\n\tdecompose (verticesArray: Array, triangles: Array): Array> {\n\t\tlet vertices = verticesArray;\n\t\tlet convexPolygons = this.convexPolygons;\n\t\tthis.polygonPool.freeAll(convexPolygons);\n\t\tconvexPolygons.length = 0;\n\n\t\tlet convexPolygonsIndices = this.convexPolygonsIndices;\n\t\tthis.polygonIndicesPool.freeAll(convexPolygonsIndices);\n\t\tconvexPolygonsIndices.length = 0;\n\n\t\tlet polygonIndices = this.polygonIndicesPool.obtain();\n\t\tpolygonIndices.length = 0;\n\n\t\tlet polygon = this.polygonPool.obtain();\n\t\tpolygon.length = 0;\n\n\t\t// Merge subsequent triangles if they form a triangle fan.\n\t\tlet fanBaseIndex = -1, lastWinding = 0;\n\t\tfor (let i = 0, n = triangles.length; i < n; i += 3) {\n\t\t\tlet t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\n\t\t\tlet x1 = vertices[t1], y1 = vertices[t1 + 1];\n\t\t\tlet x2 = vertices[t2], y2 = vertices[t2 + 1];\n\t\t\tlet x3 = vertices[t3], y3 = vertices[t3 + 1];\n\n\t\t\t// If the base of the last triangle is the same as this triangle, check if they form a convex polygon (triangle fan).\n\t\t\tlet merged = false;\n\t\t\tif (fanBaseIndex == t1) {\n\t\t\t\tlet o = polygon.length - 4;\n\t\t\t\tlet winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\n\t\t\t\tlet winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\n\t\t\t\tif (winding1 == lastWinding && winding2 == lastWinding) {\n\t\t\t\t\tpolygon.push(x3);\n\t\t\t\t\tpolygon.push(y3);\n\t\t\t\t\tpolygonIndices.push(t3);\n\t\t\t\t\tmerged = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise make this triangle the new base.\n\t\t\tif (!merged) {\n\t\t\t\tif (polygon.length > 0) {\n\t\t\t\t\tconvexPolygons.push(polygon);\n\t\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\n\t\t\t\t} else {\n\t\t\t\t\tthis.polygonPool.free(polygon)\n\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\n\t\t\t\t}\n\t\t\t\tpolygon = this.polygonPool.obtain();\n\t\t\t\tpolygon.length = 0;\n\t\t\t\tpolygon.push(x1);\n\t\t\t\tpolygon.push(y1);\n\t\t\t\tpolygon.push(x2);\n\t\t\t\tpolygon.push(y2);\n\t\t\t\tpolygon.push(x3);\n\t\t\t\tpolygon.push(y3);\n\t\t\t\tpolygonIndices = this.polygonIndicesPool.obtain();\n\t\t\t\tpolygonIndices.length = 0;\n\t\t\t\tpolygonIndices.push(t1);\n\t\t\t\tpolygonIndices.push(t2);\n\t\t\t\tpolygonIndices.push(t3);\n\t\t\t\tlastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\n\t\t\t\tfanBaseIndex = t1;\n\t\t\t}\n\t\t}\n\n\t\tif (polygon.length > 0) {\n\t\t\tconvexPolygons.push(polygon);\n\t\t\tconvexPolygonsIndices.push(polygonIndices);\n\t\t}\n\n\t\t// Go through the list of polygons and try to merge the remaining triangles with the found triangle fans.\n\t\tfor (let i = 0, n = convexPolygons.length; i < n; i++) {\n\t\t\tpolygonIndices = convexPolygonsIndices[i];\n\t\t\tif (polygonIndices.length == 0) continue;\n\t\t\tlet firstIndex = polygonIndices[0];\n\t\t\tlet lastIndex = polygonIndices[polygonIndices.length - 1];\n\n\t\t\tpolygon = convexPolygons[i];\n\t\t\tlet o = polygon.length - 4;\n\t\t\tlet prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\n\t\t\tlet prevX = polygon[o + 2], prevY = polygon[o + 3];\n\t\t\tlet firstX = polygon[0], firstY = polygon[1];\n\t\t\tlet secondX = polygon[2], secondY = polygon[3];\n\t\t\tlet winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\n\n\t\t\tfor (let ii = 0; ii < n; ii++) {\n\t\t\t\tif (ii == i) continue;\n\t\t\t\tlet otherIndices = convexPolygonsIndices[ii];\n\t\t\t\tif (otherIndices.length != 3) continue;\n\t\t\t\tlet otherFirstIndex = otherIndices[0];\n\t\t\t\tlet otherSecondIndex = otherIndices[1];\n\t\t\t\tlet otherLastIndex = otherIndices[2];\n\n\t\t\t\tlet otherPoly = convexPolygons[ii];\n\t\t\t\tlet x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\n\n\t\t\t\tif (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) continue;\n\t\t\t\tlet winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\n\t\t\t\tlet winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\n\t\t\t\tif (winding1 == winding && winding2 == winding) {\n\t\t\t\t\totherPoly.length = 0;\n\t\t\t\t\totherIndices.length = 0;\n\t\t\t\t\tpolygon.push(x3);\n\t\t\t\t\tpolygon.push(y3);\n\t\t\t\t\tpolygonIndices.push(otherLastIndex);\n\t\t\t\t\tprevPrevX = prevX;\n\t\t\t\t\tprevPrevY = prevY;\n\t\t\t\t\tprevX = x3;\n\t\t\t\t\tprevY = y3;\n\t\t\t\t\tii = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove empty polygons that resulted from the merge step above.\n\t\tfor (let i = convexPolygons.length - 1; i >= 0; i--) {\n\t\t\tpolygon = convexPolygons[i];\n\t\t\tif (polygon.length == 0) {\n\t\t\t\tconvexPolygons.splice(i, 1);\n\t\t\t\tthis.polygonPool.free(polygon);\n\t\t\t\tpolygonIndices = convexPolygonsIndices[i]\n\t\t\t\tconvexPolygonsIndices.splice(i, 1)\n\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\n\t\t\t}\n\t\t}\n\n\t\treturn convexPolygons;\n\t}\n\n\tprivate static isConcave (index: number, vertexCount: number, vertices: NumberArrayLike, indices: NumberArrayLike): boolean {\n\t\tlet previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\n\t\tlet current = indices[index] << 1;\n\t\tlet next = indices[(index + 1) % vertexCount] << 1;\n\t\treturn !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next],\n\t\t\tvertices[next + 1]);\n\t}\n\n\tprivate static positiveArea (p1x: number, p1y: number, p2x: number, p2y: number, p3x: number, p3y: number): boolean {\n\t\treturn p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\n\t}\n\n\tprivate static winding (p1x: number, p1y: number, p2x: number, p2y: number, p3x: number, p3y: number): number {\n\t\tlet px = p2x - p1x, py = p2y - p1y;\n\t\treturn p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { Slot } from \"./Slot.js\";\nimport { Triangulator } from \"./Triangulator.js\";\nimport { Utils, Color, NumberArrayLike } from \"./Utils.js\";\n\nexport class SkeletonClipping {\n\tprivate triangulator = new Triangulator();\n\tprivate clippingPolygon = new Array();\n\tprivate clipOutput = new Array();\n\tclippedVertices = new Array();\n\tclippedUVs = new Array();\n\tclippedTriangles = new Array();\n\tprivate scratch = new Array();\n\n\tprivate clipAttachment: ClippingAttachment | null = null;\n\tprivate clippingPolygons: Array> | null = null;\n\n\tclipStart (slot: Slot, clip: ClippingAttachment): number {\n\t\tif (this.clipAttachment) return 0;\n\t\tthis.clipAttachment = clip;\n\n\t\tlet n = clip.worldVerticesLength;\n\t\tlet vertices = Utils.setArraySize(this.clippingPolygon, n);\n\t\tclip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\n\t\tlet clippingPolygon = this.clippingPolygon;\n\t\tSkeletonClipping.makeClockwise(clippingPolygon);\n\t\tlet clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\n\t\tfor (let i = 0, n = clippingPolygons.length; i < n; i++) {\n\t\t\tlet polygon = clippingPolygons[i];\n\t\t\tSkeletonClipping.makeClockwise(polygon);\n\t\t\tpolygon.push(polygon[0]);\n\t\t\tpolygon.push(polygon[1]);\n\t\t}\n\n\t\treturn clippingPolygons.length;\n\t}\n\n\tclipEndWithSlot (slot: Slot) {\n\t\tif (this.clipAttachment && this.clipAttachment.endSlot == slot.data) this.clipEnd();\n\t}\n\n\tclipEnd () {\n\t\tif (!this.clipAttachment) return;\n\t\tthis.clipAttachment = null;\n\t\tthis.clippingPolygons = null;\n\t\tthis.clippedVertices.length = 0;\n\t\tthis.clippedTriangles.length = 0;\n\t\tthis.clippingPolygon.length = 0;\n\t}\n\n\tisClipping (): boolean {\n\t\treturn this.clipAttachment != null;\n\t}\n\n\t/**\n\t* @deprecated Use clipTriangles without verticesLength parameter. Mark for removal in 4.3.\n\t*/\n\tclipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number): void;\n\n\t/**\n\t * @deprecated Use clipTriangles without verticesLength parameter. Mark for removal in 4.3.\n\t */\n\tclipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike, light: Color, dark: Color, twoColor: boolean): void;\n\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number): void;\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike, light: Color, dark: Color, twoColor: boolean): void;\n\tclipTriangles (\n\t\tvertices: NumberArrayLike,\n\t\tverticesLengthOrTriangles: number | NumberArrayLike,\n\t\ttrianglesOrTrianglesLength: NumberArrayLike | number,\n\t\ttrianglesLengthOrUvs?: number | NumberArrayLike,\n\t\tuvsOrLight?: NumberArrayLike | Color,\n\t\tlightOrDark?: Color,\n\t\tdarkOrTwoColor?: Color | boolean,\n\t\ttwoColorParam?: boolean\n\t): void {\n\t\t// Determine which overload is being used\n\t\tlet triangles: NumberArrayLike;\n\t\tlet trianglesLength: number;\n\t\tlet uvs: NumberArrayLike | undefined;\n\t\tlet light: Color | undefined;\n\t\tlet dark: Color | undefined;\n\t\tlet twoColor: boolean | undefined;\n\n\t\tif (typeof verticesLengthOrTriangles === 'number') {\n\t\t\ttriangles = trianglesOrTrianglesLength as NumberArrayLike;\n\t\t\ttrianglesLength = trianglesLengthOrUvs as number;\n\t\t\tuvs = uvsOrLight as NumberArrayLike;\n\t\t\tlight = lightOrDark as Color | undefined;\n\t\t\tdark = darkOrTwoColor as Color | undefined;\n\t\t\ttwoColor = twoColorParam;\n\t\t} else {\n\t\t\ttriangles = verticesLengthOrTriangles;\n\t\t\ttrianglesLength = trianglesOrTrianglesLength as number;\n\t\t\tuvs = trianglesLengthOrUvs as NumberArrayLike;\n\t\t\tlight = uvsOrLight as Color | undefined;\n\t\t\tdark = lightOrDark as Color | undefined;\n\t\t\ttwoColor = darkOrTwoColor as boolean;\n\t\t}\n\n\t\tif (uvs && light && dark && typeof twoColor === 'boolean')\n\t\t\tthis.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor);\n\t\telse\n\t\t\tthis.clipTrianglesNoRender(vertices, triangles, trianglesLength);\n\t}\n\n\tprivate clipTrianglesNoRender (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number) {\n\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\n\t\t\t\t\tclippedVerticesItems[s + 2] = x2;\n\t\t\t\t\tclippedVerticesItems[s + 3] = y2;\n\n\t\t\t\t\tclippedVerticesItems[s + 4] = x3;\n\t\t\t\t\tclippedVerticesItems[s + 5] = y3;\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate clipTrianglesRender (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike,\n\t\tlight: Color, dark: Color, twoColor: boolean) {\n\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\t\tlet vertexSize = twoColor ? 12 : 8;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\t\t\tlet u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\t\t\tlet u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\t\t\tlet u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\t\t\t\t\tlet d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n\t\t\t\t\tlet d = 1 / (d0 * d2 + d1 * (y1 - y3));\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += vertexSize) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\n\t\t\t\t\t\tlet c0 = x - x3, c1 = y - y3;\n\t\t\t\t\t\tlet a = (d0 * c0 + d1 * c1) * d;\n\t\t\t\t\t\tlet b = (d4 * c0 + d2 * c1) * d;\n\t\t\t\t\t\tlet c = 1 - a - b;\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\n\t\t\t\t\t\tif (twoColor) {\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\n\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\n\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\n\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\n\t\t\t\t\tif (!twoColor) {\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 8] = x2;\n\t\t\t\t\t\tclippedVerticesItems[s + 9] = y2;\n\t\t\t\t\t\tclippedVerticesItems[s + 10] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 11] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 12] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 13] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 14] = u2;\n\t\t\t\t\t\tclippedVerticesItems[s + 15] = v2;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 16] = x3;\n\t\t\t\t\t\tclippedVerticesItems[s + 17] = y3;\n\t\t\t\t\t\tclippedVerticesItems[s + 18] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 19] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 20] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 21] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 22] = u3;\n\t\t\t\t\t\tclippedVerticesItems[s + 23] = v3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\n\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 12] = x2;\n\t\t\t\t\t\tclippedVerticesItems[s + 13] = y2;\n\t\t\t\t\t\tclippedVerticesItems[s + 14] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 15] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 16] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 17] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 18] = u2;\n\t\t\t\t\t\tclippedVerticesItems[s + 19] = v2;\n\t\t\t\t\t\tclippedVerticesItems[s + 20] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 21] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 22] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 23] = dark.a;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 24] = x3;\n\t\t\t\t\t\tclippedVerticesItems[s + 25] = y3;\n\t\t\t\t\t\tclippedVerticesItems[s + 26] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 27] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 28] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 29] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 30] = u3;\n\t\t\t\t\t\tclippedVerticesItems[s + 31] = v3;\n\t\t\t\t\t\tclippedVerticesItems[s + 32] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 33] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 34] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 35] = dark.a;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic clipTrianglesUnpacked (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike) {\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices, clippedUVs = this.clippedUVs;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedUVs.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\t\t\tlet u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\t\t\tlet u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\t\t\tlet u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\t\t\t\t\tlet d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n\t\t\t\t\tlet d = 1 / (d0 * d2 + d1 * (y1 - y3));\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2);\n\t\t\t\t\tlet clippedUVsItems = Utils.setArraySize(clippedUVs, s + clipOutputCount * 2);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t\tlet c0 = x - x3, c1 = y - y3;\n\t\t\t\t\t\tlet a = (d0 * c0 + d1 * c1) * d;\n\t\t\t\t\t\tlet b = (d4 * c0 + d2 * c1) * d;\n\t\t\t\t\t\tlet c = 1 - a - b;\n\t\t\t\t\t\tclippedUVsItems[s] = u1 * a + u2 * b + u3 * c;\n\t\t\t\t\t\tclippedUVsItems[s + 1] = v1 * a + v2 * b + v3 * c;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\t\t\t\t\tclippedVerticesItems[s + 2] = x2;\n\t\t\t\t\tclippedVerticesItems[s + 3] = y2;\n\t\t\t\t\tclippedVerticesItems[s + 4] = x3;\n\t\t\t\t\tclippedVerticesItems[s + 5] = y3;\n\n\t\t\t\t\tlet clippedUVSItems = Utils.setArraySize(clippedUVs, s + 3 * 2);\n\t\t\t\t\tclippedUVSItems[s] = u1;\n\t\t\t\t\tclippedUVSItems[s + 1] = v1;\n\t\t\t\t\tclippedUVSItems[s + 2] = u2;\n\t\t\t\t\tclippedUVSItems[s + 3] = v2;\n\t\t\t\t\tclippedUVSItems[s + 4] = u3;\n\t\t\t\t\tclippedUVSItems[s + 5] = v3;\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping\n\t * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */\n\tclip (x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array, output: Array) {\n\t\tlet originalOutput = output;\n\t\tlet clipped = false;\n\n\t\t// Avoid copy at the end.\n\t\tlet input: Array;\n\t\tif (clippingArea.length % 4 >= 2) {\n\t\t\tinput = output;\n\t\t\toutput = this.scratch;\n\t\t} else\n\t\t\tinput = this.scratch;\n\n\t\tinput.length = 0;\n\t\tinput.push(x1);\n\t\tinput.push(y1);\n\t\tinput.push(x2);\n\t\tinput.push(y2);\n\t\tinput.push(x3);\n\t\tinput.push(y3);\n\t\tinput.push(x1);\n\t\tinput.push(y1);\n\t\toutput.length = 0;\n\n\t\tlet clippingVerticesLast = clippingArea.length - 4;\n\t\tlet clippingVertices = clippingArea;\n\t\tfor (let i = 0; ; i += 2) {\n\t\t\tlet edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\n\t\t\tlet ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3];\n\n\t\t\tlet outputStart = output.length;\n\t\t\tlet inputVertices = input;\n\t\t\tfor (let ii = 0, nn = input.length - 2; ii < nn;) {\n\t\t\t\tlet inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\n\t\t\t\tii += 2;\n\t\t\t\tlet inputX2 = inputVertices[ii], inputY2 = inputVertices[ii + 1];\n\t\t\t\tlet s2 = ey * (edgeX - inputX2) > ex * (edgeY - inputY2);\n\t\t\t\tlet s1 = ey * (edgeX - inputX) - ex * (edgeY - inputY);\n\t\t\t\tif (s1 > 0) {\n\t\t\t\t\tif (s2) { // v1 inside, v2 inside\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// v1 inside, v2 outside\n\t\t\t\t\tlet ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);\n\t\t\t\t\tif (t >= 0 && t <= 1) {\n\t\t\t\t\t\toutput.push(inputX + ix * t);\n\t\t\t\t\t\toutput.push(inputY + iy * t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else if (s2) { // v1 outside, v2 inside\n\t\t\t\t\tlet ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);\n\t\t\t\t\tif (t >= 0 && t <= 1) {\n\t\t\t\t\t\toutput.push(inputX + ix * t);\n\t\t\t\t\t\toutput.push(inputY + iy * t);\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclipped = true;\n\t\t\t}\n\n\t\t\tif (outputStart == output.length) { // All edges outside.\n\t\t\t\toriginalOutput.length = 0;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\toutput.push(output[0]);\n\t\t\toutput.push(output[1]);\n\n\t\t\tif (i == clippingVerticesLast) break;\n\t\t\tlet temp = output;\n\t\t\toutput = input;\n\t\t\toutput.length = 0;\n\t\t\tinput = temp;\n\t\t}\n\n\t\tif (originalOutput != output) {\n\t\t\toriginalOutput.length = 0;\n\t\t\tfor (let i = 0, n = output.length - 2; i < n; i++)\n\t\t\t\toriginalOutput[i] = output[i];\n\t\t} else\n\t\t\toriginalOutput.length = originalOutput.length - 2;\n\n\t\treturn clipped;\n\t}\n\n\tpublic static makeClockwise (polygon: NumberArrayLike) {\n\t\tlet vertices = polygon;\n\t\tlet verticeslength = polygon.length;\n\n\t\tlet area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\n\t\tfor (let i = 0, n = verticeslength - 3; i < n; i += 2) {\n\t\t\tp1x = vertices[i];\n\t\t\tp1y = vertices[i + 1];\n\t\t\tp2x = vertices[i + 2];\n\t\t\tp2y = vertices[i + 3];\n\t\t\tarea += p1x * p2y - p2x * p1y;\n\t\t}\n\t\tif (area < 0) return;\n\n\t\tfor (let i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\n\t\t\tlet x = vertices[i], y = vertices[i + 1];\n\t\t\tlet other = lastX - i;\n\t\t\tvertices[i] = vertices[other];\n\t\t\tvertices[i + 1] = vertices[other + 1];\n\t\t\tvertices[other] = x;\n\t\t\tvertices[other + 1] = y;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, Timeline, InheritTimeline, AttachmentTimeline, RGBATimeline, RGBTimeline, AlphaTimeline, RGBA2Timeline, RGB2Timeline, RotateTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline, CurveTimeline1, CurveTimeline2, CurveTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintDampingTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintWindTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintMixTimeline } from \"./Animation.js\";\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { BoneData, Inherit } from \"./BoneData.js\";\nimport { EventData } from \"./EventData.js\";\nimport { Event } from \"./Event.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData, PositionMode, SpacingMode, RotateMode } from \"./PathConstraintData.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData, BlendMode } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Utils, Color, NumberArrayLike } from \"./Utils.js\";\nimport { Sequence, SequenceMode } from \"./attachments/Sequence.js\";\nimport { SequenceTimeline } from \"./Animation.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\n\n/** Loads skeleton data in the Spine JSON format.\n *\n * See [Spine JSON format](http://esotericsoftware.com/spine-json-format) and\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\n * Runtimes Guide. */\nexport class SkeletonJson {\n\tattachmentLoader: AttachmentLoader;\n\n\t/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\n\t * runtime than were used in Spine.\n\t *\n\t * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\n\tscale = 1;\n\tprivate linkedMeshes = new Array();\n\n\tconstructor (attachmentLoader: AttachmentLoader) {\n\t\tthis.attachmentLoader = attachmentLoader;\n\t}\n\n\treadSkeletonData (json: string | any): SkeletonData {\n\t\tlet scale = this.scale;\n\t\tlet skeletonData = new SkeletonData();\n\t\tlet root = typeof (json) === \"string\" ? JSON.parse(json) : json;\n\n\t\t// Skeleton\n\t\tlet skeletonMap = root.skeleton;\n\t\tif (skeletonMap) {\n\t\t\tskeletonData.hash = skeletonMap.hash;\n\t\t\tskeletonData.version = skeletonMap.spine;\n\t\t\tskeletonData.x = skeletonMap.x;\n\t\t\tskeletonData.y = skeletonMap.y;\n\t\t\tskeletonData.width = skeletonMap.width;\n\t\t\tskeletonData.height = skeletonMap.height;\n\t\t\tskeletonData.referenceScale = getValue(skeletonMap, \"referenceScale\", 100) * scale;\n\t\t\tskeletonData.fps = skeletonMap.fps;\n\t\t\tskeletonData.imagesPath = skeletonMap.images ?? null;\n\t\t\tskeletonData.audioPath = skeletonMap.audio ?? null;\n\t\t}\n\n\t\t// Bones\n\t\tif (root.bones) {\n\t\t\tfor (let i = 0; i < root.bones.length; i++) {\n\t\t\t\tlet boneMap = root.bones[i];\n\n\t\t\t\tlet parent: BoneData | null = null;\n\t\t\t\tlet parentName: string = getValue(boneMap, \"parent\", null);\n\t\t\t\tif (parentName) parent = skeletonData.findBone(parentName);\n\t\t\t\tlet data = new BoneData(skeletonData.bones.length, boneMap.name, parent);\n\t\t\t\tdata.length = getValue(boneMap, \"length\", 0) * scale;\n\t\t\t\tdata.x = getValue(boneMap, \"x\", 0) * scale;\n\t\t\t\tdata.y = getValue(boneMap, \"y\", 0) * scale;\n\t\t\t\tdata.rotation = getValue(boneMap, \"rotation\", 0);\n\t\t\t\tdata.scaleX = getValue(boneMap, \"scaleX\", 1);\n\t\t\t\tdata.scaleY = getValue(boneMap, \"scaleY\", 1);\n\t\t\t\tdata.shearX = getValue(boneMap, \"shearX\", 0);\n\t\t\t\tdata.shearY = getValue(boneMap, \"shearY\", 0);\n\t\t\t\tdata.inherit = Utils.enumValue(Inherit, getValue(boneMap, \"inherit\", \"Normal\"));\n\t\t\t\tdata.skinRequired = getValue(boneMap, \"skin\", false);\n\n\t\t\t\tlet color = getValue(boneMap, \"color\", null);\n\t\t\t\tif (color) data.color.setFromString(color);\n\n\t\t\t\tskeletonData.bones.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Slots.\n\t\tif (root.slots) {\n\t\t\tfor (let i = 0; i < root.slots.length; i++) {\n\t\t\t\tlet slotMap = root.slots[i];\n\t\t\t\tlet slotName = slotMap.name;\n\n\t\t\t\tlet boneData = skeletonData.findBone(slotMap.bone);\n\t\t\t\tif (!boneData) throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`);\n\t\t\t\tlet data = new SlotData(skeletonData.slots.length, slotName, boneData);\n\n\t\t\t\tlet color: string = getValue(slotMap, \"color\", null);\n\t\t\t\tif (color) data.color.setFromString(color);\n\n\t\t\t\tlet dark: string = getValue(slotMap, \"dark\", null);\n\t\t\t\tif (dark) data.darkColor = Color.fromString(dark);\n\n\t\t\t\tdata.attachmentName = getValue(slotMap, \"attachment\", null);\n\t\t\t\tdata.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, \"blend\", \"normal\"));\n\t\t\t\tdata.visible = getValue(slotMap, \"visible\", true);\n\t\t\t\tskeletonData.slots.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// IK constraints\n\t\tif (root.ik) {\n\t\t\tfor (let i = 0; i < root.ik.length; i++) {\n\t\t\t\tlet constraintMap = root.ik[i];\n\t\t\t\tlet data = new IkConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet bone = skeletonData.findBone(constraintMap.bones[ii]);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${constraintMap.bones[ii]} for IK constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet target = skeletonData.findBone(constraintMap.target);;\n\t\t\t\tif (!target) throw new Error(`Couldn't find target bone ${constraintMap.target} for IK constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.mix = getValue(constraintMap, \"mix\", 1);\n\t\t\t\tdata.softness = getValue(constraintMap, \"softness\", 0) * scale;\n\t\t\t\tdata.bendDirection = getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\n\t\t\t\tdata.compress = getValue(constraintMap, \"compress\", false);\n\t\t\t\tdata.stretch = getValue(constraintMap, \"stretch\", false);\n\t\t\t\tdata.uniform = getValue(constraintMap, \"uniform\", false);\n\n\t\t\t\tskeletonData.ikConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Transform constraints.\n\t\tif (root.transform) {\n\t\t\tfor (let i = 0; i < root.transform.length; i++) {\n\t\t\t\tlet constraintMap = root.transform[i];\n\t\t\t\tlet data = new TransformConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet boneName = constraintMap.bones[ii];\n\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for transform constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet targetName: string = constraintMap.target;\n\t\t\t\tlet target = skeletonData.findBone(targetName);\n\t\t\t\tif (!target) throw new Error(`Couldn't find target bone ${targetName} for transform constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.local = getValue(constraintMap, \"local\", false);\n\t\t\t\tdata.relative = getValue(constraintMap, \"relative\", false);\n\t\t\t\tdata.offsetRotation = getValue(constraintMap, \"rotation\", 0);\n\t\t\t\tdata.offsetX = getValue(constraintMap, \"x\", 0) * scale;\n\t\t\t\tdata.offsetY = getValue(constraintMap, \"y\", 0) * scale;\n\t\t\t\tdata.offsetScaleX = getValue(constraintMap, \"scaleX\", 0);\n\t\t\t\tdata.offsetScaleY = getValue(constraintMap, \"scaleY\", 0);\n\t\t\t\tdata.offsetShearY = getValue(constraintMap, \"shearY\", 0);\n\n\t\t\t\tdata.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\n\t\t\t\tdata.mixX = getValue(constraintMap, \"mixX\", 1);\n\t\t\t\tdata.mixY = getValue(constraintMap, \"mixY\", data.mixX);\n\t\t\t\tdata.mixScaleX = getValue(constraintMap, \"mixScaleX\", 1);\n\t\t\t\tdata.mixScaleY = getValue(constraintMap, \"mixScaleY\", data.mixScaleX);\n\t\t\t\tdata.mixShearY = getValue(constraintMap, \"mixShearY\", 1);\n\n\t\t\t\tskeletonData.transformConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Path constraints.\n\t\tif (root.path) {\n\t\t\tfor (let i = 0; i < root.path.length; i++) {\n\t\t\t\tlet constraintMap = root.path[i];\n\t\t\t\tlet data = new PathConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet boneName = constraintMap.bones[ii];\n\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for path constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet targetName: string = constraintMap.target;\n\t\t\t\tlet target = skeletonData.findSlot(targetName);\n\t\t\t\tif (!target) throw new Error(`Couldn't find target slot ${targetName} for path constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, \"positionMode\", \"Percent\"));\n\t\t\t\tdata.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, \"spacingMode\", \"Length\"));\n\t\t\t\tdata.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, \"rotateMode\", \"Tangent\"));\n\t\t\t\tdata.offsetRotation = getValue(constraintMap, \"rotation\", 0);\n\t\t\t\tdata.position = getValue(constraintMap, \"position\", 0);\n\t\t\t\tif (data.positionMode == PositionMode.Fixed) data.position *= scale;\n\t\t\t\tdata.spacing = getValue(constraintMap, \"spacing\", 0);\n\t\t\t\tif (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\n\t\t\t\tdata.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\n\t\t\t\tdata.mixX = getValue(constraintMap, \"mixX\", 1);\n\t\t\t\tdata.mixY = getValue(constraintMap, \"mixY\", data.mixX);\n\n\t\t\t\tskeletonData.pathConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Physics constraints.\n\t\tif (root.physics) {\n\t\t\tfor (let i = 0; i < root.physics.length; i++) {\n\t\t\t\tconst constraintMap = root.physics[i];\n\t\t\t\tconst data = new PhysicsConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tconst boneName = constraintMap.bone;\n\t\t\t\tconst bone = skeletonData.findBone(boneName);\n\t\t\t\tif (bone == null) throw new Error(\"Physics bone not found: \" + boneName);\n\t\t\t\tdata.bone = bone;\n\n\t\t\t\tdata.x = getValue(constraintMap, \"x\", 0);\n\t\t\t\tdata.y = getValue(constraintMap, \"y\", 0);\n\t\t\t\tdata.rotate = getValue(constraintMap, \"rotate\", 0);\n\t\t\t\tdata.scaleX = getValue(constraintMap, \"scaleX\", 0);\n\t\t\t\tdata.shearX = getValue(constraintMap, \"shearX\", 0);\n\t\t\t\tdata.limit = getValue(constraintMap, \"limit\", 5000) * scale;\n\t\t\t\tdata.step = 1 / getValue(constraintMap, \"fps\", 60);\n\t\t\t\tdata.inertia = getValue(constraintMap, \"inertia\", 1);\n\t\t\t\tdata.strength = getValue(constraintMap, \"strength\", 100);\n\t\t\t\tdata.damping = getValue(constraintMap, \"damping\", 1);\n\t\t\t\tdata.massInverse = 1 / getValue(constraintMap, \"mass\", 1);\n\t\t\t\tdata.wind = getValue(constraintMap, \"wind\", 0);\n\t\t\t\tdata.gravity = getValue(constraintMap, \"gravity\", 0);\n\t\t\t\tdata.mix = getValue(constraintMap, \"mix\", 1);\n\t\t\t\tdata.inertiaGlobal = getValue(constraintMap, \"inertiaGlobal\", false);\n\t\t\t\tdata.strengthGlobal = getValue(constraintMap, \"strengthGlobal\", false);\n\t\t\t\tdata.dampingGlobal = getValue(constraintMap, \"dampingGlobal\", false);\n\t\t\t\tdata.massGlobal = getValue(constraintMap, \"massGlobal\", false);\n\t\t\t\tdata.windGlobal = getValue(constraintMap, \"windGlobal\", false);\n\t\t\t\tdata.gravityGlobal = getValue(constraintMap, \"gravityGlobal\", false);\n\t\t\t\tdata.mixGlobal = getValue(constraintMap, \"mixGlobal\", false);\n\n\t\t\t\tskeletonData.physicsConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Skins.\n\t\tif (root.skins) {\n\t\t\tfor (let i = 0; i < root.skins.length; i++) {\n\t\t\t\tlet skinMap = root.skins[i]\n\t\t\t\tlet skin = new Skin(skinMap.name);\n\n\t\t\t\tif (skinMap.bones) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.bones.length; ii++) {\n\t\t\t\t\t\tlet boneName = skinMap.bones[ii];\n\t\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.bones.push(bone);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.ik) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.ik.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.ik[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findIkConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find IK constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.transform) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.transform.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.transform[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findTransformConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find transform constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.path) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.path.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.path[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findPathConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find path constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.physics) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.physics.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.physics[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findPhysicsConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find physics constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (let slotName in skinMap.attachments) {\n\t\t\t\t\tlet slot = skeletonData.findSlot(slotName);\n\t\t\t\t\tif (!slot) throw new Error(`Couldn't find slot ${slotName} for skin ${skinMap.name}.`);\n\t\t\t\t\tlet slotMap = skinMap.attachments[slotName];\n\t\t\t\t\tfor (let entryName in slotMap) {\n\t\t\t\t\t\tlet attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\n\t\t\t\t\t\tif (attachment) skin.setAttachment(slot.index, entryName, attachment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tskeletonData.skins.push(skin);\n\t\t\t\tif (skin.name == \"default\") skeletonData.defaultSkin = skin;\n\t\t\t}\n\t\t}\n\n\t\t// Linked meshes.\n\t\tfor (let i = 0, n = this.linkedMeshes.length; i < n; i++) {\n\t\t\tlet linkedMesh = this.linkedMeshes[i];\n\t\t\tlet skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\n\t\t\tif (!skin) throw new Error(`Skin not found: ${linkedMesh.skin}`);\n\t\t\tlet parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n\t\t\tif (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);\n\t\t\tlinkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;\n\t\t\tlinkedMesh.mesh.setParentMesh(parent);\n\t\t\tif (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\n\t\t}\n\t\tthis.linkedMeshes.length = 0;\n\n\t\t// Events.\n\t\tif (root.events) {\n\t\t\tfor (let eventName in root.events) {\n\t\t\t\tlet eventMap = root.events[eventName];\n\t\t\t\tlet data = new EventData(eventName);\n\t\t\t\tdata.intValue = getValue(eventMap, \"int\", 0);\n\t\t\t\tdata.floatValue = getValue(eventMap, \"float\", 0);\n\t\t\t\tdata.stringValue = getValue(eventMap, \"string\", \"\");\n\t\t\t\tdata.audioPath = getValue(eventMap, \"audio\", null);\n\t\t\t\tif (data.audioPath) {\n\t\t\t\t\tdata.volume = getValue(eventMap, \"volume\", 1);\n\t\t\t\t\tdata.balance = getValue(eventMap, \"balance\", 0);\n\t\t\t\t}\n\t\t\t\tskeletonData.events.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Animations.\n\t\tif (root.animations) {\n\t\t\tfor (let animationName in root.animations) {\n\t\t\t\tlet animationMap = root.animations[animationName];\n\t\t\t\tthis.readAnimation(animationMap, animationName, skeletonData);\n\t\t\t}\n\t\t}\n\n\t\treturn skeletonData;\n\t}\n\n\treadAttachment (map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment | null {\n\t\tlet scale = this.scale;\n\t\tname = getValue(map, \"name\", name);\n\n\t\tswitch (getValue(map, \"type\", \"region\")) {\n\t\t\tcase \"region\": {\n\t\t\t\tlet path = getValue(map, \"path\", name);\n\t\t\t\tlet sequence = this.readSequence(getValue(map, \"sequence\", null));\n\t\t\t\tlet region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\n\t\t\t\tif (!region) return null;\n\t\t\t\tregion.path = path;\n\t\t\t\tregion.x = getValue(map, \"x\", 0) * scale;\n\t\t\t\tregion.y = getValue(map, \"y\", 0) * scale;\n\t\t\t\tregion.scaleX = getValue(map, \"scaleX\", 1);\n\t\t\t\tregion.scaleY = getValue(map, \"scaleY\", 1);\n\t\t\t\tregion.rotation = getValue(map, \"rotation\", 0);\n\t\t\t\tregion.width = map.width * scale;\n\t\t\t\tregion.height = map.height * scale;\n\t\t\t\tregion.sequence = sequence;\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) region.color.setFromString(color);\n\n\t\t\t\tif (region.region != null) region.updateRegion();\n\t\t\t\treturn region;\n\t\t\t}\n\t\t\tcase \"boundingbox\": {\n\t\t\t\tlet box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n\t\t\t\tif (!box) return null;\n\t\t\t\tthis.readVertices(map, box, map.vertexCount << 1);\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) box.color.setFromString(color);\n\t\t\t\treturn box;\n\t\t\t}\n\t\t\tcase \"mesh\":\n\t\t\tcase \"linkedmesh\": {\n\t\t\t\tlet path = getValue(map, \"path\", name);\n\t\t\t\tlet sequence = this.readSequence(getValue(map, \"sequence\", null));\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\n\t\t\t\tlet color = getValue(map, \"color\", null);\n\t\t\t\tif (color) mesh.color.setFromString(color);\n\n\t\t\t\tmesh.width = getValue(map, \"width\", 0) * scale;\n\t\t\t\tmesh.height = getValue(map, \"height\", 0) * scale;\n\t\t\t\tmesh.sequence = sequence;\n\n\t\t\t\tlet parent: string = getValue(map, \"parent\", null);\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, getValue(map, \"skin\", null), slotIndex, parent, getValue(map, \"timelines\", true)));\n\t\t\t\t\treturn mesh;\n\t\t\t\t}\n\n\t\t\t\tlet uvs: Array = map.uvs;\n\t\t\t\tthis.readVertices(map, mesh, uvs.length);\n\t\t\t\tmesh.triangles = map.triangles;\n\t\t\t\tmesh.regionUVs = uvs;\n\t\t\t\tif (mesh.region != null) mesh.updateRegion();\n\n\t\t\t\tmesh.edges = getValue(map, \"edges\", null);\n\t\t\t\tmesh.hullLength = getValue(map, \"hull\", 0) * 2;\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase \"path\": {\n\t\t\t\tlet path = this.attachmentLoader.newPathAttachment(skin, name);\n\t\t\t\tif (!path) return null;\n\t\t\t\tpath.closed = getValue(map, \"closed\", false);\n\t\t\t\tpath.constantSpeed = getValue(map, \"constantSpeed\", true);\n\n\t\t\t\tlet vertexCount = map.vertexCount;\n\t\t\t\tthis.readVertices(map, path, vertexCount << 1);\n\n\t\t\t\tlet lengths: Array = Utils.newArray(vertexCount / 3, 0);\n\t\t\t\tfor (let i = 0; i < map.lengths.length; i++)\n\t\t\t\t\tlengths[i] = map.lengths[i] * scale;\n\t\t\t\tpath.lengths = lengths;\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) path.color.setFromString(color);\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tcase \"point\": {\n\t\t\t\tlet point = this.attachmentLoader.newPointAttachment(skin, name);\n\t\t\t\tif (!point) return null;\n\t\t\t\tpoint.x = getValue(map, \"x\", 0) * scale;\n\t\t\t\tpoint.y = getValue(map, \"y\", 0) * scale;\n\t\t\t\tpoint.rotation = getValue(map, \"rotation\", 0);\n\n\t\t\t\tlet color = getValue(map, \"color\", null);\n\t\t\t\tif (color) point.color.setFromString(color);\n\t\t\t\treturn point;\n\t\t\t}\n\t\t\tcase \"clipping\": {\n\t\t\t\tlet clip = this.attachmentLoader.newClippingAttachment(skin, name);\n\t\t\t\tif (!clip) return null;\n\n\t\t\t\tlet end = getValue(map, \"end\", null);\n\t\t\t\tif (end) clip.endSlot = skeletonData.findSlot(end);\n\n\t\t\t\tlet vertexCount = map.vertexCount;\n\t\t\t\tthis.readVertices(map, clip, vertexCount << 1);\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) clip.color.setFromString(color);\n\t\t\t\treturn clip;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\treadSequence (map: any) {\n\t\tif (map == null) return null;\n\t\tlet sequence = new Sequence(getValue(map, \"count\", 0));\n\t\tsequence.start = getValue(map, \"start\", 1);\n\t\tsequence.digits = getValue(map, \"digits\", 0);\n\t\tsequence.setupIndex = getValue(map, \"setup\", 0);\n\t\treturn sequence;\n\t}\n\n\treadVertices (map: any, attachment: VertexAttachment, verticesLength: number) {\n\t\tlet scale = this.scale;\n\t\tattachment.worldVerticesLength = verticesLength;\n\t\tlet vertices: Array = map.vertices;\n\t\tif (verticesLength == vertices.length) {\n\t\t\tlet scaledVertices = Utils.toFloatArray(vertices);\n\t\t\tif (scale != 1) {\n\t\t\t\tfor (let i = 0, n = vertices.length; i < n; i++)\n\t\t\t\t\tscaledVertices[i] *= scale;\n\t\t\t}\n\t\t\tattachment.vertices = scaledVertices;\n\t\t\treturn;\n\t\t}\n\t\tlet weights = new Array();\n\t\tlet bones = new Array();\n\t\tfor (let i = 0, n = vertices.length; i < n;) {\n\t\t\tlet boneCount = vertices[i++];\n\t\t\tbones.push(boneCount);\n\t\t\tfor (let nn = i + boneCount * 4; i < nn; i += 4) {\n\t\t\t\tbones.push(vertices[i]);\n\t\t\t\tweights.push(vertices[i + 1] * scale);\n\t\t\t\tweights.push(vertices[i + 2] * scale);\n\t\t\t\tweights.push(vertices[i + 3]);\n\t\t\t}\n\t\t}\n\t\tattachment.bones = bones;\n\t\tattachment.vertices = Utils.toFloatArray(weights);\n\t}\n\n\treadAnimation (map: any, name: string, skeletonData: SkeletonData) {\n\t\tlet scale = this.scale;\n\t\tlet timelines = new Array();\n\n\t\t// Slot timelines.\n\t\tif (map.slots) {\n\t\t\tfor (let slotName in map.slots) {\n\t\t\t\tlet slotMap = map.slots[slotName];\n\t\t\t\tlet slot = skeletonData.findSlot(slotName);\n\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slotName);\n\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\tfor (let timelineName in slotMap) {\n\t\t\t\t\tlet timelineMap = slotMap[timelineName];\n\t\t\t\t\tif (!timelineMap) continue;\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName == \"attachment\") {\n\t\t\t\t\t\tlet timeline = new AttachmentTimeline(frames, slotIndex);\n\t\t\t\t\t\tfor (let frame = 0; frame < frames; frame++) {\n\t\t\t\t\t\t\tlet keyMap = timelineMap[frame];\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(keyMap, \"time\", 0), getValue(keyMap, \"name\", null));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgba\") {\n\t\t\t\t\t\tlet timeline = new RGBATimeline(frames, frames << 2, slotIndex);\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.color);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color.a);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.color);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgb\") {\n\t\t\t\t\t\tlet timeline = new RGBTimeline(frames, frames * 3, slotIndex);\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.color);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.color);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"alpha\") {\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, new AlphaTimeline(frames, frames, slotIndex), 0, 1));\n\t\t\t\t\t} else if (timelineName == \"rgba2\") {\n\t\t\t\t\t\tlet timeline = new RGBA2Timeline(frames, frames * 7, slotIndex);\n\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.light);\n\t\t\t\t\t\tlet color2 = Color.fromString(keyMap.dark);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.light);\n\t\t\t\t\t\t\tlet newColor2 = Color.fromString(nextMap.dark);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tcolor2 = newColor2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgb2\") {\n\t\t\t\t\t\tlet timeline = new RGB2Timeline(frames, frames * 6, slotIndex);\n\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.light);\n\t\t\t\t\t\tlet color2 = Color.fromString(keyMap.dark);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.light);\n\t\t\t\t\t\t\tlet newColor2 = Color.fromString(nextMap.dark);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tcolor2 = newColor2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bone timelines.\n\t\tif (map.bones) {\n\t\t\tfor (let boneName in map.bones) {\n\t\t\t\tlet boneMap = map.bones[boneName];\n\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\tif (!bone) throw new Error(\"Bone not found: \" + boneName);\n\t\t\t\tlet boneIndex = bone.index;\n\t\t\t\tfor (let timelineName in boneMap) {\n\t\t\t\t\tlet timelineMap = boneMap[timelineName];\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (frames == 0) continue;\n\n\t\t\t\t\tif (timelineName === \"rotate\") {\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, new RotateTimeline(frames, frames, boneIndex), 0, 1));\n\t\t\t\t\t} else if (timelineName === \"translate\") {\n\t\t\t\t\t\tlet timeline = new TranslateTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, scale));\n\t\t\t\t\t} else if (timelineName === \"translatex\") {\n\t\t\t\t\t\tlet timeline = new TranslateXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, scale));\n\t\t\t\t\t} else if (timelineName === \"translatey\") {\n\t\t\t\t\t\tlet timeline = new TranslateYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, scale));\n\t\t\t\t\t} else if (timelineName === \"scale\") {\n\t\t\t\t\t\tlet timeline = new ScaleTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 1, 1));\n\t\t\t\t\t} else if (timelineName === \"scalex\") {\n\t\t\t\t\t\tlet timeline = new ScaleXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 1, 1));\n\t\t\t\t\t} else if (timelineName === \"scaley\") {\n\t\t\t\t\t\tlet timeline = new ScaleYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 1, 1));\n\t\t\t\t\t} else if (timelineName === \"shear\") {\n\t\t\t\t\t\tlet timeline = new ShearTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, 1));\n\t\t\t\t\t} else if (timelineName === \"shearx\") {\n\t\t\t\t\t\tlet timeline = new ShearXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t\t} else if (timelineName === \"sheary\") {\n\t\t\t\t\t\tlet timeline = new ShearYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t\t} else if (timelineName === \"inherit\") {\n\t\t\t\t\t\tlet timeline = new InheritTimeline(frames, bone.index);\n\t\t\t\t\t\tfor (let frame = 0; frame < timelineMap.length; frame++) {\n\t\t\t\t\t\t\tlet aFrame = timelineMap[frame];\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(aFrame, \"time\", 0), Utils.enumValue(Inherit, getValue(aFrame, \"inherit\", \"Normal\")));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// IK constraint timelines.\n\t\tif (map.ik) {\n\t\t\tfor (let constraintName in map.ik) {\n\t\t\t\tlet constraintMap = map.ik[constraintName];\n\t\t\t\tlet keyMap = constraintMap[0];\n\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\tlet constraint = skeletonData.findIkConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"IK Constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.ikConstraints.indexOf(constraint);\n\t\t\t\tlet timeline = new IkConstraintTimeline(constraintMap.length, constraintMap.length << 1, constraintIndex);\n\n\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\tlet mix = getValue(keyMap, \"mix\", 1);\n\t\t\t\tlet softness = getValue(keyMap, \"softness\", 0) * scale;\n\n\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\ttimeline.setFrame(frame, time, mix, softness, getValue(keyMap, \"bendPositive\", true) ? 1 : -1, getValue(keyMap, \"compress\", false), getValue(keyMap, \"stretch\", false));\n\t\t\t\t\tlet nextMap = constraintMap[frame + 1];\n\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\tlet mix2 = getValue(nextMap, \"mix\", 1);\n\t\t\t\t\tlet softness2 = getValue(nextMap, \"softness\", 0) * scale;\n\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\tif (curve) {\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale);\n\t\t\t\t\t}\n\n\t\t\t\t\ttime = time2;\n\t\t\t\t\tmix = mix2;\n\t\t\t\t\tsoftness = softness2;\n\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t}\n\t\t\t\ttimelines.push(timeline);\n\t\t\t}\n\t\t}\n\n\t\t// Transform constraint timelines.\n\t\tif (map.transform) {\n\t\t\tfor (let constraintName in map.transform) {\n\t\t\t\tlet timelineMap = map.transform[constraintName];\n\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\tlet constraint = skeletonData.findTransformConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"Transform constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.transformConstraints.indexOf(constraint);\n\t\t\t\tlet timeline = new TransformConstraintTimeline(timelineMap.length, timelineMap.length * 6, constraintIndex);\n\n\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\tlet mixRotate = getValue(keyMap, \"mixRotate\", 1);\n\t\t\t\tlet mixX = getValue(keyMap, \"mixX\", 1);\n\t\t\t\tlet mixY = getValue(keyMap, \"mixY\", mixX);\n\t\t\t\tlet mixScaleX = getValue(keyMap, \"mixScaleX\", 1);\n\t\t\t\tlet mixScaleY = getValue(keyMap, \"mixScaleY\", mixScaleX);\n\t\t\t\tlet mixShearY = getValue(keyMap, \"mixShearY\", 1);\n\n\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\n\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\tlet mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\n\t\t\t\t\tlet mixX2 = getValue(nextMap, \"mixX\", 1);\n\t\t\t\t\tlet mixY2 = getValue(nextMap, \"mixY\", mixX2);\n\t\t\t\t\tlet mixScaleX2 = getValue(nextMap, \"mixScaleX\", 1);\n\t\t\t\t\tlet mixScaleY2 = getValue(nextMap, \"mixScaleY\", mixScaleX2);\n\t\t\t\t\tlet mixShearY2 = getValue(nextMap, \"mixShearY\", 1);\n\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\tif (curve) {\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\ttime = time2;\n\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\t\tmixScaleY = mixScaleY2;\n\t\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t}\n\t\t\t\ttimelines.push(timeline);\n\t\t\t}\n\t\t}\n\n\t\t// Path constraint timelines.\n\t\tif (map.path) {\n\t\t\tfor (let constraintName in map.path) {\n\t\t\t\tlet constraintMap = map.path[constraintName];\n\t\t\t\tlet constraint = skeletonData.findPathConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"Path constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.pathConstraints.indexOf(constraint);\n\t\t\t\tfor (let timelineName in constraintMap) {\n\t\t\t\t\tlet timelineMap = constraintMap[timelineName];\n\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName === \"position\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintPositionTimeline(frames, frames, constraintIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, constraint.positionMode == PositionMode.Fixed ? scale : 1));\n\t\t\t\t\t} else if (timelineName === \"spacing\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintSpacingTimeline(frames, frames, constraintIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, constraint.spacingMode == SpacingMode.Length || constraint.spacingMode == SpacingMode.Fixed ? scale : 1));\n\t\t\t\t\t} else if (timelineName === \"mix\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintMixTimeline(frames, frames * 3, constraintIndex);\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet mixRotate = getValue(keyMap, \"mixRotate\", 1);\n\t\t\t\t\t\tlet mixX = getValue(keyMap, \"mixX\", 1);\n\t\t\t\t\t\tlet mixY = getValue(keyMap, \"mixY\", mixX);\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\n\t\t\t\t\t\t\tlet mixX2 = getValue(nextMap, \"mixX\", 1);\n\t\t\t\t\t\t\tlet mixY2 = getValue(nextMap, \"mixY\", mixX2);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Physics constraint timelines.\n\t\tif (map.physics) {\n\t\t\tfor (let constraintName in map.physics) {\n\t\t\t\tlet constraintMap = map.physics[constraintName];\n\t\t\t\tlet constraintIndex = -1;\n\t\t\t\tif (constraintName.length > 0) {\n\t\t\t\t\tlet constraint = skeletonData.findPhysicsConstraint(constraintName);\n\t\t\t\t\tif (!constraint) throw new Error(\"Physics constraint not found: \" + constraintName);\n\t\t\t\t\tconstraintIndex = skeletonData.physicsConstraints.indexOf(constraint);\n\t\t\t\t}\n\t\t\t\tfor (let timelineName in constraintMap) {\n\t\t\t\t\tlet timelineMap = constraintMap[timelineName];\n\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName == \"reset\") {\n\t\t\t\t\t\tconst timeline = new PhysicsConstraintResetTimeline(frames, constraintIndex);\n\t\t\t\t\t\tfor (let frame = 0; keyMap != null; keyMap = timelineMap[frame + 1], frame++)\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(keyMap, \"time\", 0));\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet timeline;\n\t\t\t\t\tif (timelineName == \"inertia\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintInertiaTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"strength\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintStrengthTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"damping\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintDampingTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"mass\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintMassTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"wind\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintWindTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"gravity\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintGravityTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"mix\") //\n\t\t\t\t\t\ttimeline = new PhysicsConstraintMixTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Attachment timelines.\n\t\tif (map.attachments) {\n\t\t\tfor (let attachmentsName in map.attachments) {\n\t\t\t\tlet attachmentsMap = map.attachments[attachmentsName];\n\t\t\t\tlet skin = skeletonData.findSkin(attachmentsName);\n\t\t\t\tif (!skin) throw new Error(\"Skin not found: \" + attachmentsName);\n\t\t\t\tfor (let slotMapName in attachmentsMap) {\n\t\t\t\t\tlet slotMap = attachmentsMap[slotMapName];\n\t\t\t\t\tlet slot = skeletonData.findSlot(slotMapName);\n\t\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slotMapName);\n\t\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\t\tfor (let attachmentMapName in slotMap) {\n\t\t\t\t\t\tlet attachmentMap = slotMap[attachmentMapName];\n\t\t\t\t\t\tlet attachment = skin.getAttachment(slotIndex, attachmentMapName);\n\n\t\t\t\t\t\tfor (let timelineMapName in attachmentMap) {\n\t\t\t\t\t\t\tlet timelineMap = attachmentMap[timelineMapName];\n\t\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\t\t\tif (timelineMapName == \"deform\") {\n\t\t\t\t\t\t\t\tlet weighted = attachment.bones;\n\t\t\t\t\t\t\t\tlet vertices = attachment.vertices;\n\t\t\t\t\t\t\t\tlet deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n\t\t\t\t\t\t\t\tlet timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment);\n\t\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\t\tlet deform: NumberArrayLike;\n\t\t\t\t\t\t\t\t\tlet verticesValue: Array = getValue(keyMap, \"vertices\", null);\n\t\t\t\t\t\t\t\t\tif (!verticesValue)\n\t\t\t\t\t\t\t\t\t\tdeform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdeform = Utils.newFloatArray(deformLength);\n\t\t\t\t\t\t\t\t\t\tlet start = getValue(keyMap, \"offset\", 0);\n\t\t\t\t\t\t\t\t\t\tUtils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\n\t\t\t\t\t\t\t\t\t\tif (scale != 1) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = start, n = i + verticesValue.length; i < n; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tdeform[i] *= scale;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (!weighted) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < deformLength; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tdeform[i] += vertices[i];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, deform);\n\t\t\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\t\t\tif (curve) bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1);\n\t\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\t} else if (timelineMapName == \"sequence\") {\n\t\t\t\t\t\t\t\tlet timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment as unknown as HasTextureRegion);\n\t\t\t\t\t\t\t\tlet lastDelay = 0;\n\t\t\t\t\t\t\t\tfor (let frame = 0; frame < timelineMap.length; frame++) {\n\t\t\t\t\t\t\t\t\tlet delay = getValue(keyMap, \"delay\", lastDelay);\n\t\t\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\t\t\tlet mode = SequenceMode[getValue(keyMap, \"mode\", \"hold\")] as unknown as number;\n\t\t\t\t\t\t\t\t\tlet index = getValue(keyMap, \"index\", 0);\n\t\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mode, index, delay);\n\t\t\t\t\t\t\t\t\tlastDelay = delay;\n\t\t\t\t\t\t\t\t\tkeyMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw order timelines.\n\t\tif (map.drawOrder) {\n\t\t\tlet timeline = new DrawOrderTimeline(map.drawOrder.length);\n\t\t\tlet slotCount = skeletonData.slots.length;\n\t\t\tlet frame = 0;\n\t\t\tfor (let i = 0; i < map.drawOrder.length; i++, frame++) {\n\t\t\t\tlet drawOrderMap = map.drawOrder[i];\n\t\t\t\tlet drawOrder: Array | null = null;\n\t\t\t\tlet offsets = getValue(drawOrderMap, \"offsets\", null);\n\t\t\t\tif (offsets) {\n\t\t\t\t\tdrawOrder = Utils.newArray(slotCount, -1);\n\t\t\t\t\tlet unchanged = Utils.newArray(slotCount - offsets.length, 0);\n\t\t\t\t\tlet originalIndex = 0, unchangedIndex = 0;\n\t\t\t\t\tfor (let ii = 0; ii < offsets.length; ii++) {\n\t\t\t\t\t\tlet offsetMap = offsets[ii];\n\t\t\t\t\t\tlet slot = skeletonData.findSlot(offsetMap.slot);\n\t\t\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slot);\n\t\t\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\t\t\t// Collect unchanged items.\n\t\t\t\t\t\twhile (originalIndex != slotIndex)\n\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t\t// Set changed items.\n\t\t\t\t\t\tdrawOrder[originalIndex + offsetMap.offset] = originalIndex++;\n\t\t\t\t\t}\n\t\t\t\t\t// Collect remaining unchanged items.\n\t\t\t\t\twhile (originalIndex < slotCount)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t// Fill in unchanged items.\n\t\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\t\tif (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex];\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(frame, getValue(drawOrderMap, \"time\", 0), drawOrder);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Event timelines.\n\t\tif (map.events) {\n\t\t\tlet timeline = new EventTimeline(map.events.length);\n\t\t\tlet frame = 0;\n\t\t\tfor (let i = 0; i < map.events.length; i++, frame++) {\n\t\t\t\tlet eventMap = map.events[i];\n\t\t\t\tlet eventData = skeletonData.findEvent(eventMap.name);\n\t\t\t\tif (!eventData) throw new Error(\"Event not found: \" + eventMap.name);\n\t\t\t\tlet event = new Event(Utils.toSinglePrecision(getValue(eventMap, \"time\", 0)), eventData);\n\t\t\t\tevent.intValue = getValue(eventMap, \"int\", eventData.intValue);\n\t\t\t\tevent.floatValue = getValue(eventMap, \"float\", eventData.floatValue);\n\t\t\t\tevent.stringValue = getValue(eventMap, \"string\", eventData.stringValue);\n\t\t\t\tif (event.data.audioPath) {\n\t\t\t\t\tevent.volume = getValue(eventMap, \"volume\", 1);\n\t\t\t\t\tevent.balance = getValue(eventMap, \"balance\", 0);\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(frame, event);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\tlet duration = 0;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\tduration = Math.max(duration, timelines[i].getDuration());\n\t\tskeletonData.animations.push(new Animation(name, timelines, duration));\n\t}\n}\n\nclass LinkedMesh {\n\tparent: string; skin: string;\n\tslotIndex: number;\n\tmesh: MeshAttachment;\n\tinheritTimeline: boolean;\n\n\tconstructor (mesh: MeshAttachment, skin: string, slotIndex: number, parent: string, inheritDeform: boolean) {\n\t\tthis.mesh = mesh;\n\t\tthis.skin = skin;\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.parent = parent;\n\t\tthis.inheritTimeline = inheritDeform;\n\t}\n}\n\nfunction readTimeline1 (keys: any[], timeline: CurveTimeline1, defaultValue: number, scale: number) {\n\tlet keyMap = keys[0];\n\tlet time = getValue(keyMap, \"time\", 0);\n\tlet value = getValue(keyMap, \"value\", defaultValue) * scale;\n\tlet bezier = 0;\n\tfor (let frame = 0; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value);\n\t\tlet nextMap = keys[frame + 1];\n\t\tif (!nextMap) {\n\t\t\ttimeline.shrink(bezier);\n\t\t\treturn timeline;\n\t\t}\n\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\tlet value2 = getValue(nextMap, \"value\", defaultValue) * scale;\n\t\tif (keyMap.curve) bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale);\n\t\ttime = time2;\n\t\tvalue = value2;\n\t\tkeyMap = nextMap;\n\t}\n}\n\nfunction readTimeline2 (keys: any[], timeline: CurveTimeline2, name1: string, name2: string, defaultValue: number, scale: number) {\n\tlet keyMap = keys[0];\n\tlet time = getValue(keyMap, \"time\", 0);\n\tlet value1 = getValue(keyMap, name1, defaultValue) * scale;\n\tlet value2 = getValue(keyMap, name2, defaultValue) * scale;\n\tlet bezier = 0;\n\tfor (let frame = 0; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value1, value2);\n\t\tlet nextMap = keys[frame + 1];\n\t\tif (!nextMap) {\n\t\t\ttimeline.shrink(bezier);\n\t\t\treturn timeline;\n\t\t}\n\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\tlet nvalue1 = getValue(nextMap, name1, defaultValue) * scale;\n\t\tlet nvalue2 = getValue(nextMap, name2, defaultValue) * scale;\n\t\tlet curve = keyMap.curve;\n\t\tif (curve) {\n\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale);\n\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue1 = nvalue1;\n\t\tvalue2 = nvalue2;\n\t\tkeyMap = nextMap;\n\t}\n}\n\nfunction readCurve (curve: any, timeline: CurveTimeline, bezier: number, frame: number, value: number, time1: number, time2: number,\n\tvalue1: number, value2: number, scale: number) {\n\tif (curve == \"stepped\") {\n\t\ttimeline.setStepped(frame);\n\t\treturn bezier;\n\t}\n\tlet i = value << 2;\n\tlet cx1 = curve[i];\n\tlet cy1 = curve[i + 1] * scale;\n\tlet cx2 = curve[i + 2];\n\tlet cy2 = curve[i + 3] * scale;\n\ttimeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);\n\treturn bezier + 1;\n}\n\nfunction getValue (map: any, property: string, defaultValue: any) {\n\treturn map[property] !== undefined ? map[property] : defaultValue;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n(() => {\n\tif (typeof Math.fround === \"undefined\") {\n\t\tMath.fround = (function (array) {\n\t\t\treturn function (x: number) {\n\t\t\t\treturn array[0] = x, array[0];\n\t\t\t};\n\t\t})(new Float32Array(1));\n\t}\n})();\n\nexport { }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Restorable, BlendMode } from \"@esotericsoftware/spine-core\";\n\nexport class ManagedWebGLRenderingContext {\n\tpublic canvas: HTMLCanvasElement | OffscreenCanvas;\n\tpublic gl: WebGLRenderingContext;\n\tprivate restorables = new Array();\n\n\tconstructor (canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig: any = { alpha: \"true\" }) {\n\t\tif (!((canvasOrContext instanceof WebGLRenderingContext) || (typeof WebGL2RenderingContext !== 'undefined' && canvasOrContext instanceof WebGL2RenderingContext))) {\n\t\t\tlet canvas: HTMLCanvasElement = canvasOrContext;\n\t\t\tthis.gl = (canvas.getContext(\"webgl2\", contextConfig) || canvas.getContext(\"webgl\", contextConfig));\n\t\t\tthis.canvas = canvas;\n\t\t\tcanvas.addEventListener(\"webglcontextlost\", (e: any) => {\n\t\t\t\tlet event = e;\n\t\t\t\tif (e) e.preventDefault();\n\t\t\t});\n\t\t\tcanvas.addEventListener(\"webglcontextrestored\", (e: any) => {\n\t\t\t\tfor (let i = 0, n = this.restorables.length; i < n; i++)\n\t\t\t\t\tthis.restorables[i].restore();\n\t\t\t});\n\t\t} else {\n\t\t\tthis.gl = canvasOrContext;\n\t\t\tthis.canvas = this.gl.canvas;\n\t\t}\n\t}\n\n\taddRestorable (restorable: Restorable) {\n\t\tthis.restorables.push(restorable);\n\t}\n\n\tremoveRestorable (restorable: Restorable) {\n\t\tlet index = this.restorables.indexOf(restorable);\n\t\tif (index > -1) this.restorables.splice(index, 1);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture, Disposable, Restorable, TextureFilter, TextureWrap } from \"@esotericsoftware/spine-core\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class GLTexture extends Texture implements Disposable, Restorable {\n\tcontext: ManagedWebGLRenderingContext;\n\tprivate texture: WebGLTexture | null = null;\n\tprivate boundUnit = 0;\n\tprivate useMipMaps = false;\n\n\tpublic static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement | ImageBitmap, useMipMaps: boolean = false) {\n\t\tsuper(image);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.useMipMaps = useMipMaps;\n\t\tthis.restore();\n\t\tthis.context.addRestorable(this);\n\t}\n\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) {\n\t\tlet gl = this.context.gl;\n\t\tthis.bind();\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, GLTexture.validateMagFilter(magFilter));\n\t\tthis.useMipMaps = GLTexture.usesMipMaps(minFilter);\n\t\tif (this.useMipMaps) gl.generateMipmap(gl.TEXTURE_2D);\n\t}\n\n\tstatic validateMagFilter (magFilter: TextureFilter) {\n\t\tswitch (magFilter) {\n\t\t\tcase TextureFilter.MipMapLinearLinear:\n\t\t\tcase TextureFilter.MipMapLinearNearest:\n\t\t\tcase TextureFilter.MipMapNearestLinear:\n\t\t\tcase TextureFilter.MipMapNearestNearest:\n\t\t\t\treturn TextureFilter.Linear;\n\t\t\tdefault:\n\t\t\t\treturn magFilter;\n\t\t}\n\t}\n\n\tstatic usesMipMaps (filter: TextureFilter) {\n\t\tswitch (filter) {\n\t\t\tcase TextureFilter.MipMapLinearLinear:\n\t\t\tcase TextureFilter.MipMapLinearNearest:\n\t\t\tcase TextureFilter.MipMapNearestLinear:\n\t\t\tcase TextureFilter.MipMapNearestNearest:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) {\n\t\tlet gl = this.context.gl;\n\t\tthis.bind();\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap);\n\t}\n\n\tupdate (useMipMaps: boolean) {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.texture) this.texture = this.context.gl.createTexture();\n\t\tthis.bind();\n\t\tif (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\t\tif (useMipMaps) gl.generateMipmap(gl.TEXTURE_2D);\n\t}\n\n\trestore () {\n\t\tthis.texture = null;\n\t\tthis.update(this.useMipMaps);\n\t}\n\n\tbind (unit: number = 0) {\n\t\tlet gl = this.context.gl;\n\t\tthis.boundUnit = unit;\n\t\tgl.activeTexture(gl.TEXTURE0 + unit);\n\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n\t}\n\n\tunbind () {\n\t\tlet gl = this.context.gl;\n\t\tgl.activeTexture(gl.TEXTURE0 + this.boundUnit);\n\t\tgl.bindTexture(gl.TEXTURE_2D, null);\n\t}\n\n\tdispose () {\n\t\tthis.context.removeRestorable(this);\n\t\tlet gl = this.context.gl;\n\t\tgl.deleteTexture(this.texture);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AssetManagerBase, Downloader } from \"@esotericsoftware/spine-core\"\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\nimport { GLTexture } from \"./GLTexture.js\";\n\n\nexport class AssetManager extends AssetManagerBase {\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix: string = \"\", downloader: Downloader = new Downloader()) {\n\t\tsuper((image: HTMLImageElement | ImageBitmap) => {\n\t\t\treturn new GLTexture(context, image);\n\t\t}, pathPrefix, downloader);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Matrix4, M00, M01, M02, M03, M10, M11, M12, M13, M20, M21, M22, M23, M30, M31, M32, M33 } from \"./Matrix4.js\";\n\nexport class Vector3 {\n\tx = 0;\n\ty = 0;\n\tz = 0;\n\n\tconstructor (x: number = 0, y: number = 0, z: number = 0) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tsetFrom (v: Vector3): Vector3 {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tset (x: number, y: number, z: number): Vector3 {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tadd (v: Vector3): Vector3 {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\tsub (v: Vector3): Vector3 {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tscale (s: number): Vector3 {\n\t\tthis.x *= s;\n\t\tthis.y *= s;\n\t\tthis.z *= s;\n\t\treturn this;\n\t}\n\n\tnormalize (): Vector3 {\n\t\tlet len = this.length();\n\t\tif (len == 0) return this;\n\t\tlen = 1 / len;\n\t\tthis.x *= len;\n\t\tthis.y *= len;\n\t\tthis.z *= len;\n\t\treturn this;\n\t}\n\n\tcross (v: Vector3): Vector3 {\n\t\treturn this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x)\n\t}\n\n\tmultiply (matrix: Matrix4): Vector3 {\n\t\tlet l_mat = matrix.values;\n\t\treturn this.set(this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03],\n\t\t\tthis.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13],\n\t\t\tthis.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23]);\n\t}\n\n\tproject (matrix: Matrix4): Vector3 {\n\t\tlet l_mat = matrix.values;\n\t\tlet l_w = 1 / (this.x * l_mat[M30] + this.y * l_mat[M31] + this.z * l_mat[M32] + l_mat[M33]);\n\t\treturn this.set((this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03]) * l_w,\n\t\t\t(this.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13]) * l_w,\n\t\t\t(this.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23]) * l_w);\n\t}\n\n\tdot (v: Vector3): number {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t}\n\n\tlength (): number {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tdistance (v: Vector3): number {\n\t\tlet a = v.x - this.x;\n\t\tlet b = v.y - this.y;\n\t\tlet c = v.z - this.z;\n\t\treturn Math.sqrt(a * a + b * b + c * c);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Vector3 } from \"./Vector3.js\";\n\nexport const M00 = 0;\nexport const M01 = 4;\nexport const M02 = 8;\nexport const M03 = 12;\nexport const M10 = 1;\nexport const M11 = 5;\nexport const M12 = 9;\nexport const M13 = 13;\nexport const M20 = 2;\nexport const M21 = 6;\nexport const M22 = 10;\nexport const M23 = 14;\nexport const M30 = 3;\nexport const M31 = 7;\nexport const M32 = 11;\nexport const M33 = 15;\n\nexport class Matrix4 {\n\ttemp: Float32Array = new Float32Array(16);\n\tvalues: Float32Array = new Float32Array(16);\n\n\tprivate static xAxis = new Vector3();\n\tprivate static yAxis = new Vector3();\n\tprivate static zAxis = new Vector3();\n\tprivate static tmpMatrix = new Matrix4();\n\n\tconstructor () {\n\t\tlet v = this.values;\n\t\tv[M00] = 1;\n\t\tv[M11] = 1;\n\t\tv[M22] = 1;\n\t\tv[M33] = 1;\n\t}\n\n\tset (values: ArrayLike): Matrix4 {\n\t\tthis.values.set(values);\n\t\treturn this;\n\t}\n\n\ttranspose (): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tt[M00] = v[M00];\n\t\tt[M01] = v[M10];\n\t\tt[M02] = v[M20];\n\t\tt[M03] = v[M30];\n\t\tt[M10] = v[M01];\n\t\tt[M11] = v[M11];\n\t\tt[M12] = v[M21];\n\t\tt[M13] = v[M31];\n\t\tt[M20] = v[M02];\n\t\tt[M21] = v[M12];\n\t\tt[M22] = v[M22];\n\t\tt[M23] = v[M32];\n\t\tt[M30] = v[M03];\n\t\tt[M31] = v[M13];\n\t\tt[M32] = v[M23];\n\t\tt[M33] = v[M33];\n\t\treturn this.set(t);\n\t}\n\n\tidentity (): Matrix4 {\n\t\tlet v = this.values;\n\t\tv[M00] = 1;\n\t\tv[M01] = 0;\n\t\tv[M02] = 0;\n\t\tv[M03] = 0;\n\t\tv[M10] = 0;\n\t\tv[M11] = 1;\n\t\tv[M12] = 0;\n\t\tv[M13] = 0;\n\t\tv[M20] = 0;\n\t\tv[M21] = 0;\n\t\tv[M22] = 1;\n\t\tv[M23] = 0;\n\t\tv[M30] = 0;\n\t\tv[M31] = 0;\n\t\tv[M32] = 0;\n\t\tv[M33] = 1;\n\t\treturn this;\n\t}\n\n\tinvert (): Matrix4 {\n\t\tlet v = this.values;\n\t\tlet t = this.temp;\n\t\tlet l_det = v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03]\n\t\t\t+ v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03]\n\t\t\t- v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13]\n\t\t\t- v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13]\n\t\t\t+ v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23]\n\t\t\t+ v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23]\n\t\t\t- v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33]\n\t\t\t- v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33];\n\t\tif (l_det == 0) throw new Error(\"non-invertible matrix\");\n\t\tlet inv_det = 1.0 / l_det;\n\t\tt[M00] = v[M12] * v[M23] * v[M31] - v[M13] * v[M22] * v[M31] + v[M13] * v[M21] * v[M32]\n\t\t\t- v[M11] * v[M23] * v[M32] - v[M12] * v[M21] * v[M33] + v[M11] * v[M22] * v[M33];\n\t\tt[M01] = v[M03] * v[M22] * v[M31] - v[M02] * v[M23] * v[M31] - v[M03] * v[M21] * v[M32]\n\t\t\t+ v[M01] * v[M23] * v[M32] + v[M02] * v[M21] * v[M33] - v[M01] * v[M22] * v[M33];\n\t\tt[M02] = v[M02] * v[M13] * v[M31] - v[M03] * v[M12] * v[M31] + v[M03] * v[M11] * v[M32]\n\t\t\t- v[M01] * v[M13] * v[M32] - v[M02] * v[M11] * v[M33] + v[M01] * v[M12] * v[M33];\n\t\tt[M03] = v[M03] * v[M12] * v[M21] - v[M02] * v[M13] * v[M21] - v[M03] * v[M11] * v[M22]\n\t\t\t+ v[M01] * v[M13] * v[M22] + v[M02] * v[M11] * v[M23] - v[M01] * v[M12] * v[M23];\n\t\tt[M10] = v[M13] * v[M22] * v[M30] - v[M12] * v[M23] * v[M30] - v[M13] * v[M20] * v[M32]\n\t\t\t+ v[M10] * v[M23] * v[M32] + v[M12] * v[M20] * v[M33] - v[M10] * v[M22] * v[M33];\n\t\tt[M11] = v[M02] * v[M23] * v[M30] - v[M03] * v[M22] * v[M30] + v[M03] * v[M20] * v[M32]\n\t\t\t- v[M00] * v[M23] * v[M32] - v[M02] * v[M20] * v[M33] + v[M00] * v[M22] * v[M33];\n\t\tt[M12] = v[M03] * v[M12] * v[M30] - v[M02] * v[M13] * v[M30] - v[M03] * v[M10] * v[M32]\n\t\t\t+ v[M00] * v[M13] * v[M32] + v[M02] * v[M10] * v[M33] - v[M00] * v[M12] * v[M33];\n\t\tt[M13] = v[M02] * v[M13] * v[M20] - v[M03] * v[M12] * v[M20] + v[M03] * v[M10] * v[M22]\n\t\t\t- v[M00] * v[M13] * v[M22] - v[M02] * v[M10] * v[M23] + v[M00] * v[M12] * v[M23];\n\t\tt[M20] = v[M11] * v[M23] * v[M30] - v[M13] * v[M21] * v[M30] + v[M13] * v[M20] * v[M31]\n\t\t\t- v[M10] * v[M23] * v[M31] - v[M11] * v[M20] * v[M33] + v[M10] * v[M21] * v[M33];\n\t\tt[M21] = v[M03] * v[M21] * v[M30] - v[M01] * v[M23] * v[M30] - v[M03] * v[M20] * v[M31]\n\t\t\t+ v[M00] * v[M23] * v[M31] + v[M01] * v[M20] * v[M33] - v[M00] * v[M21] * v[M33];\n\t\tt[M22] = v[M01] * v[M13] * v[M30] - v[M03] * v[M11] * v[M30] + v[M03] * v[M10] * v[M31]\n\t\t\t- v[M00] * v[M13] * v[M31] - v[M01] * v[M10] * v[M33] + v[M00] * v[M11] * v[M33];\n\t\tt[M23] = v[M03] * v[M11] * v[M20] - v[M01] * v[M13] * v[M20] - v[M03] * v[M10] * v[M21]\n\t\t\t+ v[M00] * v[M13] * v[M21] + v[M01] * v[M10] * v[M23] - v[M00] * v[M11] * v[M23];\n\t\tt[M30] = v[M12] * v[M21] * v[M30] - v[M11] * v[M22] * v[M30] - v[M12] * v[M20] * v[M31]\n\t\t\t+ v[M10] * v[M22] * v[M31] + v[M11] * v[M20] * v[M32] - v[M10] * v[M21] * v[M32];\n\t\tt[M31] = v[M01] * v[M22] * v[M30] - v[M02] * v[M21] * v[M30] + v[M02] * v[M20] * v[M31]\n\t\t\t- v[M00] * v[M22] * v[M31] - v[M01] * v[M20] * v[M32] + v[M00] * v[M21] * v[M32];\n\t\tt[M32] = v[M02] * v[M11] * v[M30] - v[M01] * v[M12] * v[M30] - v[M02] * v[M10] * v[M31]\n\t\t\t+ v[M00] * v[M12] * v[M31] + v[M01] * v[M10] * v[M32] - v[M00] * v[M11] * v[M32];\n\t\tt[M33] = v[M01] * v[M12] * v[M20] - v[M02] * v[M11] * v[M20] + v[M02] * v[M10] * v[M21]\n\t\t\t- v[M00] * v[M12] * v[M21] - v[M01] * v[M10] * v[M22] + v[M00] * v[M11] * v[M22];\n\t\tv[M00] = t[M00] * inv_det;\n\t\tv[M01] = t[M01] * inv_det;\n\t\tv[M02] = t[M02] * inv_det;\n\t\tv[M03] = t[M03] * inv_det;\n\t\tv[M10] = t[M10] * inv_det;\n\t\tv[M11] = t[M11] * inv_det;\n\t\tv[M12] = t[M12] * inv_det;\n\t\tv[M13] = t[M13] * inv_det;\n\t\tv[M20] = t[M20] * inv_det;\n\t\tv[M21] = t[M21] * inv_det;\n\t\tv[M22] = t[M22] * inv_det;\n\t\tv[M23] = t[M23] * inv_det;\n\t\tv[M30] = t[M30] * inv_det;\n\t\tv[M31] = t[M31] * inv_det;\n\t\tv[M32] = t[M32] * inv_det;\n\t\tv[M33] = t[M33] * inv_det;\n\t\treturn this;\n\t}\n\n\tdeterminant (): number {\n\t\tlet v = this.values;\n\t\treturn v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03]\n\t\t\t+ v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03]\n\t\t\t- v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13]\n\t\t\t- v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13]\n\t\t\t+ v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23]\n\t\t\t+ v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23]\n\t\t\t- v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33]\n\t\t\t- v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33];\n\t}\n\n\ttranslate (x: number, y: number, z: number): Matrix4 {\n\t\tlet v = this.values;\n\t\tv[M03] += x;\n\t\tv[M13] += y;\n\t\tv[M23] += z;\n\t\treturn this;\n\t}\n\n\tcopy (): Matrix4 {\n\t\treturn new Matrix4().set(this.values);\n\t}\n\n\tprojection (near: number, far: number, fovy: number, aspectRatio: number): Matrix4 {\n\t\tthis.identity();\n\t\tlet l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0));\n\t\tlet l_a1 = (far + near) / (near - far);\n\t\tlet l_a2 = (2 * far * near) / (near - far);\n\t\tlet v = this.values;\n\t\tv[M00] = l_fd / aspectRatio;\n\t\tv[M10] = 0;\n\t\tv[M20] = 0;\n\t\tv[M30] = 0;\n\t\tv[M01] = 0;\n\t\tv[M11] = l_fd;\n\t\tv[M21] = 0;\n\t\tv[M31] = 0;\n\t\tv[M02] = 0;\n\t\tv[M12] = 0;\n\t\tv[M22] = l_a1;\n\t\tv[M32] = -1;\n\t\tv[M03] = 0;\n\t\tv[M13] = 0;\n\t\tv[M23] = l_a2;\n\t\tv[M33] = 0;\n\t\treturn this;\n\t}\n\n\tortho2d (x: number, y: number, width: number, height: number): Matrix4 {\n\t\treturn this.ortho(x, x + width, y, y + height, 0, 1);\n\t}\n\n\tortho (left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4 {\n\t\tthis.identity();\n\t\tlet x_orth = 2 / (right - left);\n\t\tlet y_orth = 2 / (top - bottom);\n\t\tlet z_orth = -2 / (far - near);\n\n\t\tlet tx = -(right + left) / (right - left);\n\t\tlet ty = -(top + bottom) / (top - bottom);\n\t\tlet tz = -(far + near) / (far - near);\n\n\t\tlet v = this.values;\n\t\tv[M00] = x_orth;\n\t\tv[M10] = 0;\n\t\tv[M20] = 0;\n\t\tv[M30] = 0;\n\t\tv[M01] = 0;\n\t\tv[M11] = y_orth;\n\t\tv[M21] = 0;\n\t\tv[M31] = 0;\n\t\tv[M02] = 0;\n\t\tv[M12] = 0;\n\t\tv[M22] = z_orth;\n\t\tv[M32] = 0;\n\t\tv[M03] = tx;\n\t\tv[M13] = ty;\n\t\tv[M23] = tz;\n\t\tv[M33] = 1;\n\t\treturn this;\n\t}\n\n\tmultiply (matrix: Matrix4): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tlet m = matrix.values;\n\t\tt[M00] = v[M00] * m[M00] + v[M01] * m[M10] + v[M02] * m[M20] + v[M03] * m[M30];\n\t\tt[M01] = v[M00] * m[M01] + v[M01] * m[M11] + v[M02] * m[M21] + v[M03] * m[M31];\n\t\tt[M02] = v[M00] * m[M02] + v[M01] * m[M12] + v[M02] * m[M22] + v[M03] * m[M32];\n\t\tt[M03] = v[M00] * m[M03] + v[M01] * m[M13] + v[M02] * m[M23] + v[M03] * m[M33];\n\t\tt[M10] = v[M10] * m[M00] + v[M11] * m[M10] + v[M12] * m[M20] + v[M13] * m[M30];\n\t\tt[M11] = v[M10] * m[M01] + v[M11] * m[M11] + v[M12] * m[M21] + v[M13] * m[M31];\n\t\tt[M12] = v[M10] * m[M02] + v[M11] * m[M12] + v[M12] * m[M22] + v[M13] * m[M32];\n\t\tt[M13] = v[M10] * m[M03] + v[M11] * m[M13] + v[M12] * m[M23] + v[M13] * m[M33];\n\t\tt[M20] = v[M20] * m[M00] + v[M21] * m[M10] + v[M22] * m[M20] + v[M23] * m[M30];\n\t\tt[M21] = v[M20] * m[M01] + v[M21] * m[M11] + v[M22] * m[M21] + v[M23] * m[M31];\n\t\tt[M22] = v[M20] * m[M02] + v[M21] * m[M12] + v[M22] * m[M22] + v[M23] * m[M32];\n\t\tt[M23] = v[M20] * m[M03] + v[M21] * m[M13] + v[M22] * m[M23] + v[M23] * m[M33];\n\t\tt[M30] = v[M30] * m[M00] + v[M31] * m[M10] + v[M32] * m[M20] + v[M33] * m[M30];\n\t\tt[M31] = v[M30] * m[M01] + v[M31] * m[M11] + v[M32] * m[M21] + v[M33] * m[M31];\n\t\tt[M32] = v[M30] * m[M02] + v[M31] * m[M12] + v[M32] * m[M22] + v[M33] * m[M32];\n\t\tt[M33] = v[M30] * m[M03] + v[M31] * m[M13] + v[M32] * m[M23] + v[M33] * m[M33];\n\t\treturn this.set(this.temp);\n\t}\n\n\tmultiplyLeft (matrix: Matrix4): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tlet m = matrix.values;\n\t\tt[M00] = m[M00] * v[M00] + m[M01] * v[M10] + m[M02] * v[M20] + m[M03] * v[M30];\n\t\tt[M01] = m[M00] * v[M01] + m[M01] * v[M11] + m[M02] * v[M21] + m[M03] * v[M31];\n\t\tt[M02] = m[M00] * v[M02] + m[M01] * v[M12] + m[M02] * v[M22] + m[M03] * v[M32];\n\t\tt[M03] = m[M00] * v[M03] + m[M01] * v[M13] + m[M02] * v[M23] + m[M03] * v[M33];\n\t\tt[M10] = m[M10] * v[M00] + m[M11] * v[M10] + m[M12] * v[M20] + m[M13] * v[M30];\n\t\tt[M11] = m[M10] * v[M01] + m[M11] * v[M11] + m[M12] * v[M21] + m[M13] * v[M31];\n\t\tt[M12] = m[M10] * v[M02] + m[M11] * v[M12] + m[M12] * v[M22] + m[M13] * v[M32];\n\t\tt[M13] = m[M10] * v[M03] + m[M11] * v[M13] + m[M12] * v[M23] + m[M13] * v[M33];\n\t\tt[M20] = m[M20] * v[M00] + m[M21] * v[M10] + m[M22] * v[M20] + m[M23] * v[M30];\n\t\tt[M21] = m[M20] * v[M01] + m[M21] * v[M11] + m[M22] * v[M21] + m[M23] * v[M31];\n\t\tt[M22] = m[M20] * v[M02] + m[M21] * v[M12] + m[M22] * v[M22] + m[M23] * v[M32];\n\t\tt[M23] = m[M20] * v[M03] + m[M21] * v[M13] + m[M22] * v[M23] + m[M23] * v[M33];\n\t\tt[M30] = m[M30] * v[M00] + m[M31] * v[M10] + m[M32] * v[M20] + m[M33] * v[M30];\n\t\tt[M31] = m[M30] * v[M01] + m[M31] * v[M11] + m[M32] * v[M21] + m[M33] * v[M31];\n\t\tt[M32] = m[M30] * v[M02] + m[M31] * v[M12] + m[M32] * v[M22] + m[M33] * v[M32];\n\t\tt[M33] = m[M30] * v[M03] + m[M31] * v[M13] + m[M32] * v[M23] + m[M33] * v[M33];\n\t\treturn this.set(this.temp);\n\t}\n\n\tlookAt (position: Vector3, direction: Vector3, up: Vector3) {\n\t\tlet xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis;\n\t\tzAxis.setFrom(direction).normalize();\n\t\txAxis.setFrom(direction).normalize();\n\t\txAxis.cross(up).normalize();\n\t\tyAxis.setFrom(xAxis).cross(zAxis).normalize();\n\t\tthis.identity();\n\t\tlet val = this.values;\n\t\tval[M00] = xAxis.x;\n\t\tval[M01] = xAxis.y;\n\t\tval[M02] = xAxis.z;\n\t\tval[M10] = yAxis.x;\n\t\tval[M11] = yAxis.y;\n\t\tval[M12] = yAxis.z;\n\t\tval[M20] = -zAxis.x;\n\t\tval[M21] = -zAxis.y;\n\t\tval[M22] = -zAxis.z;\n\n\t\tMatrix4.tmpMatrix.identity();\n\t\tMatrix4.tmpMatrix.values[M03] = -position.x;\n\t\tMatrix4.tmpMatrix.values[M13] = -position.y;\n\t\tMatrix4.tmpMatrix.values[M23] = -position.z;\n\t\tthis.multiply(Matrix4.tmpMatrix)\n\n\t\treturn this;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Matrix4 } from \"./Matrix4.js\";\nimport { Vector3 } from \"./Vector3.js\";\n\nexport class OrthoCamera {\n\tposition = new Vector3(0, 0, 0);\n\tdirection = new Vector3(0, 0, -1);\n\tup = new Vector3(0, 1, 0);\n\tnear = 0;\n\tfar = 100;\n\tzoom = 1;\n\tviewportWidth = 0;\n\tviewportHeight = 0;\n\tprojectionView = new Matrix4();\n\tinverseProjectionView = new Matrix4();\n\tprojection = new Matrix4();\n\tview = new Matrix4();\n\n\tconstructor (viewportWidth: number, viewportHeight: number) {\n\t\tthis.viewportWidth = viewportWidth;\n\t\tthis.viewportHeight = viewportHeight;\n\t\tthis.update();\n\t}\n\n\tupdate () {\n\t\tlet projection = this.projection;\n\t\tlet view = this.view;\n\t\tlet projectionView = this.projectionView;\n\t\tlet inverseProjectionView = this.inverseProjectionView;\n\t\tlet zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight;\n\t\tprojection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2),\n\t\t\tzoom * (-viewportHeight / 2), zoom * (viewportHeight / 2),\n\t\t\tthis.near, this.far);\n\t\tview.lookAt(this.position, this.direction, this.up);\n\t\tprojectionView.set(projection.values);\n\t\tprojectionView.multiply(view);\n\t\tinverseProjectionView.set(projectionView.values).invert();\n\t}\n\n\tscreenToWorld (screenCoords: Vector3, screenWidth: number, screenHeight: number) {\n\t\tlet x = screenCoords.x, y = screenHeight - screenCoords.y - 1;\n\t\tscreenCoords.x = (2 * x) / screenWidth - 1;\n\t\tscreenCoords.y = (2 * y) / screenHeight - 1;\n\t\tscreenCoords.z = (2 * screenCoords.z) - 1;\n\t\tscreenCoords.project(this.inverseProjectionView);\n\t\treturn screenCoords;\n\t}\n\n\tworldToScreen (worldCoords: Vector3, screenWidth: number, screenHeight: number) {\n\t\tworldCoords.project(this.projectionView);\n\t\tworldCoords.x = screenWidth * (worldCoords.x + 1) / 2;\n\t\tworldCoords.y = screenHeight * (worldCoords.y + 1) / 2;\n\t\tworldCoords.z = (worldCoords.z + 1) / 2;\n\t\treturn worldCoords;\n\t}\n\n\tsetViewport (viewportWidth: number, viewportHeight: number) {\n\t\tthis.viewportWidth = viewportWidth;\n\t\tthis.viewportHeight = viewportHeight;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Input {\n\telement: HTMLElement;\n\tmouseX = 0;\n\tmouseY = 0;\n\tbuttonDown = false;\n\ttouch0: Touch | null = null;\n\ttouch1: Touch | null = null;\n\tinitialPinchDistance = 0;\n\tprivate listeners = new Array();\n\tprivate eventListeners: Array<{ target: any, event: any, func: any }> = [];\n\n\tconstructor (element: HTMLElement) {\n\t\tthis.element = element;\n\t\tthis.setupCallbacks(element);\n\t}\n\n\tprivate setupCallbacks (element: HTMLElement) {\n\t\tlet mouseDown = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\t\t\t\tthis.buttonDown = true;\n\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(this.mouseX, this.mouseY); });\n\n\t\t\t\tdocument.addEventListener(\"mousemove\", mouseMove);\n\t\t\t\tdocument.addEventListener(\"mouseup\", mouseUp);\n\t\t\t}\n\t\t}\n\n\t\tlet mouseMove = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\n\t\t\t\tthis.listeners.map((listener) => {\n\t\t\t\t\tif (this.buttonDown) {\n\t\t\t\t\t\tif (listener.dragged) listener.dragged(this.mouseX, this.mouseY);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (listener.moved) listener.moved(this.mouseX, this.mouseY);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tlet mouseUp = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\t\t\t\tthis.buttonDown = false;\n\t\t\t\tthis.listeners.map((listener) => { if (listener.up) listener.up(this.mouseX, this.mouseY); });\n\n\t\t\t\tdocument.removeEventListener(\"mousemove\", mouseMove);\n\t\t\t\tdocument.removeEventListener(\"mouseup\", mouseUp);\n\t\t\t}\n\t\t}\n\n\t\tlet mouseWheel = (e: WheelEvent) => {\n\t\t\te.preventDefault();\n\t\t\tlet deltaY = e.deltaY;\n\t\t\tif (e.deltaMode == WheelEvent.DOM_DELTA_LINE) deltaY *= 8;\n\t\t\tif (e.deltaMode == WheelEvent.DOM_DELTA_PAGE) deltaY *= 24;\n\t\t\tthis.listeners.map((listener) => { if (listener.wheel) listener.wheel(e.deltaY); });\n\t\t};\n\n\t\telement.addEventListener(\"mousedown\", mouseDown, true);\n\t\telement.addEventListener(\"mousemove\", mouseMove, true);\n\t\telement.addEventListener(\"mouseup\", mouseUp, true);\n\t\telement.addEventListener(\"wheel\", mouseWheel, true);\n\n\n\t\telement.addEventListener(\"touchstart\", (ev: TouchEvent) => {\n\t\t\tif (!this.touch0 || !this.touch1) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet nativeTouch = touches.item(0);\n\t\t\t\tif (!nativeTouch) return;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\t\t\t\tlet touch = new Touch(nativeTouch.identifier, x, y);\n\t\t\t\tthis.mouseX = x;\n\t\t\t\tthis.mouseY = y;\n\t\t\t\tthis.buttonDown = true;\n\n\t\t\t\tif (!this.touch0) {\n\t\t\t\t\tthis.touch0 = touch;\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(touch.x, touch.y) })\n\t\t\t\t} else if (!this.touch1) {\n\t\t\t\t\tthis.touch1 = touch;\n\t\t\t\t\tlet dx = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet dy = this.touch1.x - this.touch0.x;\n\t\t\t\t\tthis.initialPinchDistance = Math.sqrt(dx * dx + dy * dy);\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.zoom) listener.zoom(this.initialPinchDistance, this.initialPinchDistance) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t}, false);\n\n\t\telement.addEventListener(\"touchmove\", (ev: TouchEvent) => {\n\t\t\tif (this.touch0) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\tvar nativeTouch = touches[i];\n\t\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\n\t\t\t\t\tif (this.touch0.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch0.x = this.mouseX = x;\n\t\t\t\t\t\tthis.touch0.y = this.mouseY = y;\n\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.dragged) listener.dragged(x, y) });\n\t\t\t\t\t}\n\t\t\t\t\tif (this.touch1 && this.touch1.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch1.x = this.mouseX = x;\n\t\t\t\t\t\tthis.touch1.y = this.mouseY = y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.touch0 && this.touch1) {\n\t\t\t\t\tlet dx = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet dy = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet distance = Math.sqrt(dx * dx + dy * dy);\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.zoom) listener.zoom(this.initialPinchDistance, distance) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t}, false);\n\n\t\tlet touchEnd = (ev: TouchEvent) => {\n\t\t\tif (this.touch0) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\n\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\tvar nativeTouch = touches[i];\n\t\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\n\t\t\t\t\tif (this.touch0.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch0 = null;\n\t\t\t\t\t\tthis.mouseX = x;\n\t\t\t\t\t\tthis.mouseY = y;\n\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.up) listener.up(x, y) });\n\n\t\t\t\t\t\tif (!this.touch1) {\n\t\t\t\t\t\t\tthis.buttonDown = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.touch0 = this.touch1;\n\t\t\t\t\t\t\tthis.touch1 = null;\n\t\t\t\t\t\t\tthis.mouseX = this.touch0.x;\n\t\t\t\t\t\t\tthis.mouseX = this.touch0.x;\n\t\t\t\t\t\t\tthis.buttonDown = true;\n\t\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(this.touch0!.x, this.touch0!.y) });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.touch1 && this.touch1.identifier) {\n\t\t\t\t\t\tthis.touch1 = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t};\n\t\telement.addEventListener(\"touchend\", touchEnd, false);\n\t\telement.addEventListener(\"touchcancel\", touchEnd);\n\t}\n\n\taddListener (listener: InputListener) {\n\t\tthis.listeners.push(listener);\n\t}\n\n\tremoveListener (listener: InputListener) {\n\t\tlet idx = this.listeners.indexOf(listener);\n\t\tif (idx > -1) {\n\t\t\tthis.listeners.splice(idx, 1);\n\t\t}\n\t}\n}\n\nexport class Touch {\n\tconstructor (public identifier: number, public x: number, public y: number) {\n\t}\n}\n\nexport interface InputListener {\n\tdown?(x: number, y: number): void;\n\tup?(x: number, y: number): void;\n\tmoved?(x: number, y: number): void;\n\tdragged?(x: number, y: number): void;\n\twheel?(delta: number): void;\n\tzoom?(initialDistance: number, distance: number): void;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Input } from \"./Input.js\";\nimport { OrthoCamera } from \"./Camera.js\";\nimport { Vector3 } from \"./Vector3.js\";\n\nexport class CameraController {\n\tconstructor (public canvas: HTMLElement, public camera: OrthoCamera) {\n\t\tlet cameraX = 0, cameraY = 0, cameraZoom = 0;\n\t\tlet mouseX = 0, mouseY = 0;\n\t\tlet lastX = 0, lastY = 0;\n\t\tlet initialZoom = 0;\n\n\t\tnew Input(canvas).addListener({\n\t\t\tdown: (x: number, y: number) => {\n\t\t\t\tcameraX = camera.position.x;\n\t\t\t\tcameraY = camera.position.y;\n\t\t\t\tmouseX = lastX = x;\n\t\t\t\tmouseY = lastY = y;\n\t\t\t\tinitialZoom = camera.zoom;\n\t\t\t},\n\t\t\tdragged: (x: number, y: number) => {\n\t\t\t\tlet deltaX = x - mouseX;\n\t\t\t\tlet deltaY = y - mouseY;\n\t\t\t\tlet originWorld = camera.screenToWorld(new Vector3(0, 0), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\tlet deltaWorld = camera.screenToWorld(new Vector3(deltaX, deltaY), canvas.clientWidth, canvas.clientHeight).sub(originWorld);\n\t\t\t\tcamera.position.set(cameraX - deltaWorld.x, cameraY - deltaWorld.y, 0);\n\t\t\t\tcamera.update();\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t\twheel: (delta: number) => {\n\t\t\t\tlet zoomAmount = delta / 200 * camera.zoom;\n\t\t\t\tlet newZoom = camera.zoom + zoomAmount;\n\t\t\t\tif (newZoom > 0) {\n\t\t\t\t\tlet x = 0, y = 0;\n\t\t\t\t\tif (delta < 0) {\n\t\t\t\t\t\tx = lastX; y = lastY;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet viewCenter = new Vector3(canvas.clientWidth / 2 + 15, canvas.clientHeight / 2);\n\t\t\t\t\t\tlet mouseToCenterX = lastX - viewCenter.x;\n\t\t\t\t\t\tlet mouseToCenterY = canvas.clientHeight - 1 - lastY - viewCenter.y;\n\t\t\t\t\t\tx = viewCenter.x - mouseToCenterX;\n\t\t\t\t\t\ty = canvas.clientHeight - 1 - viewCenter.y + mouseToCenterY;\n\t\t\t\t\t}\n\t\t\t\t\tlet oldDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\t\tcamera.zoom = newZoom;\n\t\t\t\t\tcamera.update();\n\t\t\t\t\tlet newDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\t\tcamera.position.add(oldDistance.sub(newDistance));\n\t\t\t\t\tcamera.update();\n\t\t\t\t}\n\t\t\t},\n\t\t\tzoom: (initialDistance, distance) => {\n\t\t\t\tlet newZoom = initialDistance / distance;\n\t\t\t\tcamera.zoom = initialZoom * newZoom;\n\t\t\t},\n\t\t\tup: (x: number, y: number) => {\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t\tmoved: (x: number, y: number) => {\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t});\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Restorable } from \"@esotericsoftware/spine-core\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class Shader implements Disposable, Restorable {\n\tpublic static MVP_MATRIX = \"u_projTrans\";\n\tpublic static POSITION = \"a_position\";\n\tpublic static COLOR = \"a_color\";\n\tpublic static COLOR2 = \"a_color2\";\n\tpublic static TEXCOORDS = \"a_texCoords\";\n\tpublic static SAMPLER = \"u_texture\";\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate vs: WebGLShader | null = null;\n\tprivate vsSource: string;\n\tprivate fs: WebGLShader | null = null;\n\tprivate fsSource: string;\n\tprivate program: WebGLProgram | null = null;\n\tprivate tmp2x2: Float32Array = new Float32Array(2 * 2);\n\tprivate tmp3x3: Float32Array = new Float32Array(3 * 3);\n\tprivate tmp4x4: Float32Array = new Float32Array(4 * 4);\n\n\tpublic getProgram () { return this.program; }\n\tpublic getVertexShader () { return this.vertexShader; }\n\tpublic getFragmentShader () { return this.fragmentShader; }\n\tpublic getVertexShaderSource () { return this.vsSource; }\n\tpublic getFragmentSource () { return this.fsSource; }\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, private vertexShader: string, private fragmentShader: string) {\n\t\tthis.vsSource = vertexShader;\n\t\tthis.fsSource = fragmentShader;\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.context.addRestorable(this);\n\t\tthis.compile();\n\t}\n\n\tprivate compile () {\n\t\tlet gl = this.context.gl;\n\t\ttry {\n\t\t\tthis.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader);\n\t\t\tif (!this.vs) throw new Error(\"Couldn't compile vertex shader.\");\n\t\t\tthis.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader);\n\t\t\tif (!this.fs) throw new Error(\"Couldn#t compile fragment shader.\");\n\t\t\tthis.program = this.compileProgram(this.vs, this.fs);\n\t\t} catch (e) {\n\t\t\tthis.dispose();\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tprivate compileShader (type: number, source: string) {\n\t\tlet gl = this.context.gl;\n\t\tlet shader = gl.createShader(type);\n\t\tif (!shader) throw new Error(\"Couldn't create shader.\");\n\t\tgl.shaderSource(shader, source);\n\t\tgl.compileShader(shader);\n\t\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\t\tlet error = \"Couldn't compile shader: \" + gl.getShaderInfoLog(shader);\n\t\t\tgl.deleteShader(shader);\n\t\t\tif (!gl.isContextLost()) throw new Error(error);\n\t\t}\n\t\treturn shader;\n\t}\n\n\tprivate compileProgram (vs: WebGLShader, fs: WebGLShader) {\n\t\tlet gl = this.context.gl;\n\t\tlet program = gl.createProgram();\n\t\tif (!program) throw new Error(\"Couldn't compile program.\");\n\t\tgl.attachShader(program, vs);\n\t\tgl.attachShader(program, fs);\n\t\tgl.linkProgram(program);\n\n\t\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\t\tlet error = \"Couldn't compile shader program: \" + gl.getProgramInfoLog(program);\n\t\t\tgl.deleteProgram(program);\n\t\t\tif (!gl.isContextLost()) throw new Error(error);\n\t\t}\n\t\treturn program;\n\t}\n\n\trestore () {\n\t\tthis.compile();\n\t}\n\n\tpublic bind () {\n\t\tthis.context.gl.useProgram(this.program);\n\t}\n\n\tpublic unbind () {\n\t\tthis.context.gl.useProgram(null);\n\t}\n\n\tpublic setUniformi (uniform: string, value: number) {\n\t\tthis.context.gl.uniform1i(this.getUniformLocation(uniform), value);\n\t}\n\n\tpublic setUniformf (uniform: string, value: number) {\n\t\tthis.context.gl.uniform1f(this.getUniformLocation(uniform), value);\n\t}\n\n\tpublic setUniform2f (uniform: string, value: number, value2: number) {\n\t\tthis.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2);\n\t}\n\n\tpublic setUniform3f (uniform: string, value: number, value2: number, value3: number) {\n\t\tthis.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3);\n\t}\n\n\tpublic setUniform4f (uniform: string, value: number, value2: number, value3: number, value4: number) {\n\t\tthis.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4);\n\t}\n\n\tpublic setUniform2x2f (uniform: string, value: ArrayLike) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp2x2.set(value);\n\t\tgl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2);\n\t}\n\n\tpublic setUniform3x3f (uniform: string, value: ArrayLike) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp3x3.set(value);\n\t\tgl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3);\n\t}\n\n\tpublic setUniform4x4f (uniform: string, value: ArrayLike) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp4x4.set(value);\n\t\tgl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4);\n\t}\n\n\tpublic getUniformLocation (uniform: string): WebGLUniformLocation | null {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.program) throw new Error(\"Shader not compiled.\");\n\t\tlet location = gl.getUniformLocation(this.program, uniform);\n\t\tif (!location && !gl.isContextLost()) throw new Error(`Couldn't find location for uniform ${uniform}`);\n\t\treturn location;\n\t}\n\n\tpublic getAttributeLocation (attribute: string): number {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.program) throw new Error(\"Shader not compiled.\");\n\t\tlet location = gl.getAttribLocation(this.program, attribute);\n\t\tif (location == -1 && !gl.isContextLost()) throw new Error(`Couldn't find location for attribute ${attribute}`);\n\t\treturn location;\n\t}\n\n\tpublic dispose () {\n\t\tthis.context.removeRestorable(this);\n\n\t\tlet gl = this.context.gl;\n\t\tif (this.vs) {\n\t\t\tgl.deleteShader(this.vs);\n\t\t\tthis.vs = null;\n\t\t}\n\n\t\tif (this.fs) {\n\t\t\tgl.deleteShader(this.fs);\n\t\t\tthis.fs = null;\n\t\t}\n\n\t\tif (this.program) {\n\t\t\tgl.deleteProgram(this.program);\n\t\t\tthis.program = null;\n\t\t}\n\t}\n\n\tpublic static newColoredTextured (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nattribute vec2 ${Shader.TEXCOORDS};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\n\nvoid main () {\n\tv_color = ${Shader.COLOR};\n\tv_texCoords = ${Shader.TEXCOORDS};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main () {\n\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n\n\tpublic static newTwoColoredTextured (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nattribute vec4 ${Shader.COLOR2};\nattribute vec2 ${Shader.TEXCOORDS};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_light;\nvarying vec4 v_dark;\nvarying vec2 v_texCoords;\n\nvoid main () {\n\tv_light = ${Shader.COLOR};\n\tv_dark = ${Shader.COLOR2};\n\tv_texCoords = ${Shader.TEXCOORDS};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_light;\nvarying LOWP vec4 v_dark;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main () {\n\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\tgl_FragColor.a = texColor.a * v_light.a;\n\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n\n\tpublic static newColored (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_color;\n\nvoid main () {\n\tv_color = ${Shader.COLOR};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_color;\n\nvoid main () {\n\tgl_FragColor = v_color;\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Restorable } from \"@esotericsoftware/spine-core\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\n\nexport class Mesh implements Disposable, Restorable {\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate vertices: Float32Array;\n\tprivate verticesBuffer: WebGLBuffer | null = null;\n\tprivate verticesLength = 0;\n\tprivate dirtyVertices = false;\n\tprivate indices: Uint16Array;\n\tprivate indicesBuffer: WebGLBuffer | null = null;\n\tprivate indicesLength = 0;\n\tprivate dirtyIndices = false;\n\tprivate elementsPerVertex = 0;\n\n\tgetAttributes (): VertexAttribute[] { return this.attributes; }\n\n\tmaxVertices (): number { return this.vertices.length / this.elementsPerVertex; }\n\tnumVertices (): number { return this.verticesLength / this.elementsPerVertex; }\n\tsetVerticesLength (length: number) {\n\t\tthis.dirtyVertices = true;\n\t\tthis.verticesLength = length;\n\t}\n\tgetVertices (): Float32Array { return this.vertices; }\n\n\tmaxIndices (): number { return this.indices.length; }\n\tnumIndices (): number { return this.indicesLength; }\n\tsetIndicesLength (length: number) {\n\t\tthis.dirtyIndices = true;\n\t\tthis.indicesLength = length;\n\t}\n\tgetIndices (): Uint16Array { return this.indices };\n\n\tgetVertexSizeInFloats (): number {\n\t\tlet size = 0;\n\t\tfor (var i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attribute = this.attributes[i];\n\t\t\tsize += attribute.numElements;\n\t\t}\n\t\treturn size;\n\t}\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, private attributes: VertexAttribute[], maxVertices: number, maxIndices: number) {\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.elementsPerVertex = 0;\n\t\tfor (let i = 0; i < attributes.length; i++) {\n\t\t\tthis.elementsPerVertex += attributes[i].numElements;\n\t\t}\n\t\tthis.vertices = new Float32Array(maxVertices * this.elementsPerVertex);\n\t\tthis.indices = new Uint16Array(maxIndices);\n\t\tthis.context.addRestorable(this);\n\t}\n\n\tsetVertices (vertices: Array) {\n\t\tthis.dirtyVertices = true;\n\t\tif (vertices.length > this.vertices.length) throw Error(\"Mesh can't store more than \" + this.maxVertices() + \" vertices\");\n\t\tthis.vertices.set(vertices, 0);\n\t\tthis.verticesLength = vertices.length;\n\t}\n\n\tsetIndices (indices: Array) {\n\t\tthis.dirtyIndices = true;\n\t\tif (indices.length > this.indices.length) throw Error(\"Mesh can't store more than \" + this.maxIndices() + \" indices\");\n\t\tthis.indices.set(indices, 0);\n\t\tthis.indicesLength = indices.length;\n\t}\n\n\tdraw (shader: Shader, primitiveType: number) {\n\t\tthis.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex);\n\t}\n\n\tdrawWithOffset (shader: Shader, primitiveType: number, offset: number, count: number) {\n\t\tlet gl = this.context.gl;\n\t\tif (this.dirtyVertices || this.dirtyIndices) this.update();\n\t\tthis.bind(shader);\n\t\tif (this.indicesLength > 0) {\n\t\t\tgl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2);\n\t\t} else {\n\t\t\tgl.drawArrays(primitiveType, offset, count);\n\t\t}\n\t\tthis.unbind(shader);\n\t}\n\n\tbind (shader: Shader) {\n\t\tlet gl = this.context.gl;\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attrib = this.attributes[i];\n\t\t\tlet location = shader.getAttributeLocation(attrib.name);\n\t\t\tgl.enableVertexAttribArray(location);\n\t\t\tgl.vertexAttribPointer(location, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4);\n\t\t\toffset += attrib.numElements;\n\t\t}\n\t\tif (this.indicesLength > 0) gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n\t}\n\n\tunbind (shader: Shader) {\n\t\tlet gl = this.context.gl;\n\t\tfor (let i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attrib = this.attributes[i];\n\t\t\tlet location = shader.getAttributeLocation(attrib.name);\n\t\t\tgl.disableVertexAttribArray(location);\n\t\t}\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, null);\n\t\tif (this.indicesLength > 0) gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n\t}\n\n\tprivate update () {\n\t\tlet gl = this.context.gl;\n\t\tif (this.dirtyVertices) {\n\t\t\tif (!this.verticesBuffer) {\n\t\t\t\tthis.verticesBuffer = gl.createBuffer();\n\t\t\t}\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\n\t\t\tgl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW);\n\t\t\tthis.dirtyVertices = false;\n\t\t}\n\n\t\tif (this.dirtyIndices) {\n\t\t\tif (!this.indicesBuffer) {\n\t\t\t\tthis.indicesBuffer = gl.createBuffer();\n\t\t\t}\n\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n\t\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW);\n\t\t\tthis.dirtyIndices = false;\n\t\t}\n\t}\n\n\trestore () {\n\t\tthis.verticesBuffer = null;\n\t\tthis.indicesBuffer = null;\n\t\tthis.update();\n\t}\n\n\tdispose () {\n\t\tthis.context.removeRestorable(this);\n\t\tlet gl = this.context.gl;\n\t\tgl.deleteBuffer(this.verticesBuffer);\n\t\tgl.deleteBuffer(this.indicesBuffer);\n\t}\n}\n\nexport class VertexAttribute {\n\tconstructor (public name: string, public type: VertexAttributeType, public numElements: number) { }\n}\n\nexport class Position2Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.POSITION, VertexAttributeType.Float, 2);\n\t}\n}\n\nexport class Position3Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.POSITION, VertexAttributeType.Float, 3);\n\t}\n}\n\nexport class TexCoordAttribute extends VertexAttribute {\n\tconstructor (unit: number = 0) {\n\t\tsuper(Shader.TEXCOORDS + (unit == 0 ? \"\" : unit), VertexAttributeType.Float, 2);\n\t}\n}\n\nexport class ColorAttribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.COLOR, VertexAttributeType.Float, 4);\n\t}\n}\n\nexport class Color2Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.COLOR2, VertexAttributeType.Float, 4);\n\t}\n}\n\nexport enum VertexAttributeType {\n\tFloat\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BlendMode, Disposable } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { Mesh, Position2Attribute, ColorAttribute, TexCoordAttribute, Color2Attribute } from \"./Mesh.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nconst GL_ONE = 1;\nconst GL_ONE_MINUS_SRC_COLOR = 0x0301;\nconst GL_SRC_ALPHA = 0x0302;\nconst GL_ONE_MINUS_SRC_ALPHA = 0x0303;\nconst GL_ONE_MINUS_DST_ALPHA = 0x0305;\nconst GL_DST_COLOR = 0x0306;\n\nexport class PolygonBatcher implements Disposable {\n\tpublic static disableCulling = false;\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate drawCalls = 0;\n\tprivate static globalDrawCalls = 0;\n\tisDrawing = false;\n\tprivate mesh: Mesh;\n\tprivate shader: Shader | null = null;\n\tprivate lastTexture: GLTexture | null = null;\n\tprivate verticesLength = 0;\n\tprivate indicesLength = 0;\n\tprivate srcColorBlend: number;\n\tprivate srcAlphaBlend: number;\n\tprivate dstBlend: number;\n\tprivate cullWasEnabled = false;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint: boolean = true, maxVertices: number = 10920) {\n\t\tif (maxVertices > 10920) throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tlet attributes = twoColorTint ?\n\t\t\t[new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute(), new Color2Attribute()] :\n\t\t\t[new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute()];\n\t\tthis.mesh = new Mesh(context, attributes, maxVertices, maxVertices * 3);\n\t\tlet gl = this.context.gl;\n\t\tthis.srcColorBlend = gl.SRC_ALPHA;\n\t\tthis.srcAlphaBlend = gl.ONE;\n\t\tthis.dstBlend = gl.ONE_MINUS_SRC_ALPHA;\n\t}\n\n\tbegin (shader: Shader) {\n\t\tif (this.isDrawing) throw new Error(\"PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()\");\n\t\tthis.drawCalls = 0;\n\t\tthis.shader = shader;\n\t\tthis.lastTexture = null;\n\t\tthis.isDrawing = true;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.enable(gl.BLEND);\n\t\tgl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend);\n\n\t\tif (PolygonBatcher.disableCulling) {\n\t\t\tthis.cullWasEnabled = gl.isEnabled(gl.CULL_FACE);\n\t\t\tif (this.cullWasEnabled) gl.disable(gl.CULL_FACE);\n\t\t}\n\t}\n\n\tprivate static blendModesGL: { srcRgb: number, srcRgbPma: number, dstRgb: number, srcAlpha: number }[] = [\n\t\t{ srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_DST_COLOR, srcRgbPma: GL_DST_COLOR, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_ONE, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_COLOR, srcAlpha: GL_ONE }\n\t]\n\n\tsetBlendMode (blendMode: BlendMode, premultipliedAlpha: boolean) {\n\t\tconst blendModeGL = PolygonBatcher.blendModesGL[blendMode];\n\t\tconst srcColorBlend = premultipliedAlpha ? blendModeGL.srcRgbPma : blendModeGL.srcRgb;\n\t\tconst srcAlphaBlend = blendModeGL.srcAlpha;\n\t\tconst dstBlend = blendModeGL.dstRgb;\n\n\t\tif (this.srcColorBlend == srcColorBlend && this.srcAlphaBlend == srcAlphaBlend && this.dstBlend == dstBlend) return;\n\t\tthis.srcColorBlend = srcColorBlend;\n\t\tthis.srcAlphaBlend = srcAlphaBlend;\n\t\tthis.dstBlend = dstBlend;\n\t\tif (this.isDrawing) {\n\t\t\tthis.flush();\n\t\t}\n\t\tlet gl = this.context.gl;\n\t\tgl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend);\n\t}\n\n\tdraw (texture: GLTexture, vertices: ArrayLike, indices: Array) {\n\t\tif (texture != this.lastTexture) {\n\t\t\tthis.flush();\n\t\t\tthis.lastTexture = texture;\n\t\t} else if (this.verticesLength + vertices.length > this.mesh.getVertices().length ||\n\t\t\tthis.indicesLength + indices.length > this.mesh.getIndices().length) {\n\t\t\tthis.flush();\n\t\t}\n\n\t\tlet indexStart = this.mesh.numVertices();\n\t\tthis.mesh.getVertices().set(vertices, this.verticesLength);\n\t\tthis.verticesLength += vertices.length;\n\t\tthis.mesh.setVerticesLength(this.verticesLength)\n\n\t\tlet indicesArray = this.mesh.getIndices();\n\t\tfor (let i = this.indicesLength, j = 0; j < indices.length; i++, j++)\n\t\t\tindicesArray[i] = indices[j] + indexStart;\n\t\tthis.indicesLength += indices.length;\n\t\tthis.mesh.setIndicesLength(this.indicesLength);\n\t}\n\n\tflush () {\n\t\tif (this.verticesLength == 0) return;\n\t\tif (!this.lastTexture) throw new Error(\"No texture set.\");\n\t\tif (!this.shader) throw new Error(\"No shader set.\");\n\t\tthis.lastTexture.bind();\n\t\tthis.mesh.draw(this.shader, this.context.gl.TRIANGLES);\n\n\t\tthis.verticesLength = 0;\n\t\tthis.indicesLength = 0;\n\t\tthis.mesh.setVerticesLength(0);\n\t\tthis.mesh.setIndicesLength(0);\n\t\tthis.drawCalls++;\n\t\tPolygonBatcher.globalDrawCalls++;\n\t}\n\n\tend () {\n\t\tif (!this.isDrawing) throw new Error(\"PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()\");\n\t\tif (this.verticesLength > 0 || this.indicesLength > 0) this.flush();\n\t\tthis.shader = null;\n\t\tthis.lastTexture = null;\n\t\tthis.isDrawing = false;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.disable(gl.BLEND);\n\t\tif (PolygonBatcher.disableCulling) {\n\t\t\tif (this.cullWasEnabled) gl.enable(gl.CULL_FACE);\n\t\t}\n\t}\n\n\tgetDrawCalls () {\n\t\treturn this.drawCalls;\n\t}\n\n\tstatic getAndResetGlobalDrawCalls () {\n\t\tlet result = PolygonBatcher.globalDrawCalls;\n\t\tPolygonBatcher.globalDrawCalls = 0;\n\t\treturn result;\n\t}\n\n\tdispose () {\n\t\tthis.mesh.dispose();\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Color, Vector2, MathUtils } from \"@esotericsoftware/spine-core\";\nimport { Mesh, Position2Attribute, ColorAttribute } from \"./Mesh.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class ShapeRenderer implements Disposable {\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate isDrawing = false;\n\tprivate mesh: Mesh;\n\tprivate shapeType = ShapeType.Filled;\n\tprivate color = new Color(1, 1, 1, 1);\n\tprivate shader: Shader | null = null;\n\tprivate vertexIndex = 0;\n\tprivate tmp = new Vector2();\n\tprivate srcColorBlend: number;\n\tprivate srcAlphaBlend: number;\n\tprivate dstBlend: number;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, maxVertices: number = 10920) {\n\t\tif (maxVertices > 10920) throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.mesh = new Mesh(context, [new Position2Attribute(), new ColorAttribute()], maxVertices, 0);\n\t\tlet gl = this.context.gl;\n\t\tthis.srcColorBlend = gl.SRC_ALPHA;\n\t\tthis.srcAlphaBlend = gl.ONE;\n\t\tthis.dstBlend = gl.ONE_MINUS_SRC_ALPHA;\n\t}\n\n\tbegin (shader: Shader) {\n\t\tif (this.isDrawing) throw new Error(\"ShapeRenderer.begin() has already been called\");\n\t\tthis.shader = shader;\n\t\tthis.vertexIndex = 0;\n\t\tthis.isDrawing = true;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.enable(gl.BLEND);\n\t\tgl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend);\n\t}\n\n\tsetBlendMode (srcColorBlend: number, srcAlphaBlend: number, dstBlend: number) {\n\t\tthis.srcColorBlend = srcColorBlend;\n\t\tthis.srcAlphaBlend = srcAlphaBlend;\n\t\tthis.dstBlend = dstBlend;\n\t\tif (this.isDrawing) {\n\t\t\tthis.flush();\n\t\t\tlet gl = this.context.gl;\n\t\t\tgl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend);\n\t\t}\n\t}\n\n\tsetColor (color: Color) {\n\t\tthis.color.setFromColor(color);\n\t}\n\n\tsetColorWith (r: number, g: number, b: number, a: number) {\n\t\tthis.color.set(r, g, b, a);\n\t}\n\n\tpoint (x: number, y: number, color?: Color) {\n\t\tthis.check(ShapeType.Point, 1);\n\t\tif (!color) color = this.color;\n\t\tthis.vertex(x, y, color);\n\t}\n\n\tline (x: number, y: number, x2: number, y2: number, color?: Color) {\n\t\tthis.check(ShapeType.Line, 2);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tthis.vertex(x, y, color);\n\t\tthis.vertex(x2, y2, color);\n\t}\n\n\ttriangle (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tif (!color2) color2 = this.color;\n\t\tif (!color3) color3 = this.color;\n\t\tif (filled) {\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x2, y2, color2);\n\t\t\tthis.vertex(x3, y3, color3);\n\t\t} else {\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x2, y2, color2);\n\n\t\t\tthis.vertex(x2, y2, color);\n\t\t\tthis.vertex(x3, y3, color2);\n\n\t\t\tthis.vertex(x3, y3, color);\n\t\t\tthis.vertex(x, y, color2);\n\t\t}\n\t}\n\n\tquad (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tif (!color2) color2 = this.color;\n\t\tif (!color3) color3 = this.color;\n\t\tif (!color4) color4 = this.color;\n\t\tif (filled) {\n\t\t\tthis.vertex(x, y, color); this.vertex(x2, y2, color2); this.vertex(x3, y3, color3);\n\t\t\tthis.vertex(x3, y3, color3); this.vertex(x4, y4, color4); this.vertex(x, y, color);\n\t\t} else {\n\t\t\tthis.vertex(x, y, color); this.vertex(x2, y2, color2);\n\t\t\tthis.vertex(x2, y2, color2); this.vertex(x3, y3, color3);\n\t\t\tthis.vertex(x3, y3, color3); this.vertex(x4, y4, color4);\n\t\t\tthis.vertex(x4, y4, color4); this.vertex(x, y, color);\n\t\t}\n\t}\n\n\trect (filled: boolean, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color);\n\t}\n\n\trectLine (filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 8);\n\t\tif (!color) color = this.color;\n\t\tlet t = this.tmp.set(y2 - y1, x1 - x2);\n\t\tt.normalize();\n\t\twidth *= 0.5;\n\t\tlet tx = t.x * width;\n\t\tlet ty = t.y * width;\n\t\tif (!filled) {\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t} else {\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t}\n\t}\n\n\tx (x: number, y: number, size: number) {\n\t\tthis.line(x - size, y - size, x + size, y + size);\n\t\tthis.line(x - size, y + size, x + size, y - size);\n\t}\n\n\tpolygon (polygonVertices: ArrayLike, offset: number, count: number, color?: Color) {\n\t\tif (count < 3) throw new Error(\"Polygon must contain at least 3 vertices\");\n\t\tthis.check(ShapeType.Line, count * 2);\n\t\tif (!color) color = this.color;\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\n\t\toffset <<= 1;\n\t\tcount <<= 1;\n\n\t\tlet firstX = polygonVertices[offset];\n\t\tlet firstY = polygonVertices[offset + 1];\n\t\tlet last = offset + count;\n\n\t\tfor (let i = offset, n = offset + count - 2; i < n; i += 2) {\n\t\t\tlet x1 = polygonVertices[i];\n\t\t\tlet y1 = polygonVertices[i + 1];\n\n\t\t\tlet x2 = 0;\n\t\t\tlet y2 = 0;\n\n\t\t\tif (i + 2 >= last) {\n\t\t\t\tx2 = firstX;\n\t\t\t\ty2 = firstY;\n\t\t\t} else {\n\t\t\t\tx2 = polygonVertices[i + 2];\n\t\t\t\ty2 = polygonVertices[i + 3];\n\t\t\t}\n\n\t\t\tthis.vertex(x1, y1, color!);\n\t\t\tthis.vertex(x2, y2, color!);\n\t\t}\n\t}\n\n\tcircle (filled: boolean, x: number, y: number, radius: number, color?: Color, segments: number = 0) {\n\t\tif (segments == 0) segments = Math.max(1, (6 * MathUtils.cbrt(radius)) | 0);\n\t\tif (segments <= 0) throw new Error(\"segments must be > 0.\");\n\t\tif (!color) color = this.color;\n\t\tlet angle = 2 * MathUtils.PI / segments;\n\t\tlet cos = Math.cos(angle);\n\t\tlet sin = Math.sin(angle);\n\t\tlet cx = radius, cy = 0;\n\t\tif (!filled) {\n\t\t\tthis.check(ShapeType.Line, segments * 2 + 2);\n\t\t\tfor (let i = 0; i < segments; i++) {\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t\tlet temp = cx;\n\t\t\t\tcx = cos * cx - sin * cy;\n\t\t\t\tcy = sin * temp + cos * cy;\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t}\n\t\t\t// Ensure the last segment is identical to the first.\n\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t} else {\n\t\t\tthis.check(ShapeType.Filled, segments * 3 + 3);\n\t\t\tsegments--;\n\t\t\tfor (let i = 0; i < segments; i++) {\n\t\t\t\tthis.vertex(x, y, color);\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t\tlet temp = cx;\n\t\t\t\tcx = cos * cx - sin * cy;\n\t\t\t\tcy = sin * temp + cos * cy;\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t}\n\t\t\t// Ensure the last segment is identical to the first.\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t}\n\n\t\tlet temp = cx;\n\t\tcx = radius;\n\t\tcy = 0;\n\t\tthis.vertex(x + cx, y + cy, color);\n\t}\n\n\tcurve (x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color) {\n\t\tthis.check(ShapeType.Line, segments * 2 + 2);\n\t\tif (!color) color = this.color;\n\n\t\t// Algorithm from: http://www.antigrain.com/research/bezier_interpolation/index.html#PAGE_BEZIER_INTERPOLATION\n\t\tlet subdiv_step = 1 / segments;\n\t\tlet subdiv_step2 = subdiv_step * subdiv_step;\n\t\tlet subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;\n\n\t\tlet pre1 = 3 * subdiv_step;\n\t\tlet pre2 = 3 * subdiv_step2;\n\t\tlet pre4 = 6 * subdiv_step2;\n\t\tlet pre5 = 6 * subdiv_step3;\n\n\t\tlet tmp1x = x1 - cx1 * 2 + cx2;\n\t\tlet tmp1y = y1 - cy1 * 2 + cy2;\n\n\t\tlet tmp2x = (cx1 - cx2) * 3 - x1 + x2;\n\t\tlet tmp2y = (cy1 - cy2) * 3 - y1 + y2;\n\n\t\tlet fx = x1;\n\t\tlet fy = y1;\n\n\t\tlet dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\n\t\tlet dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\n\n\t\tlet ddfx = tmp1x * pre4 + tmp2x * pre5;\n\t\tlet ddfy = tmp1y * pre4 + tmp2y * pre5;\n\n\t\tlet dddfx = tmp2x * pre5;\n\t\tlet dddfy = tmp2y * pre5;\n\n\t\twhile (segments-- > 0) {\n\t\t\tthis.vertex(fx, fy, color!);\n\t\t\tfx += dfx;\n\t\t\tfy += dfy;\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tddfx += dddfx;\n\t\t\tddfy += dddfy;\n\t\t\tthis.vertex(fx, fy, color!);\n\t\t}\n\t\tthis.vertex(fx, fy, color!);\n\t\tthis.vertex(x2, y2, color!);\n\t}\n\n\tprivate vertex (x: number, y: number, color: Color) {\n\t\tlet idx = this.vertexIndex;\n\t\tlet vertices = this.mesh.getVertices();\n\t\tvertices[idx++] = x;\n\t\tvertices[idx++] = y;\n\t\tvertices[idx++] = color.r;\n\t\tvertices[idx++] = color.g;\n\t\tvertices[idx++] = color.b;\n\t\tvertices[idx++] = color.a;\n\t\tthis.vertexIndex = idx;\n\t}\n\n\tend () {\n\t\tif (!this.isDrawing) throw new Error(\"ShapeRenderer.begin() has not been called\");\n\t\tthis.flush();\n\t\tlet gl = this.context.gl;\n\t\tgl.disable(gl.BLEND);\n\t\tthis.isDrawing = false;\n\t}\n\n\tprivate flush () {\n\t\tif (this.vertexIndex == 0) return;\n\t\tif (!this.shader) throw new Error(\"No shader set.\");\n\t\tthis.mesh.setVerticesLength(this.vertexIndex);\n\t\tthis.mesh.draw(this.shader, this.shapeType);\n\t\tthis.vertexIndex = 0;\n\t}\n\n\tprivate check (shapeType: ShapeType, numVertices: number) {\n\t\tif (!this.isDrawing) throw new Error(\"ShapeRenderer.begin() has not been called\");\n\t\tif (this.shapeType == shapeType) {\n\t\t\tif (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) this.flush();\n\t\t\telse return;\n\t\t} else {\n\t\t\tthis.flush();\n\t\t\tthis.shapeType = shapeType;\n\t\t}\n\t}\n\n\tdispose () {\n\t\tthis.mesh.dispose();\n\t}\n}\n\nexport enum ShapeType {\n\tPoint = 0x0000,\n\tLine = 0x0001,\n\tFilled = 0x0004\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Color, SkeletonBounds, Utils, Skeleton, RegionAttachment, MeshAttachment, PathAttachment, ClippingAttachment } from \"@esotericsoftware/spine-core\";\nimport { ShapeRenderer } from \"./ShapeRenderer.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class SkeletonDebugRenderer implements Disposable {\n\tboneLineColor = new Color(1, 0, 0, 1);\n\tboneOriginColor = new Color(0, 1, 0, 1);\n\tattachmentLineColor = new Color(0, 0, 1, 0.5);\n\ttriangleLineColor = new Color(1, 0.64, 0, 0.5);\n\tpathColor = new Color().setFromString(\"FF7F00\");\n\tclipColor = new Color(0.8, 0, 0, 2);\n\taabbColor = new Color(0, 1, 0, 0.5);\n\tdrawBones = true;\n\tdrawRegionAttachments = true;\n\tdrawBoundingBoxes = true;\n\tdrawMeshHull = true;\n\tdrawMeshTriangles = true;\n\tdrawPaths = true;\n\tdrawSkeletonXY = false;\n\tdrawClipping = true;\n\tpremultipliedAlpha = false;\n\tscale = 1;\n\tboneWidth = 2;\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate bounds = new SkeletonBounds();\n\tprivate temp = new Array();\n\tprivate vertices = Utils.newFloatArray(2 * 1024);\n\tprivate static LIGHT_GRAY = new Color(192 / 255, 192 / 255, 192 / 255, 1);\n\tprivate static GREEN = new Color(0, 1, 0, 1);\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext) {\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t}\n\n\tdraw (shapes: ShapeRenderer, skeleton: Skeleton, ignoredBones?: Array) {\n\t\tlet skeletonX = skeleton.x;\n\t\tlet skeletonY = skeleton.y;\n\t\tlet gl = this.context.gl;\n\t\tlet srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA;\n\t\tshapes.setBlendMode(srcFunc, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n\t\tlet bones = skeleton.bones;\n\t\tif (this.drawBones) {\n\t\t\tshapes.setColor(this.boneLineColor);\n\t\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\t\tlet bone = bones[i];\n\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;\n\t\t\t\tif (!bone.parent) continue;\n\t\t\t\tlet x = bone.data.length * bone.a + bone.worldX;\n\t\t\t\tlet y = bone.data.length * bone.c + bone.worldY;\n\t\t\t\tshapes.rectLine(true, bone.worldX, bone.worldY, x, y, this.boneWidth * this.scale);\n\t\t\t}\n\t\t\tif (this.drawSkeletonXY) shapes.x(skeletonX, skeletonY, 4 * this.scale);\n\t\t}\n\n\t\tif (this.drawRegionAttachments) {\n\t\t\tshapes.setColor(this.attachmentLineColor);\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\t\tlet regionAttachment = attachment;\n\t\t\t\t\tlet vertices = this.vertices;\n\t\t\t\t\tregionAttachment.computeWorldVertices(slot, vertices, 0, 2);\n\t\t\t\t\tshapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);\n\t\t\t\t\tshapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);\n\t\t\t\t\tshapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);\n\t\t\t\t\tshapes.line(vertices[6], vertices[7], vertices[0], vertices[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawMeshHull || this.drawMeshTriangles) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof MeshAttachment)) continue;\n\t\t\t\tlet mesh = attachment;\n\t\t\t\tlet vertices = this.vertices;\n\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2);\n\t\t\t\tlet triangles = mesh.triangles;\n\t\t\t\tlet hullLength = mesh.hullLength;\n\t\t\t\tif (this.drawMeshTriangles) {\n\t\t\t\t\tshapes.setColor(this.triangleLineColor);\n\t\t\t\t\tfor (let ii = 0, nn = triangles.length; ii < nn; ii += 3) {\n\t\t\t\t\t\tlet v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;\n\t\t\t\t\t\tshapes.triangle(false, vertices[v1], vertices[v1 + 1], //\n\t\t\t\t\t\t\tvertices[v2], vertices[v2 + 1], //\n\t\t\t\t\t\t\tvertices[v3], vertices[v3 + 1] //\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.drawMeshHull && hullLength > 0) {\n\t\t\t\t\tshapes.setColor(this.attachmentLineColor);\n\t\t\t\t\thullLength = (hullLength >> 1) * 2;\n\t\t\t\t\tlet lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\n\t\t\t\t\tfor (let ii = 0, nn = hullLength; ii < nn; ii += 2) {\n\t\t\t\t\t\tlet x = vertices[ii], y = vertices[ii + 1];\n\t\t\t\t\t\tshapes.line(x, y, lastX, lastY);\n\t\t\t\t\t\tlastX = x;\n\t\t\t\t\t\tlastY = y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawBoundingBoxes) {\n\t\t\tlet bounds = this.bounds;\n\t\t\tbounds.update(skeleton, true);\n\t\t\tshapes.setColor(this.aabbColor);\n\t\t\tshapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\n\t\t\tlet polygons = bounds.polygons;\n\t\t\tlet boxes = bounds.boundingBoxes;\n\t\t\tfor (let i = 0, n = polygons.length; i < n; i++) {\n\t\t\t\tlet polygon = polygons[i];\n\t\t\t\tshapes.setColor(boxes[i].color);\n\t\t\t\tshapes.polygon(polygon, 0, polygon.length);\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawPaths) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof PathAttachment)) continue;\n\t\t\t\tlet path = attachment;\n\t\t\t\tlet nn = path.worldVerticesLength;\n\t\t\t\tlet world = this.temp = Utils.setArraySize(this.temp, nn, 0);\n\t\t\t\tpath.computeWorldVertices(slot, 0, nn, world, 0, 2);\n\t\t\t\tlet color = this.pathColor;\n\t\t\t\tlet x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\n\t\t\t\tif (path.closed) {\n\t\t\t\t\tshapes.setColor(color);\n\t\t\t\t\tlet cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\n\t\t\t\t\tx2 = world[nn - 4];\n\t\t\t\t\ty2 = world[nn - 3];\n\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\n\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\n\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\n\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\n\t\t\t\t}\n\t\t\t\tnn -= 4;\n\t\t\t\tfor (let ii = 4; ii < nn; ii += 6) {\n\t\t\t\t\tlet cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\n\t\t\t\t\tx2 = world[ii + 4];\n\t\t\t\t\ty2 = world[ii + 5];\n\t\t\t\t\tshapes.setColor(color);\n\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\n\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\n\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\n\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\n\t\t\t\t\tx1 = x2;\n\t\t\t\t\ty1 = y2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawBones) {\n\t\t\tshapes.setColor(this.boneOriginColor);\n\t\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\t\tlet bone = bones[i];\n\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;\n\t\t\t\tshapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, this.boneOriginColor, 8);\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawClipping) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tshapes.setColor(this.clipColor)\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof ClippingAttachment)) continue;\n\t\t\t\tlet clip = attachment;\n\t\t\t\tlet nn = clip.worldVerticesLength;\n\t\t\t\tlet world = this.temp = Utils.setArraySize(this.temp, nn, 0);\n\t\t\t\tclip.computeWorldVertices(slot, 0, nn, world, 0, 2);\n\t\t\t\tfor (let i = 0, n = world.length; i < n; i += 2) {\n\t\t\t\t\tlet x = world[i];\n\t\t\t\t\tlet y = world[i + 1];\n\t\t\t\t\tlet x2 = world[(i + 2) % world.length];\n\t\t\t\t\tlet y2 = world[(i + 3) % world.length];\n\t\t\t\t\tshapes.line(x, y, x2, y2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose () {\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { NumberArrayLike, Color, SkeletonClipping, Vector2, Utils, Skeleton, BlendMode, RegionAttachment, TextureAtlasRegion, MeshAttachment, ClippingAttachment } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { PolygonBatcher } from \"./PolygonBatcher.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\n\nclass Renderable {\n\tconstructor (public vertices: NumberArrayLike, public numVertices: number, public numFloats: number) { }\n};\n\nexport type VertexTransformer = (vertices: NumberArrayLike, numVertices: number, stride: number) => void;\n\nexport class SkeletonRenderer {\n\tstatic QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n\n\tpremultipliedAlpha = false;\n\tprivate tempColor = new Color();\n\tprivate tempColor2 = new Color();\n\tprivate vertices: NumberArrayLike;\n\tprivate vertexSize = 2 + 2 + 4;\n\tprivate twoColorTint = false;\n\tprivate renderable: Renderable = new Renderable([], 0, 0);\n\tprivate clipper: SkeletonClipping = new SkeletonClipping();\n\tprivate temp = new Vector2();\n\tprivate temp2 = new Vector2();\n\tprivate temp3 = new Color();\n\tprivate temp4 = new Color();\n\n\tconstructor (context: ManagedWebGLRenderingContext, twoColorTint: boolean = true) {\n\t\tthis.twoColorTint = twoColorTint;\n\t\tif (twoColorTint)\n\t\t\tthis.vertexSize += 4;\n\t\tthis.vertices = Utils.newFloatArray(this.vertexSize * 1024);\n\t}\n\n\tdraw (batcher: PolygonBatcher, skeleton: Skeleton, slotRangeStart: number = -1, slotRangeEnd: number = -1, transformer: VertexTransformer | null = null) {\n\t\tlet clipper = this.clipper;\n\t\tlet premultipliedAlpha = this.premultipliedAlpha;\n\t\tlet twoColorTint = this.twoColorTint;\n\t\tlet blendMode: BlendMode | null = null;\n\n\t\tlet renderable: Renderable = this.renderable;\n\t\tlet uvs: NumberArrayLike;\n\t\tlet triangles: Array;\n\t\tlet drawOrder = skeleton.drawOrder;\n\t\tlet attachmentColor: Color;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet vertexSize = twoColorTint ? 12 : 8;\n\t\tlet inRange = false;\n\t\tif (slotRangeStart == -1) inRange = true;\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet clippedVertexSize = clipper.isClipping() ? 2 : vertexSize;\n\t\t\tlet slot = drawOrder[i];\n\t\t\tif (!slot.bone.active) {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (slotRangeStart >= 0 && slotRangeStart == slot.data.index) {\n\t\t\t\tinRange = true;\n\t\t\t}\n\n\t\t\tif (!inRange) {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) {\n\t\t\t\tinRange = false;\n\t\t\t}\n\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tlet texture: GLTexture;\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tlet region = attachment;\n\t\t\t\trenderable.vertices = this.vertices;\n\t\t\t\trenderable.numVertices = 4;\n\t\t\t\trenderable.numFloats = clippedVertexSize << 2;\n\t\t\t\tregion.computeWorldVertices(slot, renderable.vertices, 0, clippedVertexSize);\n\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\n\t\t\t\tuvs = region.uvs;\n\t\t\t\ttexture = region.region!.texture;\n\t\t\t\tattachmentColor = region.color;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = attachment;\n\t\t\t\trenderable.vertices = this.vertices;\n\t\t\t\trenderable.numVertices = (mesh.worldVerticesLength >> 1);\n\t\t\t\trenderable.numFloats = renderable.numVertices * clippedVertexSize;\n\t\t\t\tif (renderable.numFloats > renderable.vertices.length) {\n\t\t\t\t\trenderable.vertices = this.vertices = Utils.newFloatArray(renderable.numFloats);\n\t\t\t\t}\n\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t\ttexture = mesh.region!.texture;\n\t\t\t\tuvs = mesh.uvs;\n\t\t\t\tattachmentColor = mesh.color;\n\t\t\t} else if (attachment instanceof ClippingAttachment) {\n\t\t\t\tlet clip = (attachment);\n\t\t\t\tclipper.clipStart(slot, clip);\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (texture) {\n\t\t\t\tlet slotColor = slot.color;\n\t\t\t\tlet finalColor = this.tempColor;\n\t\t\t\tfinalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;\n\t\t\t\tfinalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;\n\t\t\t\tfinalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;\n\t\t\t\tfinalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;\n\t\t\t\tif (premultipliedAlpha) {\n\t\t\t\t\tfinalColor.r *= finalColor.a;\n\t\t\t\t\tfinalColor.g *= finalColor.a;\n\t\t\t\t\tfinalColor.b *= finalColor.a;\n\t\t\t\t}\n\t\t\t\tlet darkColor = this.tempColor2;\n\t\t\t\tif (!slot.darkColor)\n\t\t\t\t\tdarkColor.set(0, 0, 0, 1.0);\n\t\t\t\telse {\n\t\t\t\t\tif (premultipliedAlpha) {\n\t\t\t\t\t\tdarkColor.r = slot.darkColor.r * finalColor.a;\n\t\t\t\t\t\tdarkColor.g = slot.darkColor.g * finalColor.a;\n\t\t\t\t\t\tdarkColor.b = slot.darkColor.b * finalColor.a;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdarkColor.setFromColor(slot.darkColor);\n\t\t\t\t\t}\n\t\t\t\t\tdarkColor.a = premultipliedAlpha ? 1.0 : 0.0;\n\t\t\t\t}\n\n\t\t\t\tlet slotBlendMode = slot.data.blendMode;\n\t\t\t\tif (slotBlendMode != blendMode) {\n\t\t\t\t\tblendMode = slotBlendMode;\n\t\t\t\t\tbatcher.setBlendMode(blendMode, premultipliedAlpha);\n\t\t\t\t}\n\n\t\t\t\tif (clipper.isClipping()) {\n\t\t\t\t\tclipper.clipTriangles(renderable.vertices, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint);\n\t\t\t\t\tlet clippedVertices = new Float32Array(clipper.clippedVertices);\n\t\t\t\t\tlet clippedTriangles = clipper.clippedTriangles;\n\t\t\t\t\tif (transformer) transformer(clippedVertices, clippedVertices.length, vertexSize);\n\t\t\t\t\tbatcher.draw(texture, clippedVertices, clippedTriangles);\n\t\t\t\t} else {\n\t\t\t\t\tlet verts = renderable.vertices;\n\t\t\t\t\tif (!twoColorTint) {\n\t\t\t\t\t\tfor (let v = 2, u = 0, n = renderable.numFloats; v < n; v += vertexSize, u += 2) {\n\t\t\t\t\t\t\tverts[v] = finalColor.r;\n\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\n\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\n\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\n\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\n\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (let v = 2, u = 0, n = renderable.numFloats; v < n; v += vertexSize, u += 2) {\n\t\t\t\t\t\t\tverts[v] = finalColor.r;\n\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\n\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\n\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\n\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\n\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\n\t\t\t\t\t\t\tverts[v + 6] = darkColor.r;\n\t\t\t\t\t\t\tverts[v + 7] = darkColor.g;\n\t\t\t\t\t\t\tverts[v + 8] = darkColor.b;\n\t\t\t\t\t\t\tverts[v + 9] = darkColor.a;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet view = (renderable.vertices as Float32Array).subarray(0, renderable.numFloats);\n\t\t\t\t\tif (transformer) transformer(renderable.vertices, renderable.numFloats, vertexSize);\n\t\t\t\t\tbatcher.draw(texture, view, triangles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclipper.clipEndWithSlot(slot);\n\t\t}\n\t\tclipper.clipEnd();\n\t}\n\n\t/** Returns the {@link SkeletonClipping} used by this renderer for use with e.g. {@link Skeleton.getBounds} **/\n\tpublic getSkeletonClipping (): SkeletonClipping {\n\t\treturn this.clipper;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color, Disposable, Skeleton, MathUtils, TextureAtlasRegion } from \"@esotericsoftware/spine-core\";\nimport { OrthoCamera } from \"./Camera.js\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { PolygonBatcher } from \"./PolygonBatcher.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ShapeRenderer } from \"./ShapeRenderer.js\";\nimport { SkeletonDebugRenderer } from \"./SkeletonDebugRenderer.js\";\nimport { SkeletonRenderer, VertexTransformer } from \"./SkeletonRenderer.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n;\n\nconst quad = [\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n];\nconst QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\nconst WHITE = new Color(1, 1, 1, 1);\n\nexport class SceneRenderer implements Disposable {\n\tcontext: ManagedWebGLRenderingContext;\n\tcanvas: HTMLCanvasElement;\n\tcamera: OrthoCamera;\n\tbatcher: PolygonBatcher;\n\tprivate twoColorTint = false;\n\tprivate batcherShader: Shader;\n\tprivate shapes: ShapeRenderer;\n\tprivate shapesShader: Shader;\n\tprivate activeRenderer: PolygonBatcher | ShapeRenderer | SkeletonDebugRenderer | null = null;\n\tskeletonRenderer: SkeletonRenderer;\n\tskeletonDebugRenderer: SkeletonDebugRenderer;\n\n\tconstructor (canvas: HTMLCanvasElement, context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint: boolean = true) {\n\t\tthis.canvas = canvas;\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.twoColorTint = twoColorTint;\n\t\tthis.camera = new OrthoCamera(canvas.width, canvas.height);\n\t\tthis.batcherShader = twoColorTint ? Shader.newTwoColoredTextured(this.context) : Shader.newColoredTextured(this.context);\n\t\tthis.batcher = new PolygonBatcher(this.context, twoColorTint);\n\t\tthis.shapesShader = Shader.newColored(this.context);\n\t\tthis.shapes = new ShapeRenderer(this.context);\n\t\tthis.skeletonRenderer = new SkeletonRenderer(this.context, twoColorTint);\n\t\tthis.skeletonDebugRenderer = new SkeletonDebugRenderer(this.context);\n\t}\n\n\tdispose () {\n\t\tthis.batcher.dispose();\n\t\tthis.batcherShader.dispose();\n\t\tthis.shapes.dispose();\n\t\tthis.shapesShader.dispose();\n\t\tthis.skeletonDebugRenderer.dispose();\n\t}\n\n\tbegin () {\n\t\tthis.camera.update();\n\t\tthis.enableRenderer(this.batcher);\n\t}\n\n\tdrawSkeleton (skeleton: Skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform: VertexTransformer | null = null) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tthis.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;\n\t\tthis.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd, transform);\n\t}\n\n\tdrawSkeletonDebug (skeleton: Skeleton, premultipliedAlpha = false, ignoredBones?: Array) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha;\n\t\tthis.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones);\n\t}\n\n\tdrawTexture (texture: GLTexture, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawTextureUV (texture: GLTexture, x: number, y: number, width: number, height: number, u: number, v: number, u2: number, v2: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u;\n\t\tquad[i++] = v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u2;\n\t\tquad[i++] = v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u2;\n\t\tquad[i++] = v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u;\n\t\tquad[i++] = v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawTextureRotated (texture: GLTexture, x: number, y: number, width: number, height: number, pivotX: number, pivotY: number, angle: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\n\t\t// bottom left and top right corner points relative to origin\n\t\tlet worldOriginX = x + pivotX;\n\t\tlet worldOriginY = y + pivotY;\n\t\tlet fx = -pivotX;\n\t\tlet fy = -pivotY;\n\t\tlet fx2 = width - pivotX;\n\t\tlet fy2 = height - pivotY;\n\n\t\t// construct corner points, start from top left and go counter clockwise\n\t\tlet p1x = fx;\n\t\tlet p1y = fy;\n\t\tlet p2x = fx;\n\t\tlet p2y = fy2;\n\t\tlet p3x = fx2;\n\t\tlet p3y = fy2;\n\t\tlet p4x = fx2;\n\t\tlet p4y = fy;\n\n\t\tlet x1 = 0;\n\t\tlet y1 = 0;\n\t\tlet x2 = 0;\n\t\tlet y2 = 0;\n\t\tlet x3 = 0;\n\t\tlet y3 = 0;\n\t\tlet x4 = 0;\n\t\tlet y4 = 0;\n\n\t\t// rotate\n\t\tif (angle != 0) {\n\t\t\tlet cos = MathUtils.cosDeg(angle);\n\t\t\tlet sin = MathUtils.sinDeg(angle);\n\n\t\t\tx1 = cos * p1x - sin * p1y;\n\t\t\ty1 = sin * p1x + cos * p1y;\n\n\t\t\tx4 = cos * p2x - sin * p2y;\n\t\t\ty4 = sin * p2x + cos * p2y;\n\n\t\t\tx3 = cos * p3x - sin * p3y;\n\t\t\ty3 = sin * p3x + cos * p3y;\n\n\t\t\tx2 = x3 + (x1 - x4);\n\t\t\ty2 = y3 + (y1 - y4);\n\t\t} else {\n\t\t\tx1 = p1x;\n\t\t\ty1 = p1y;\n\n\t\t\tx4 = p2x;\n\t\t\ty4 = p2y;\n\n\t\t\tx3 = p3x;\n\t\t\ty3 = p3y;\n\n\t\t\tx2 = p4x;\n\t\t\ty2 = p4y;\n\t\t}\n\n\t\tx1 += worldOriginX;\n\t\ty1 += worldOriginY;\n\t\tx2 += worldOriginX;\n\t\ty2 += worldOriginY;\n\t\tx3 += worldOriginX;\n\t\ty3 += worldOriginY;\n\t\tx4 += worldOriginX;\n\t\ty4 += worldOriginY;\n\n\t\tvar i = 0;\n\t\tquad[i++] = x1;\n\t\tquad[i++] = y1;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x2;\n\t\tquad[i++] = y2;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x3;\n\t\tquad[i++] = y3;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x4;\n\t\tquad[i++] = y4;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawRegion (region: TextureAtlasRegion, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u;\n\t\tquad[i++] = region.v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u2;\n\t\tquad[i++] = region.v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u2;\n\t\tquad[i++] = region.v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u;\n\t\tquad[i++] = region.v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(region.page.texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tline (x: number, y: number, x2: number, y2: number, color?: Color, color2?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.line(x, y, x2, y2, color);\n\t}\n\n\ttriangle (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3);\n\t}\n\n\tquad (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4);\n\t}\n\n\trect (filled: boolean, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.rect(filled, x, y, width, height, color);\n\t}\n\n\trectLine (filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.rectLine(filled, x1, y1, x2, y2, width, color);\n\t}\n\n\tpolygon (polygonVertices: ArrayLike, offset: number, count: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.polygon(polygonVertices, offset, count, color);\n\t}\n\n\tcircle (filled: boolean, x: number, y: number, radius: number, color?: Color, segments: number = 0) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.circle(filled, x, y, radius, color, segments);\n\t}\n\n\tcurve (x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color);\n\t}\n\n\tend () {\n\t\tif (this.activeRenderer === this.batcher) this.batcher.end();\n\t\telse if (this.activeRenderer === this.shapes) this.shapes.end();\n\t\tthis.activeRenderer = null;\n\t}\n\n\tresize (resizeMode: ResizeMode) {\n\t\tlet canvas = this.canvas;\n\t\tvar dpr = window.devicePixelRatio || 1;\n\t\tvar w = Math.round(canvas.clientWidth * dpr);\n\t\tvar h = Math.round(canvas.clientHeight * dpr);\n\n\t\tif (canvas.width != w || canvas.height != h) {\n\t\t\tcanvas.width = w;\n\t\t\tcanvas.height = h;\n\t\t}\n\t\tthis.context.gl.viewport(0, 0, canvas.width, canvas.height);\n\n\t\t// Nothing to do for stretch, we simply apply the viewport size of the camera.\n\t\tif (resizeMode === ResizeMode.Expand)\n\t\t\tthis.camera.setViewport(w, h);\n\t\telse if (resizeMode === ResizeMode.Fit) {\n\t\t\tlet sourceWidth = canvas.width, sourceHeight = canvas.height;\n\t\t\tlet targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight;\n\t\t\tlet targetRatio = targetHeight / targetWidth;\n\t\t\tlet sourceRatio = sourceHeight / sourceWidth;\n\t\t\tlet scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight;\n\t\t\tthis.camera.setViewport(sourceWidth * scale, sourceHeight * scale);\n\t\t}\n\t\tthis.camera.update();\n\t}\n\n\tprivate enableRenderer (renderer: PolygonBatcher | ShapeRenderer | SkeletonDebugRenderer) {\n\t\tif (this.activeRenderer === renderer) return;\n\t\tthis.end();\n\t\tif (renderer instanceof PolygonBatcher) {\n\t\t\tthis.batcherShader.bind();\n\t\t\tthis.batcherShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values);\n\t\t\tthis.batcherShader.setUniformi(\"u_texture\", 0);\n\t\t\tthis.batcher.begin(this.batcherShader);\n\t\t\tthis.activeRenderer = this.batcher;\n\t\t} else if (renderer instanceof ShapeRenderer) {\n\t\t\tthis.shapesShader.bind();\n\t\t\tthis.shapesShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values);\n\t\t\tthis.shapes.begin(this.shapesShader);\n\t\t\tthis.activeRenderer = this.shapes;\n\t\t} else\n\t\t\tthis.activeRenderer = this.skeletonDebugRenderer;\n\t}\n}\n\nexport enum ResizeMode {\n\tStretch,\n\tExpand,\n\tFit\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BlendMode, Color, Disposable, TimeKeeper } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { ResizeMode, SceneRenderer } from \"./SceneRenderer.js\";\n\nlet spinnerImage: HTMLImageElement;\nlet logoImage: HTMLImageElement;\nlet loaded = 0;\n\nconst FADE_IN = 1, FADE_OUT = 1;\nconst logoWidth = 165, logoHeight = 108, spinnerSize = 163;\n\nexport class LoadingScreen implements Disposable {\n\tprivate renderer: SceneRenderer;\n\tprivate logo: GLTexture | null = null;\n\tprivate spinner: GLTexture | null = null;\n\tprivate angle = 0;\n\tprivate fadeOut = 0;\n\tprivate fadeIn = 0;\n\tprivate timeKeeper = new TimeKeeper();\n\tbackgroundColor = new Color(0.135, 0.135, 0.135, 1);\n\tprivate tempColor = new Color();\n\n\tconstructor (renderer: SceneRenderer) {\n\t\tthis.renderer = renderer;\n\n\t\tthis.timeKeeper.maxDelta = 9;\n\n\t\tif (!logoImage) {\n\t\t\tlet isSafari = navigator.userAgent.indexOf(\"Safari\") > -1; // Thank you Apple Inc.\n\t\t\tlet onload = () => loaded++;\n\n\t\t\tlogoImage = new Image();\n\t\t\tlogoImage.src = SPINE_LOGO_DATA;\n\t\t\tif (!isSafari) logoImage.crossOrigin = \"anonymous\";\n\t\t\tlogoImage.onload = onload;\n\n\t\t\tspinnerImage = new Image();\n\t\t\tspinnerImage.src = SPINNER_DATA;\n\t\t\tif (!isSafari) spinnerImage.crossOrigin = \"anonymous\";\n\t\t\tspinnerImage.onload = onload;\n\t\t}\n\t}\n\tdispose (): void {\n\t\tthis.logo?.dispose();\n\t\tthis.spinner?.dispose();\n\t}\n\n\tdraw (complete = false) {\n\t\tif (loaded < 2 || (complete && this.fadeOut > FADE_OUT)) return;\n\n\t\tthis.timeKeeper.update();\n\t\tlet a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.25));\n\t\tthis.angle -= this.timeKeeper.delta * 200 * (1 + 1.5 * Math.pow(a, 5));\n\n\t\tlet tempColor = this.tempColor;\n\t\tlet renderer = this.renderer;\n\t\tlet canvas = renderer.canvas;\n\t\tlet gl = renderer.context.gl;\n\n\t\trenderer.resize(ResizeMode.Expand);\n\t\trenderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0);\n\t\trenderer.batcher.setBlendMode(BlendMode.Normal, true);\n\n\t\tif (complete) {\n\t\t\tthis.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1);\n\t\t\tif (this.fadeOut > FADE_OUT) return;\n\t\t\ttempColor.setFromColor(this.backgroundColor);\n\t\t\ta = 1 - this.fadeOut / FADE_OUT;\n\t\t\ta = 1 - (a - 1) * (a - 1);\n\t\t\ttempColor.a *= a;\n\t\t\tif (tempColor.a > 0) {\n\t\t\t\trenderer.camera.zoom = 1;\n\t\t\t\trenderer.begin();\n\t\t\t\trenderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height,\n\t\t\t\t\ttempColor, tempColor, tempColor, tempColor);\n\t\t\t\trenderer.end();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.fadeIn += this.timeKeeper.delta;\n\t\t\tif (this.backgroundColor.a > 0) {\n\t\t\t\tgl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a);\n\t\t\t\tgl.clear(gl.COLOR_BUFFER_BIT);\n\t\t\t}\n\t\t\ta = 1;\n\t\t}\n\t\ta *= Math.min(this.fadeIn / FADE_IN, 1);\n\t\ttempColor.set(a, a, a, a);\n\n\t\tif (!this.logo) {\n\t\t\tthis.logo = new GLTexture(renderer.context, logoImage);\n\t\t\tthis.spinner = new GLTexture(renderer.context, spinnerImage);\n\t\t}\n\t\trenderer.camera.zoom = Math.max(1, spinnerSize / canvas.height);\n\t\trenderer.begin();\n\t\trenderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, tempColor);\n\t\tif (this.spinner) renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerSize) / 2, (canvas.height - spinnerSize) / 2, spinnerSize, spinnerSize, spinnerSize / 2, spinnerSize / 2, this.angle, tempColor);\n\t\trenderer.end();\n\t}\n}\n\nlet SPINNER_DATA = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gWoOrBjMCr2GJFQnnxnIM3q5P1PPmaYv+4ev4/C6UtbpV2gzXCkgL5W8Bwt48OIc6ul6Tp+s4+SyASxLiI4+PYCn1bHzDZ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meEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=\";\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TimeKeeper, AssetManager, ManagedWebGLRenderingContext, SceneRenderer, Input, StringMap } from \"./index.js\";\n\n/** An app running inside a {@link SpineCanvas}. The app life-cycle\n * is as follows:\n *\n * 1. `loadAssets()` is called. The app can queue assets for loading via {@link SpineCanvas.assetManager}.\n * 2. `initialize()` is called when all assets are loaded. The app can setup anything it needs to enter the main application logic.\n * 3. `update()` is called periodically at screen refresh rate. The app can update its state.\n * 4. `render()` is called periodically at screen refresh rate. The app can render its state via {@link SpineCanvas.renderer} or directly via the WebGL context in {@link SpineCanvas.gl}.\n *\n * The `error()` method is called in case the assets could not be loaded. The `dispose()` method is called in case the canvas has been disposed via {@link SpineCanvas.dispose}.\n */\nexport interface SpineCanvasApp {\n\tloadAssets?(canvas: SpineCanvas): void;\n\tinitialize?(canvas: SpineCanvas): void;\n\tupdate?(canvas: SpineCanvas, delta: number): void;\n\trender?(canvas: SpineCanvas): void;\n\terror?(canvas: SpineCanvas, errors: StringMap): void;\n\tdispose?(canvas: SpineCanvas): void;\n}\n\n/** Configuration passed to the {@link SpineCanvas} constructor */\nexport interface SpineCanvasConfig {\n\t/* The {@link SpineCanvasApp} to be run in the canvas. */\n\tapp: SpineCanvasApp;\n\t/* The path prefix to be used by the {@link AssetManager}. */\n\tpathPrefix?: string;\n\t/* The WebGL context configuration */\n\twebglConfig?: any;\n}\n\n/** Manages the life-cycle and WebGL context of a {@link SpineCanvasApp}. The app loads\n * assets and initializes itself, then updates and renders its state at the screen refresh rate. */\nexport class SpineCanvas {\n\treadonly context: ManagedWebGLRenderingContext;\n\n\t/** Tracks the current time, delta, and other time related statistics. */\n\treadonly time = new TimeKeeper();\n\t/** The HTML canvas to render to. */\n\treadonly htmlCanvas: HTMLCanvasElement;\n\t/** The WebGL rendering context. */\n\treadonly gl: WebGLRenderingContext;\n\t/** The scene renderer for easy drawing of skeletons, shapes, and images. */\n\treadonly renderer: SceneRenderer;\n\t/** The asset manager to load assets with. */\n\treadonly assetManager: AssetManager;\n\t/** The input processor used to listen to mouse, touch, and keyboard events. */\n\treadonly input: Input;\n\n\tprivate disposed = false;\n\n\t/** Constructs a new spine canvas, rendering to the provided HTML canvas. */\n\tconstructor (canvas: HTMLCanvasElement, private config: SpineCanvasConfig) {\n\t\tif (!config.pathPrefix) config.pathPrefix = \"\";\n\t\tif (!config.app) config.app = {\n\t\t\tloadAssets: () => { },\n\t\t\tinitialize: () => { },\n\t\t\tupdate: () => { },\n\t\t\trender: () => { },\n\t\t\terror: () => { },\n\t\t\tdispose: () => { },\n\t\t}\n\t\tif (!config.webglConfig) config.webglConfig = { alpha: true };\n\n\t\tthis.htmlCanvas = canvas;\n\t\tthis.context = new ManagedWebGLRenderingContext(canvas, config.webglConfig);\n\t\tthis.renderer = new SceneRenderer(canvas, this.context);\n\t\tthis.gl = this.context.gl;\n\t\tthis.assetManager = new AssetManager(this.context, config.pathPrefix);\n\t\tthis.input = new Input(canvas);\n\n\t\tif (config.app.loadAssets) config.app.loadAssets(this);\n\n\t\tlet loop = () => {\n\t\t\tif (this.disposed) return;\n\t\t\trequestAnimationFrame(loop);\n\t\t\tthis.time.update();\n\t\t\tif (config.app.update) config.app.update(this, this.time.delta);\n\t\t\tif (config.app.render) config.app.render(this);\n\t\t}\n\n\t\tlet waitForAssets = () => {\n\t\t\tif (this.disposed) return;\n\t\t\tif (this.assetManager.isLoadingComplete()) {\n\t\t\t\tif (this.assetManager.hasErrors()) {\n\t\t\t\t\tif (config.app.error) config.app.error(this, this.assetManager.getErrors());\n\t\t\t\t} else {\n\t\t\t\t\tif (config.app.initialize) config.app.initialize(this);\n\t\t\t\t\tloop();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trequestAnimationFrame(waitForAssets);\n\t\t}\n\t\trequestAnimationFrame(waitForAssets);\n\t}\n\n\t/** Clears the canvas with the given color. The color values are given in the range [0,1]. */\n\tclear (r: number, g: number, b: number, a: number) {\n\t\tthis.gl.clearColor(r, g, b, a);\n\t\tthis.gl.clear(this.gl.COLOR_BUFFER_BIT);\n\t}\n\n\t/** Disposes the app, so the update() and render() functions are no longer called. Calls the dispose() callback.*/\n\tdispose () {\n\t\tif (this.config.app.dispose) this.config.app.dispose(this);\n\t\tthis.disposed = true;\n\t}\n}\n", "/*\nThe MIT License (MIT)\n\nCopyright (c) 2021-present AgogPixel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n// Adapted from https://github.com/agogpixel/phaser3-ts-utils/tree/main\n\nlet components = (Phaser.GameObjects.Components as any);\nexport const ComputedSize = components.ComputedSize;\nexport const Depth = components.Depth;\nexport const Flip = components.Flip;\nexport const ScrollFactor = components.ScrollFactor;\nexport const Transform = components.Transform;\nexport const Visible = components.Visible;\nexport const Origin = components.Origin;\nexport const Alpha = components.Alpha;\n\nexport interface Type<\n\tT,\n\tP extends any[] = any[]\n\t> extends Function {\n\tnew(...args: P): T;\n}\n\nexport type Mixin = <\n\tGameObjectType extends Type\n\t>(\n\tBaseGameObject: GameObjectType\n) => GameObjectType & Type;\n\nexport function createMixin<\n\tGameObjectComponent,\n\tGameObjectConstraint extends Phaser.GameObjects.GameObject = Phaser.GameObjects.GameObject\n> (\n\t...component: GameObjectComponent[]\n): Mixin {\n\treturn (BaseGameObject) => {\n\t\t(Phaser as any).Class.mixin(BaseGameObject, component);\n\t\treturn BaseGameObject as any;\n\t};\n}\n\ntype ComputedSizeMixin = Mixin;\nexport const ComputedSizeMixin: ComputedSizeMixin = createMixin(ComputedSize);\n\ntype DepthMixin = Mixin;\nexport const DepthMixin: DepthMixin = createMixin(Depth);\n\ntype FlipMixin = Mixin;\nexport const FlipMixin: FlipMixin = createMixin(Flip);\n\ntype ScrollFactorMixin = Mixin;\nexport const ScrollFactorMixin: ScrollFactorMixin = createMixin(ScrollFactor);\n\ntype TransformMixin = Mixin;\nexport const TransformMixin: TransformMixin = createMixin(Transform);\n\ntype VisibleMixin = Mixin;\nexport const VisibleMixin: VisibleMixin = createMixin(Visible);\n\ntype OriginMixin = Mixin;\nexport const OriginMixin: OriginMixin = createMixin(Origin);\n\ntype AlphaMixin = Mixin;\nexport const AlphaMixin: AlphaMixin = createMixin(Alpha);", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { SPINE_GAME_OBJECT_TYPE } from \"./keys.js\";\nimport { SpinePlugin } from \"./SpinePlugin.js\";\nimport {\n\tComputedSizeMixin,\n\tDepthMixin,\n\tFlipMixin,\n\tScrollFactorMixin,\n\tTransformMixin,\n\tVisibleMixin,\n\tAlphaMixin,\n\tOriginMixin,\n} from \"./mixins.js\";\nimport {\n\tAnimationState,\n\tAnimationStateData,\n\tBone,\n\tMathUtils,\n\tPhysics,\n\tSkeleton,\n\tSkeletonClipping,\n\tSkin,\n\tVector2,\n} from \"@esotericsoftware/spine-core\";\n\nclass BaseSpineGameObject extends Phaser.GameObjects.GameObject {\n\tconstructor (scene: Phaser.Scene, type: string) {\n\t\tsuper(scene, type);\n\t}\n}\n\n/** A bounds provider calculates the bounding box for a skeleton, which is then assigned as the size of the SpineGameObject. */\nexport interface SpineGameObjectBoundsProvider {\n\t// Returns the bounding box for the skeleton, in skeleton space.\n\tcalculateBounds (gameObject: SpineGameObject): {\n\t\tx: number;\n\t\ty: number;\n\t\twidth: number;\n\t\theight: number;\n\t};\n}\n\n/** A bounds provider that calculates the bounding box from the setup pose. */\nexport class SetupPoseBoundsProvider implements SpineGameObjectBoundsProvider {\n\t/**\n\t * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.\n\t */\n\tconstructor (\n\t\tprivate clipping = false,\n\t) { }\n\n\tcalculateBounds (gameObject: SpineGameObject) {\n\t\tif (!gameObject.skeleton) return { x: 0, y: 0, width: 0, height: 0 };\n\t\t// Make a copy of animation state and skeleton as this might be called while\n\t\t// the skeleton in the GameObject has already been heavily modified. We can not\n\t\t// reconstruct that state.\n\t\tconst skeleton = new Skeleton(gameObject.skeleton.data);\n\t\tskeleton.setToSetupPose();\n\t\tskeleton.updateWorldTransform(Physics.update);\n\t\tconst bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : undefined);\n\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t: bounds;\n\t}\n}\n\n/** A bounds provider that calculates the bounding box by taking the maximumg bounding box for a combination of skins and specific animation. */\nexport class SkinsAndAnimationBoundsProvider\n\timplements SpineGameObjectBoundsProvider {\n\t/**\n\t * @param animation The animation to use for calculating the bounds. If null, the setup pose is used.\n\t * @param skins The skins to use for calculating the bounds. If empty, the default skin is used.\n\t * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation.\n\t * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.\n\t */\n\tconstructor (\n\t\tprivate animation: string | null,\n\t\tprivate skins: string[] = [],\n\t\tprivate timeStep: number = 0.05,\n\t\tprivate clipping = false,\n\t) { }\n\n\tcalculateBounds (gameObject: SpineGameObject): {\n\t\tx: number;\n\t\ty: number;\n\t\twidth: number;\n\t\theight: number;\n\t} {\n\t\tif (!gameObject.skeleton || !gameObject.animationState)\n\t\t\treturn { x: 0, y: 0, width: 0, height: 0 };\n\t\t// Make a copy of animation state and skeleton as this might be called while\n\t\t// the skeleton in the GameObject has already been heavily modified. We can not\n\t\t// reconstruct that state.\n\t\tconst animationState = new AnimationState(gameObject.animationState.data);\n\t\tconst skeleton = new Skeleton(gameObject.skeleton.data);\n\t\tconst clipper = this.clipping ? new SkeletonClipping() : undefined;\n\t\tconst data = skeleton.data;\n\t\tif (this.skins.length > 0) {\n\t\t\tlet customSkin = new Skin(\"custom-skin\");\n\t\t\tfor (const skinName of this.skins) {\n\t\t\t\tconst skin = data.findSkin(skinName);\n\t\t\t\tif (skin == null) continue;\n\t\t\t\tcustomSkin.addSkin(skin);\n\t\t\t}\n\t\t\tskeleton.setSkin(customSkin);\n\t\t}\n\t\tskeleton.setToSetupPose();\n\n\t\tconst animation =\n\t\t\tthis.animation != null ? data.findAnimation(this.animation!) : null;\n\t\tif (animation == null) {\n\t\t\tskeleton.updateWorldTransform(Physics.update);\n\t\t\tconst bounds = skeleton.getBoundsRect(clipper);\n\t\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t\t: bounds;\n\t\t} else {\n\t\t\tlet minX = Number.POSITIVE_INFINITY,\n\t\t\t\tminY = Number.POSITIVE_INFINITY,\n\t\t\t\tmaxX = Number.NEGATIVE_INFINITY,\n\t\t\t\tmaxY = Number.NEGATIVE_INFINITY;\n\t\t\tanimationState.clearTracks();\n\t\t\tanimationState.setAnimationWith(0, animation, false);\n\t\t\tconst steps = Math.max(animation.duration / this.timeStep, 1.0);\n\t\t\tfor (let i = 0; i < steps; i++) {\n\t\t\t\tconst delta = i > 0 ? this.timeStep : 0;\n\t\t\t\tanimationState.update(delta);\n\t\t\t\tanimationState.apply(skeleton);\n\t\t\t\tskeleton.update(delta);\n\t\t\t\tskeleton.updateWorldTransform(Physics.update);\n\n\t\t\t\tconst bounds = skeleton.getBoundsRect(clipper);\n\t\t\t\tminX = Math.min(minX, bounds.x);\n\t\t\t\tminY = Math.min(minY, bounds.y);\n\t\t\t\tmaxX = Math.max(maxX, bounds.x + bounds.width);\n\t\t\t\tmaxY = Math.max(maxY, bounds.y + bounds.height);\n\t\t\t}\n\t\t\tconst bounds = {\n\t\t\t\tx: minX,\n\t\t\t\ty: minY,\n\t\t\t\twidth: maxX - minX,\n\t\t\t\theight: maxY - minY,\n\t\t\t};\n\t\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t\t: bounds;\n\t\t}\n\t}\n}\n\n/**\n * A SpineGameObject is a Phaser {@link GameObject} that can be added to a Phaser Scene and render a Spine skeleton.\n *\n * The Spine GameObject is a thin wrapper around a Spine {@link Skeleton}, {@link AnimationState} and {@link AnimationStateData}. It is responsible for:\n * - updating the animation state\n * - applying the animation state to the skeleton's bones, slots, attachments, and draw order.\n * - updating the skeleton's bone world transforms\n * - rendering the skeleton\n *\n * See the {@link SpinePlugin} class for more information on how to create a `SpineGameObject`.\n *\n * The skeleton, animation state, and animation state data can be accessed via the repsective fields. They can be manually updated via {@link updatePose}.\n *\n * To modify the bone hierarchy before the world transforms are computed, a callback can be set via the {@link beforeUpdateWorldTransforms} field.\n *\n * To modify the bone hierarchy after the world transforms are computed, a callback can be set via the {@link afterUpdateWorldTransforms} field.\n *\n * The class also features methods to convert between the skeleton coordinate system and the Phaser coordinate system.\n *\n * See {@link skeletonToPhaserWorldCoordinates}, {@link phaserWorldCoordinatesToSkeleton}, and {@link phaserWorldCoordinatesToBoneLocal.}\n */\nexport class SpineGameObject extends DepthMixin(\n\tOriginMixin(\n\t\tComputedSizeMixin(\n\t\t\tFlipMixin(\n\t\t\t\tScrollFactorMixin(\n\t\t\t\t\tTransformMixin(VisibleMixin(AlphaMixin(BaseSpineGameObject)))\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t)\n) {\n\tblendMode = -1;\n\tskeleton: Skeleton;\n\tanimationStateData: AnimationStateData;\n\tanimationState: AnimationState;\n\tbeforeUpdateWorldTransforms: (object: SpineGameObject) => void = () => { };\n\tafterUpdateWorldTransforms: (object: SpineGameObject) => void = () => { };\n\tprivate premultipliedAlpha = false;\n\n\tconstructor (\n\t\tscene: Phaser.Scene,\n\t\tprivate plugin: SpinePlugin,\n\t\tx: number,\n\t\ty: number,\n\t\tdataKey: string,\n\t\tatlasKey: string,\n\t\tpublic boundsProvider: SpineGameObjectBoundsProvider = new SetupPoseBoundsProvider()\n\t) {\n\t\tsuper(scene, (window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE);\n\t\tthis.setPosition(x, y);\n\n\t\tthis.premultipliedAlpha = this.plugin.isAtlasPremultiplied(atlasKey);\n\t\tthis.skeleton = this.plugin.createSkeleton(dataKey, atlasKey);\n\t\tthis.animationStateData = new AnimationStateData(this.skeleton.data);\n\t\tthis.animationState = new AnimationState(this.animationStateData);\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\t\tthis.updateSize();\n\t}\n\n\tupdateSize () {\n\t\tif (!this.skeleton) return;\n\t\tlet bounds = this.boundsProvider.calculateBounds(this);\n\t\t// For some reason the TS compiler and the ComputedSize mixin don't work well together and we have\n\t\t// to cast to any.\n\t\tlet self = this as any;\n\t\tself.width = bounds.width;\n\t\tself.height = bounds.height;\n\t\tthis.displayOriginX = -bounds.x;\n\t\tthis.displayOriginY = -bounds.y;\n\t}\n\n\t/** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */\n\tskeletonToPhaserWorldCoordinates (point: { x: number; y: number }) {\n\t\tlet transform = this.getWorldTransformMatrix();\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tlet x = point.x;\n\t\tlet y = point.y;\n\t\tpoint.x = x * a + y * c + tx;\n\t\tpoint.y = x * b + y * d + ty;\n\t}\n\n\t/** Converts a point from the Phaser world coordinate system to the skeleton coordinate system. */\n\tphaserWorldCoordinatesToSkeleton (point: { x: number; y: number }) {\n\t\tlet transform = this.getWorldTransformMatrix();\n\t\ttransform = transform.invert();\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tlet x = point.x;\n\t\tlet y = point.y;\n\t\tpoint.x = x * a + y * c + tx;\n\t\tpoint.y = x * b + y * d + ty;\n\t}\n\n\t/** Converts a point from the Phaser world coordinate system to the bone's local coordinate system. */\n\tphaserWorldCoordinatesToBone (point: { x: number; y: number }, bone: Bone) {\n\t\tthis.phaserWorldCoordinatesToSkeleton(point);\n\t\tif (bone.parent) {\n\t\t\tbone.parent.worldToLocal(point as Vector2);\n\t\t} else {\n\t\t\tbone.worldToLocal(point as Vector2);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the {@link AnimationState}, applies it to the {@link Skeleton}, then updates the world transforms of all bones.\n\t * @param delta The time delta in milliseconds\n\t */\n\tupdatePose (delta: number) {\n\t\tthis.animationState.update(delta / 1000);\n\t\tthis.animationState.apply(this.skeleton);\n\t\tthis.beforeUpdateWorldTransforms(this);\n\t\tthis.skeleton.update(delta / 1000);\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\t\tthis.afterUpdateWorldTransforms(this);\n\t}\n\n\tpreUpdate (time: number, delta: number) {\n\t\tif (!this.skeleton || !this.animationState) return;\n\t\tthis.updatePose(delta);\n\t}\n\n\tpreDestroy () {\n\t\t// FIXME tear down any event emitters\n\t}\n\n\twillRender (camera: Phaser.Cameras.Scene2D.Camera) {\n\t\tvar GameObjectRenderMask = 0xf;\n\t\tvar result = !this.skeleton || !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && this.cameraFilter & camera.id));\n\t\tif (!this.visible) result = false;\n\n\t\tif (!result && this.parentContainer && this.plugin.webGLRenderer) {\n\t\t\tvar sceneRenderer = this.plugin.webGLRenderer;\n\n\t\t\tif (this.plugin.gl && this.plugin.phaserRenderer instanceof Phaser.Renderer.WebGL.WebGLRenderer && sceneRenderer.batcher.isDrawing) {\n\t\t\t\tsceneRenderer.end();\n\t\t\t\tthis.plugin.phaserRenderer.pipelines.rebind();\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\trenderWebGL (\n\t\trenderer: Phaser.Renderer.WebGL.WebGLRenderer,\n\t\tsrc: SpineGameObject,\n\t\tcamera: Phaser.Cameras.Scene2D.Camera,\n\t\tparentMatrix: Phaser.GameObjects.Components.TransformMatrix\n\t) {\n\t\tif (!this.skeleton || !this.animationState || !this.plugin.webGLRenderer)\n\t\t\treturn;\n\n\t\tlet sceneRenderer = this.plugin.webGLRenderer;\n\t\tif (renderer.newType) {\n\t\t\trenderer.pipelines.clear();\n\t\t\tsceneRenderer.begin();\n\t\t}\n\n\t\tcamera.addToRenderList(src);\n\t\tlet transform = Phaser.GameObjects.GetCalcMatrix(\n\t\t\tsrc,\n\t\t\tcamera,\n\t\t\tparentMatrix\n\t\t).calc;\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tsceneRenderer.drawSkeleton(\n\t\t\tthis.skeleton,\n\t\t\tthis.premultipliedAlpha,\n\t\t\t-1,\n\t\t\t-1,\n\t\t\t(vertices, numVertices, stride) => {\n\t\t\t\tfor (let i = 0; i < numVertices; i += stride) {\n\t\t\t\t\tlet vx = vertices[i];\n\t\t\t\t\tlet vy = vertices[i + 1];\n\t\t\t\t\tvertices[i] = vx * a + vy * c + tx;\n\t\t\t\t\tvertices[i + 1] = vx * b + vy * d + ty;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tif (!renderer.nextTypeMatch) {\n\t\t\tsceneRenderer.end();\n\t\t\trenderer.pipelines.rebind();\n\t\t}\n\t}\n\n\trenderCanvas (\n\t\trenderer: Phaser.Renderer.Canvas.CanvasRenderer,\n\t\tsrc: SpineGameObject,\n\t\tcamera: Phaser.Cameras.Scene2D.Camera,\n\t\tparentMatrix: Phaser.GameObjects.Components.TransformMatrix\n\t) {\n\t\tif (!this.skeleton || !this.animationState || !this.plugin.canvasRenderer)\n\t\t\treturn;\n\n\t\tlet context = renderer.currentContext;\n\t\tlet skeletonRenderer = this.plugin.canvasRenderer;\n\t\t(skeletonRenderer as any).ctx = context;\n\n\t\tcamera.addToRenderList(src);\n\t\tlet transform = Phaser.GameObjects.GetCalcMatrix(\n\t\t\tsrc,\n\t\t\tcamera,\n\t\t\tparentMatrix\n\t\t).calc;\n\t\tlet skeleton = this.skeleton;\n\t\tskeleton.x = transform.tx;\n\t\tskeleton.y = transform.ty;\n\t\tskeleton.scaleX = transform.scaleX;\n\t\tskeleton.scaleY = transform.scaleY;\n\t\tlet root = skeleton.getRootBone()!;\n\t\troot.rotation = -MathUtils.radiansToDegrees * transform.rotationNormalized;\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\n\t\tcontext.save();\n\t\tskeletonRenderer.draw(skeleton);\n\t\tcontext.restore();\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture, TextureFilter, TextureWrap } from \"@esotericsoftware/spine-core\";\n\nexport class CanvasTexture extends Texture {\n\tconstructor (image: HTMLImageElement | ImageBitmap) {\n\t\tsuper(image);\n\t}\n\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) { }\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) { }\n\tdispose () { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Utils, Color, Skeleton, RegionAttachment, BlendMode, MeshAttachment, Slot, TextureRegion, TextureAtlasRegion } from \"@esotericsoftware/spine-core\";\nimport { CanvasTexture } from \"./CanvasTexture.js\";\n\nconst worldVertices = Utils.newFloatArray(8);\n\nexport class SkeletonRenderer {\n\tstatic QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n\tstatic VERTEX_SIZE = 2 + 2 + 4;\n\n\tprivate ctx: CanvasRenderingContext2D;\n\n\tpublic triangleRendering = false;\n\tpublic debugRendering = false;\n\tprivate vertices = Utils.newFloatArray(8 * 1024);\n\tprivate tempColor = new Color();\n\n\tconstructor (context: CanvasRenderingContext2D) {\n\t\tthis.ctx = context;\n\t}\n\n\tdraw (skeleton: Skeleton) {\n\t\tif (this.triangleRendering) this.drawTriangles(skeleton);\n\t\telse this.drawImages(skeleton);\n\t}\n\n\tprivate drawImages (skeleton: Skeleton) {\n\t\tlet ctx = this.ctx;\n\t\tlet color = this.tempColor;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet drawOrder = skeleton.drawOrder;\n\n\t\tif (this.debugRendering) ctx.strokeStyle = \"green\";\n\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tlet bone = slot.bone;\n\t\t\tif (!bone.active) continue;\n\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (!(attachment instanceof RegionAttachment)) continue;\n\t\t\tattachment.computeWorldVertices(slot, worldVertices, 0, 2);\n\t\t\tlet region: TextureRegion = attachment.region;\n\n\t\t\tlet image: HTMLImageElement = (region.texture).getImage() as HTMLImageElement;\n\n\t\t\tlet slotColor = slot.color;\n\t\t\tlet regionColor = attachment.color;\n\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r,\n\t\t\t\tskeletonColor.g * slotColor.g * regionColor.g,\n\t\t\t\tskeletonColor.b * slotColor.b * regionColor.b,\n\t\t\t\tskeletonColor.a * slotColor.a * regionColor.a);\n\n\t\t\tctx.save();\n\t\t\tctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);\n\t\t\tctx.translate(attachment.offset[0], attachment.offset[1]);\n\t\t\tctx.rotate(attachment.rotation * Math.PI / 180);\n\n\t\t\tlet atlasScale = attachment.width / region.originalWidth;\n\t\t\tctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);\n\n\t\t\tlet w = region.width, h = region.height;\n\t\t\tctx.translate(w / 2, h / 2);\n\t\t\tif (attachment.region!.degrees == 90) {\n\t\t\t\tlet t = w;\n\t\t\t\tw = h;\n\t\t\t\th = t;\n\t\t\t\tctx.rotate(-Math.PI / 2);\n\t\t\t}\n\t\t\tctx.scale(1, -1);\n\t\t\tctx.translate(-w / 2, -h / 2);\n\n\t\t\tctx.globalAlpha = color.a;\n\t\t\tctx.drawImage(image, image.width * region.u, image.height * region.v, w, h, 0, 0, w, h);\n\t\t\tif (this.debugRendering) ctx.strokeRect(0, 0, w, h);\n\t\t\tctx.restore();\n\t\t}\n\t}\n\n\tprivate drawTriangles (skeleton: Skeleton) {\n\t\tlet ctx = this.ctx;\n\t\tlet color = this.tempColor;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet drawOrder = skeleton.drawOrder;\n\n\t\tlet blendMode: BlendMode | null = null;\n\t\tlet vertices: ArrayLike = this.vertices;\n\t\tlet triangles: Array | null = null;\n\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tlet attachment = slot.getAttachment();\n\n\t\t\tlet texture: HTMLImageElement;\n\t\t\tlet region: TextureAtlasRegion;\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tlet regionAttachment = attachment;\n\t\t\t\tvertices = this.computeRegionVertices(slot, regionAttachment, false);\n\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\n\t\t\t\ttexture = (regionAttachment.region!.texture).getImage() as HTMLImageElement;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = attachment;\n\t\t\t\tvertices = this.computeMeshVertices(slot, mesh, false);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t\ttexture = (mesh.region!.texture).getImage() as HTMLImageElement;\n\t\t\t} else\n\t\t\t\tcontinue;\n\n\t\t\tif (texture) {\n\t\t\t\tif (slot.data.blendMode != blendMode) blendMode = slot.data.blendMode;\n\n\t\t\t\tlet slotColor = slot.color;\n\t\t\t\tlet attachmentColor = attachment.color;\n\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * attachmentColor.r,\n\t\t\t\t\tskeletonColor.g * slotColor.g * attachmentColor.g,\n\t\t\t\t\tskeletonColor.b * slotColor.b * attachmentColor.b,\n\t\t\t\t\tskeletonColor.a * slotColor.a * attachmentColor.a);\n\n\t\t\t\tctx.globalAlpha = color.a;\n\n\t\t\t\tfor (var j = 0; j < triangles.length; j += 3) {\n\t\t\t\t\tlet t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8;\n\n\t\t\t\t\tlet x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];\n\t\t\t\t\tlet x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];\n\t\t\t\t\tlet x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];\n\n\t\t\t\t\tthis.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);\n\n\t\t\t\t\tif (this.debugRendering) {\n\t\t\t\t\t\tctx.strokeStyle = \"green\";\n\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\tctx.moveTo(x0, y0);\n\t\t\t\t\t\tctx.lineTo(x1, y1);\n\t\t\t\t\t\tctx.lineTo(x2, y2);\n\t\t\t\t\t\tctx.lineTo(x0, y0);\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.ctx.globalAlpha = 1;\n\t}\n\n\t// Adapted from http://extremelysatisfactorytotalitarianism.com/blog/?p=2120\n\t// Apache 2 licensed\n\tprivate drawTriangle (img: HTMLImageElement, x0: number, y0: number, u0: number, v0: number,\n\t\tx1: number, y1: number, u1: number, v1: number,\n\t\tx2: number, y2: number, u2: number, v2: number) {\n\t\tlet ctx = this.ctx;\n\n\t\tconst width = img.width - 1;\n\t\tconst height = img.height - 1;\n\t\tu0 *= width;\n\t\tv0 *= height;\n\t\tu1 *= width;\n\t\tv1 *= height;\n\t\tu2 *= width;\n\t\tv2 *= height;\n\n\t\tctx.beginPath();\n\t\tctx.moveTo(x0, y0);\n\t\tctx.lineTo(x1, y1);\n\t\tctx.lineTo(x2, y2);\n\t\tctx.closePath();\n\n\t\tx1 -= x0;\n\t\ty1 -= y0;\n\t\tx2 -= x0;\n\t\ty2 -= y0;\n\n\t\tu1 -= u0;\n\t\tv1 -= v0;\n\t\tu2 -= u0;\n\t\tv2 -= v0;\n\n\t\tlet det = u1 * v2 - u2 * v1;\n\t\tif (det == 0) return;\n\t\tdet = 1 / det;\n\n\t\t// linear transformation\n\t\tconst a = (v2 * x1 - v1 * x2) * det;\n\t\tconst b = (v2 * y1 - v1 * y2) * det;\n\t\tconst c = (u1 * x2 - u2 * x1) * det;\n\t\tconst d = (u1 * y2 - u2 * y1) * det;\n\n\t\t// translation\n\t\tconst e = x0 - a * u0 - c * v0;\n\t\tconst f = y0 - b * u0 - d * v0;\n\n\t\tctx.save();\n\t\tctx.transform(a, b, c, d, e, f);\n\t\tctx.clip();\n\t\tctx.drawImage(img, 0, 0);\n\t\tctx.restore();\n\t}\n\n\tprivate computeRegionVertices (slot: Slot, region: RegionAttachment, pma: boolean) {\n\t\tlet skeletonColor = slot.bone.skeleton.color;\n\t\tlet slotColor = slot.color;\n\t\tlet regionColor = region.color;\n\t\tlet alpha = skeletonColor.a * slotColor.a * regionColor.a;\n\t\tlet multiplier = pma ? alpha : 1;\n\t\tlet color = this.tempColor;\n\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier,\n\t\t\tskeletonColor.g * slotColor.g * regionColor.g * multiplier,\n\t\t\tskeletonColor.b * slotColor.b * regionColor.b * multiplier,\n\t\t\talpha);\n\n\t\tregion.computeWorldVertices(slot, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);\n\n\t\tlet vertices = this.vertices;\n\t\tlet uvs = region.uvs;\n\n\t\tvertices[RegionAttachment.C1R] = color.r;\n\t\tvertices[RegionAttachment.C1G] = color.g;\n\t\tvertices[RegionAttachment.C1B] = color.b;\n\t\tvertices[RegionAttachment.C1A] = color.a;\n\t\tvertices[RegionAttachment.U1] = uvs[0];\n\t\tvertices[RegionAttachment.V1] = uvs[1];\n\n\t\tvertices[RegionAttachment.C2R] = color.r;\n\t\tvertices[RegionAttachment.C2G] = color.g;\n\t\tvertices[RegionAttachment.C2B] = color.b;\n\t\tvertices[RegionAttachment.C2A] = color.a;\n\t\tvertices[RegionAttachment.U2] = uvs[2];\n\t\tvertices[RegionAttachment.V2] = uvs[3];\n\n\t\tvertices[RegionAttachment.C3R] = color.r;\n\t\tvertices[RegionAttachment.C3G] = color.g;\n\t\tvertices[RegionAttachment.C3B] = color.b;\n\t\tvertices[RegionAttachment.C3A] = color.a;\n\t\tvertices[RegionAttachment.U3] = uvs[4];\n\t\tvertices[RegionAttachment.V3] = uvs[5];\n\n\t\tvertices[RegionAttachment.C4R] = color.r;\n\t\tvertices[RegionAttachment.C4G] = color.g;\n\t\tvertices[RegionAttachment.C4B] = color.b;\n\t\tvertices[RegionAttachment.C4A] = color.a;\n\t\tvertices[RegionAttachment.U4] = uvs[6];\n\t\tvertices[RegionAttachment.V4] = uvs[7];\n\n\t\treturn vertices;\n\t}\n\n\tprivate computeMeshVertices (slot: Slot, mesh: MeshAttachment, pma: boolean) {\n\t\tlet skeletonColor = slot.bone.skeleton.color;\n\t\tlet slotColor = slot.color;\n\t\tlet regionColor = mesh.color;\n\t\tlet alpha = skeletonColor.a * slotColor.a * regionColor.a;\n\t\tlet multiplier = pma ? alpha : 1;\n\t\tlet color = this.tempColor;\n\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier,\n\t\t\tskeletonColor.g * slotColor.g * regionColor.g * multiplier,\n\t\t\tskeletonColor.b * slotColor.b * regionColor.b * multiplier,\n\t\t\talpha);\n\n\t\tlet vertexCount = mesh.worldVerticesLength / 2;\n\t\tlet vertices = this.vertices;\n\t\tif (vertices.length < mesh.worldVerticesLength) this.vertices = vertices = Utils.newFloatArray(mesh.worldVerticesLength);\n\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);\n\n\t\tlet uvs = mesh.uvs;\n\t\tfor (let i = 0, u = 0, v = 2; i < vertexCount; i++) {\n\t\t\tvertices[v++] = color.r;\n\t\t\tvertices[v++] = color.g;\n\t\t\tvertices[v++] = color.b;\n\t\t\tvertices[v++] = color.a;\n\t\t\tvertices[v++] = uvs[u++];\n\t\t\tvertices[v++] = uvs[u++];\n\t\t\tv += 2;\n\t\t}\n\n\t\treturn vertices;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport * from \"./require-shim.js\"\nexport * from \"./SpinePlugin.js\"\nexport * from \"./SpineGameObject.js\"\nexport * from \"./mixins.js\"\nexport * from \"@esotericsoftware/spine-core\";\nexport * from \"@esotericsoftware/spine-webgl\";\nimport { SpineGameObjectConfig, SpinePlugin } from \"./SpinePlugin.js\";\n(window as any).spine = { SpinePlugin: SpinePlugin };\n(window as any)[\"spine.SpinePlugin\"] = SpinePlugin;\n\nimport { SpineGameObject, SpineGameObjectBoundsProvider } from \"./SpineGameObject.js\";\n\ndeclare global {\n\tnamespace Phaser.Loader {\n\t\texport interface LoaderPlugin {\n\t\t\tspineJson (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t\tspineBinary (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t\tspineAtlas (key: string, url: string, premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t}\n\t}\n\n\tnamespace Phaser.GameObjects {\n\t\texport interface GameObjectFactory {\n\t\t\tspine (x: number, y: number, dataKey: string, atlasKey: string, boundsProvider?: SpineGameObjectBoundsProvider): SpineGameObject;\n\t\t}\n\n\t\texport interface GameObjectCreator {\n\t\t\tspine (config: SpineGameObjectConfig, addToScene?: boolean): SpineGameObject;\n\t\t}\n\t}\n\n\tnamespace Phaser {\n\t\texport interface Scene {\n\t\t\tspine: SpinePlugin;\n\t\t}\n\t}\n}\n"], - "mappings": ";;;;;;;;AAgCA,IAAI,OAAO,WAAW,eAAe,OAAO,QAAQ;AACnD,MAAI,cAAc,OAAO;AACzB,SAAO,UAAU,CAAC,MAAc;AAC/B,QAAI;AAAa,aAAO,YAAY,CAAC;AAAA,aAC5B,MAAM;AAAU,aAAO,OAAO;AAAA,EACxC;AACD;;;ACTA,YAAYA,aAAY;;;ACAjB,IAAM,gCAAgC;AACtC,IAAM,wBAAwB;AAE9B,IAAM,gCAAgC;AACtC,IAAM,wBAAwB;AAC9B,IAAM,yBAAyB;;;ACE/B,IAAM,SAAN,MAAa;AAAA,EACnB,Q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UAAU,KAAK,QAAQ,KAAK,GAAG;AAEvE,cAAI,CAAC,KAAK,OAAO,UAAU,KAAK,GAAG;AAClC,iBAAK,eAAe,KAAK;AACzB,iBAAK,OAAO,QAAQ,KAAK;AAAA,UAC1B;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD;AAAA,EAEA,aAAc;AACb,QAAI,KAAK,iBAAiB,GAAG;AAC5B,UAAI,iBAAiB,KAAK,OAAO;AACjC,eAAS,QAAQ,KAAK,OAAO;AAC5B,YAAI,KAAK,QAAQ,SAAS;AACzB,cAAI,CAAC,eAAe,OAAO,KAAK,GAAG,GAAG;AACrC,2BAAe,SAAS,KAAK,KAAK,KAAK,IAAI;AAAA,UAC5C;AAAA,QACD,OAAO;AACN,eAAK,qBAAqB,KAAK,uBAAuB,KAAK,KAAK,QAAQ,WAAW,KAAK,KAAK,KAAK,KAAK,QAAQ,UAAU,KAAK;AAC9H,eAAK,OAAO;AAAA,YACX,MAAM,KAAK;AAAA,YACX,oBAAoB,KAAK;AAAA,UAC1B;AACA,eAAK,WAAW;AAAA,QACjB;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD;;;A+DlXC,OAAe,QAAQ,EAAE,YAAyB;AAClD,OAAe,mBAAmB,IAAI;", - "names": ["Phaser", "worldVertices", "v", "SequenceMode", "MixBlend", "MixDirection", "x", "y", "i", "vertexAttachment", "constraint", "i", "n", "timeline", "EventType", "TextureFilter", "TextureWrap", "page", "worldVertices", "worldVertices", "Inherit", "s", "PositionMode", "SpacingMode", "RotateMode", "closed", "pathLength", "multiplier", "Physics", "BlendMode", "closed", "AttachmentType", "n", "LinkedMesh", "readTimeline1", "readTimeline2", "timeline", "Matrix4", "Matrix4", "VertexAttributeType", "temp", "ShapeType", "i", "n", "n", "ResizeMode", "bounds", "_SkeletonRenderer", "SkeletonRenderer", "SkeletonRenderer", "SpineSkeletonDataFileType"] -} diff --git a/spine-ts/spine-phaser-v3/dist/iife/spine-phaser-v3.js b/spine-ts/spine-phaser-v3/dist/iife/spine-phaser-v3.js deleted file mode 100644 index 34beadeb2..000000000 --- a/spine-ts/spine-phaser-v3/dist/iife/spine-phaser-v3.js +++ /dev/null @@ -1,15445 +0,0 @@ -"use strict"; -var spine = (() => { - var __create = Object.create; - var __defProp = Object.defineProperty; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __getProtoOf = Object.getPrototypeOf; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; - var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { - get: (a, b) => (typeof require !== "undefined" ? require : a)[b] - }) : x)(function(x) { - if (typeof require !== "undefined") - return require.apply(this, arguments); - throw new Error('Dynamic require of "' + x + '" is not supported'); - }); - var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod - )); - var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); - var __publicField = (obj, key, value) => { - __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); - return value; - }; - - // spine-phaser-v3/src/index.ts - var src_exports = {}; - __export(src_exports, { - Alpha: () => Alpha, - AlphaMixin: () => AlphaMixin, - AlphaTimeline: () => AlphaTimeline, - Animation: () => Animation, - AnimationState: () => AnimationState, - AnimationStateAdapter: () => AnimationStateAdapter, - AnimationStateData: () => AnimationStateData, - AssetManager: () => AssetManager, - AssetManagerBase: () => AssetManagerBase, - AtlasAttachmentLoader: () => AtlasAttachmentLoader, - Attachment: () => Attachment, - AttachmentTimeline: () => AttachmentTimeline, - BinaryInput: () => BinaryInput, - BlendMode: () => BlendMode, - Bone: () => Bone, - BoneData: () => BoneData, - BoundingBoxAttachment: () => BoundingBoxAttachment, - CURRENT: () => CURRENT, - CameraController: () => CameraController, - ClippingAttachment: () => ClippingAttachment, - Color: () => Color, - Color2Attribute: () => Color2Attribute, - ColorAttribute: () => ColorAttribute, - ComputedSize: () => ComputedSize, - ComputedSizeMixin: () => ComputedSizeMixin, - ConstraintData: () => ConstraintData, - CurveTimeline: () => CurveTimeline, - CurveTimeline1: () => CurveTimeline1, - CurveTimeline2: () => CurveTimeline2, - DebugUtils: () => DebugUtils, - DeformTimeline: () => DeformTimeline, - Depth: () => Depth, - DepthMixin: () => DepthMixin, - Downloader: () => Downloader, - DrawOrderTimeline: () => DrawOrderTimeline, - Event: () => Event, - EventData: () => EventData, - EventQueue: () => EventQueue, - EventTimeline: () => EventTimeline, - EventType: () => EventType, - FIRST: () => FIRST, - FakeTexture: () => FakeTexture, - Flip: () => Flip, - FlipMixin: () => FlipMixin, - GLTexture: () => GLTexture, - HOLD_FIRST: () => HOLD_FIRST, - HOLD_MIX: () => HOLD_MIX, - HOLD_SUBSEQUENT: () => HOLD_SUBSEQUENT, - IkConstraint: () => IkConstraint, - IkConstraintData: () => IkConstraintData, - IkConstraintTimeline: () => IkConstraintTimeline, - Inherit: () => Inherit, - InheritTimeline: () => InheritTimeline, - Input: () => Input, - IntSet: () => IntSet, - Interpolation: () => Interpolation, - LoadingScreen: () => LoadingScreen, - M00: () => M00, - M01: () => M01, - M02: () => M02, - M03: () => M03, - M10: () => M10, - M11: () => M11, - M12: () => M12, - M13: () => M13, - M20: () => M20, - M21: () => M21, - M22: () => M22, - M23: () => M23, - M30: () => M30, - M31: () => M31, - M32: () => M32, - M33: () => M33, - ManagedWebGLRenderingContext: () => ManagedWebGLRenderingContext, - MathUtils: () => MathUtils, - Matrix4: () => Matrix42, - Mesh: () => Mesh, - MeshAttachment: () => MeshAttachment, - MixBlend: () => MixBlend, - MixDirection: () => MixDirection, - Origin: () => Origin, - OriginMixin: () => OriginMixin, - OrthoCamera: () => OrthoCamera, - PathAttachment: () => PathAttachment, - PathConstraint: () => PathConstraint, - PathConstraintData: () => PathConstraintData, - PathConstraintMixTimeline: () => PathConstraintMixTimeline, - PathConstraintPositionTimeline: () => PathConstraintPositionTimeline, - PathConstraintSpacingTimeline: () => PathConstraintSpacingTimeline, - Physics: () => Physics, - PhysicsConstraintDampingTimeline: () => PhysicsConstraintDampingTimeline, - PhysicsConstraintGravityTimeline: () => PhysicsConstraintGravityTimeline, - PhysicsConstraintInertiaTimeline: () => PhysicsConstraintInertiaTimeline, - PhysicsConstraintMassTimeline: () => PhysicsConstraintMassTimeline, - PhysicsConstraintMixTimeline: () => PhysicsConstraintMixTimeline, - PhysicsConstraintResetTimeline: () => PhysicsConstraintResetTimeline, - PhysicsConstraintStrengthTimeline: () => PhysicsConstraintStrengthTimeline, - PhysicsConstraintTimeline: () => PhysicsConstraintTimeline, - PhysicsConstraintWindTimeline: () => PhysicsConstraintWindTimeline, - PointAttachment: () => PointAttachment, - PolygonBatcher: () => PolygonBatcher, - Pool: () => Pool, - Position2Attribute: () => Position2Attribute, - Position3Attribute: () => Position3Attribute, - PositionMode: () => PositionMode, - Pow: () => Pow, - PowOut: () => PowOut, - RGB2Timeline: () => RGB2Timeline, - RGBA2Timeline: () => RGBA2Timeline, - RGBATimeline: () => RGBATimeline, - RGBTimeline: () => RGBTimeline, - RegionAttachment: () => RegionAttachment, - ResizeMode: () => ResizeMode, - RotateMode: () => RotateMode, - RotateTimeline: () => RotateTimeline, - SETUP: () => SETUP, - SUBSEQUENT: () => SUBSEQUENT, - ScaleTimeline: () => ScaleTimeline, - ScaleXTimeline: () => ScaleXTimeline, - ScaleYTimeline: () => ScaleYTimeline, - SceneRenderer: () => SceneRenderer, - ScrollFactor: () => ScrollFactor, - ScrollFactorMixin: () => ScrollFactorMixin, - SequenceTimeline: () => SequenceTimeline, - SetupPoseBoundsProvider: () => SetupPoseBoundsProvider, - Shader: () => Shader, - ShapeRenderer: () => ShapeRenderer, - ShapeType: () => ShapeType, - ShearTimeline: () => ShearTimeline, - ShearXTimeline: () => ShearXTimeline, - ShearYTimeline: () => ShearYTimeline, - Skeleton: () => Skeleton, - SkeletonBinary: () => SkeletonBinary, - SkeletonBounds: () => SkeletonBounds, - SkeletonClipping: () => SkeletonClipping, - SkeletonData: () => SkeletonData, - SkeletonDebugRenderer: () => SkeletonDebugRenderer, - SkeletonJson: () => SkeletonJson, - SkeletonRenderer: () => SkeletonRenderer, - Skin: () => Skin, - SkinEntry: () => SkinEntry, - SkinsAndAnimationBoundsProvider: () => SkinsAndAnimationBoundsProvider, - Slot: () => Slot, - SlotData: () => SlotData, - SpacingMode: () => SpacingMode, - SpineCanvas: () => SpineCanvas, - SpineGameObject: () => SpineGameObject, - SpinePlugin: () => SpinePlugin, - StringSet: () => StringSet, - TexCoordAttribute: () => TexCoordAttribute, - Texture: () => Texture, - TextureAtlas: () => TextureAtlas, - TextureAtlasPage: () => TextureAtlasPage, - TextureAtlasRegion: () => TextureAtlasRegion, - TextureFilter: () => TextureFilter, - TextureRegion: () => TextureRegion, - TextureWrap: () => TextureWrap, - TimeKeeper: () => TimeKeeper, - Timeline: () => Timeline, - Touch: () => Touch, - TrackEntry: () => TrackEntry, - Transform: () => Transform, - TransformConstraint: () => TransformConstraint, - TransformConstraintData: () => TransformConstraintData, - TransformConstraintTimeline: () => TransformConstraintTimeline, - TransformMixin: () => TransformMixin, - TranslateTimeline: () => TranslateTimeline, - TranslateXTimeline: () => TranslateXTimeline, - TranslateYTimeline: () => TranslateYTimeline, - Triangulator: () => Triangulator, - Utils: () => Utils, - Vector2: () => Vector2, - Vector3: () => Vector3, - VertexAttachment: () => VertexAttachment, - VertexAttribute: () => VertexAttribute, - VertexAttributeType: () => VertexAttributeType, - Visible: () => Visible, - VisibleMixin: () => VisibleMixin, - WindowedMean: () => WindowedMean, - createMixin: () => createMixin - }); - - // spine-phaser-v3/src/require-shim.ts - if (typeof window !== "undefined" && window.Phaser) { - let prevRequire = window.require; - window.require = (x) => { - if (prevRequire) - return prevRequire(x); - else if (x === "Phaser") - return window.Phaser; - }; - } - - // spine-phaser-v3/src/SpinePlugin.ts - var Phaser2 = __toESM(__require("Phaser"), 1); - - // spine-phaser-v3/src/keys.ts - var SPINE_SKELETON_FILE_CACHE_KEY = "esotericsoftware.spine.skeletonFile.cache"; - var SPINE_ATLAS_CACHE_KEY = "esotericsoftware.spine.atlas.cache"; - var SPINE_SKELETON_DATA_FILE_TYPE = "spineSkeletonData"; - var SPINE_ATLAS_FILE_TYPE = "spineAtlasData"; - var SPINE_GAME_OBJECT_TYPE = "spine"; - - // spine-core/src/Utils.ts - var IntSet = class { - array = new Array(); - add(value) { - let contains = this.contains(value); - this.array[value | 0] = value | 0; - return !contains; - } - contains(value) { - return this.array[value | 0] != void 0; - } - remove(value) { - this.array[value | 0] = void 0; - } - clear() { - this.array.length = 0; - } - }; - var StringSet = class { - entries = {}; - size = 0; - add(value) { - let contains = this.entries[value]; - this.entries[value] = true; - if (!contains) { - this.size++; - return true; - } - return false; - } - addAll(values) { - let oldSize = this.size; - for (var i = 0, n = values.length; i < n; i++) - this.add(values[i]); - return oldSize != this.size; - } - contains(value) { - return this.entries[value]; - } - clear() { - this.entries = {}; - this.size = 0; - } - }; - var _Color = class { - constructor(r = 0, g = 0, b = 0, a = 0) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - } - set(r, g, b, a) { - this.r = r; - this.g = g; - this.b = b; - this.a = a; - return this.clamp(); - } - setFromColor(c) { - this.r = c.r; - this.g = c.g; - this.b = c.b; - this.a = c.a; - return this; - } - setFromString(hex) { - hex = hex.charAt(0) == "#" ? hex.substr(1) : hex; - this.r = parseInt(hex.substr(0, 2), 16) / 255; - this.g = parseInt(hex.substr(2, 2), 16) / 255; - this.b = parseInt(hex.substr(4, 2), 16) / 255; - this.a = hex.length != 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255; - return this; - } - add(r, g, b, a) { - this.r += r; - this.g += g; - this.b += b; - this.a += a; - return this.clamp(); - } - clamp() { - if (this.r < 0) - this.r = 0; - else if (this.r > 1) - this.r = 1; - if (this.g < 0) - this.g = 0; - else if (this.g > 1) - this.g = 1; - if (this.b < 0) - this.b = 0; - else if (this.b > 1) - this.b = 1; - if (this.a < 0) - this.a = 0; - else if (this.a > 1) - this.a = 1; - return this; - } - static rgba8888ToColor(color, value) { - color.r = ((value & 4278190080) >>> 24) / 255; - color.g = ((value & 16711680) >>> 16) / 255; - color.b = ((value & 65280) >>> 8) / 255; - color.a = (value & 255) / 255; - } - static rgb888ToColor(color, value) { - color.r = ((value & 16711680) >>> 16) / 255; - color.g = ((value & 65280) >>> 8) / 255; - color.b = (value & 255) / 255; - } - toRgb888() { - const hex = (x) => ("0" + (x * 255).toString(16)).slice(-2); - return Number("0x" + hex(this.r) + hex(this.g) + hex(this.b)); - } - static fromString(hex) { - return new _Color().setFromString(hex); - } - }; - var Color = _Color; - __publicField(Color, "WHITE", new _Color(1, 1, 1, 1)); - __publicField(Color, "RED", new _Color(1, 0, 0, 1)); - __publicField(Color, "GREEN", new _Color(0, 1, 0, 1)); - __publicField(Color, "BLUE", new _Color(0, 0, 1, 1)); - __publicField(Color, "MAGENTA", new _Color(1, 0, 1, 1)); - var _MathUtils = class { - static clamp(value, min, max) { - if (value < min) - return min; - if (value > max) - return max; - return value; - } - static cosDeg(degrees) { - return Math.cos(degrees * _MathUtils.degRad); - } - static sinDeg(degrees) { - return Math.sin(degrees * _MathUtils.degRad); - } - static atan2Deg(y, x) { - return Math.atan2(y, x) * _MathUtils.degRad; - } - static signum(value) { - return value > 0 ? 1 : value < 0 ? -1 : 0; - } - static toInt(x) { - return x > 0 ? Math.floor(x) : Math.ceil(x); - } - static cbrt(x) { - let y = Math.pow(Math.abs(x), 1 / 3); - return x < 0 ? -y : y; - } - static randomTriangular(min, max) { - return _MathUtils.randomTriangularWith(min, max, (min + max) * 0.5); - } - static randomTriangularWith(min, max, mode) { - let u = Math.random(); - let d = max - min; - if (u <= (mode - min) / d) - return min + Math.sqrt(u * d * (mode - min)); - return max - Math.sqrt((1 - u) * d * (max - mode)); - } - static isPowerOfTwo(value) { - return value && (value & value - 1) === 0; - } - }; - var MathUtils = _MathUtils; - __publicField(MathUtils, "PI", 3.1415927); - __publicField(MathUtils, "PI2", _MathUtils.PI * 2); - __publicField(MathUtils, "invPI2", 1 / _MathUtils.PI2); - __publicField(MathUtils, "radiansToDegrees", 180 / _MathUtils.PI); - __publicField(MathUtils, "radDeg", _MathUtils.radiansToDegrees); - __publicField(MathUtils, "degreesToRadians", _MathUtils.PI / 180); - __publicField(MathUtils, "degRad", _MathUtils.degreesToRadians); - var Interpolation = class { - apply(start, end, a) { - return start + (end - start) * this.applyInternal(a); - } - }; - var Pow = class extends Interpolation { - power = 2; - constructor(power) { - super(); - this.power = power; - } - applyInternal(a) { - if (a <= 0.5) - return Math.pow(a * 2, this.power) / 2; - return Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1; - } - }; - var PowOut = class extends Pow { - constructor(power) { - super(power); - } - applyInternal(a) { - return Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1; - } - }; - var _Utils = class { - static arrayCopy(source, sourceStart, dest, destStart, numElements) { - for (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) { - dest[j] = source[i]; - } - } - static arrayFill(array, fromIndex, toIndex, value) { - for (let i = fromIndex; i < toIndex; i++) - array[i] = value; - } - static setArraySize(array, size, value = 0) { - let oldSize = array.length; - if (oldSize == size) - return array; - array.length = size; - if (oldSize < size) { - for (let i = oldSize; i < size; i++) - array[i] = value; - } - return array; - } - static ensureArrayCapacity(array, size, value = 0) { - if (array.length >= size) - return array; - return _Utils.setArraySize(array, size, value); - } - static newArray(size, defaultValue) { - let array = new Array(size); - for (let i = 0; i < size; i++) - array[i] = defaultValue; - return array; - } - static newFloatArray(size) { - if (_Utils.SUPPORTS_TYPED_ARRAYS) - return new Float32Array(size); - else { - let array = new Array(size); - for (let i = 0; i < array.length; i++) - array[i] = 0; - return array; - } - } - static newShortArray(size) { - if (_Utils.SUPPORTS_TYPED_ARRAYS) - return new Int16Array(size); - else { - let array = new Array(size); - for (let i = 0; i < array.length; i++) - array[i] = 0; - return array; - } - } - static toFloatArray(array) { - return _Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array; - } - static toSinglePrecision(value) { - return _Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value; - } - // This function is used to fix WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109 - static webkit602BugfixHelper(alpha, blend) { - } - static contains(array, element, identity = true) { - for (var i = 0; i < array.length; i++) - if (array[i] == element) - return true; - return false; - } - static enumValue(type, name) { - return type[name[0].toUpperCase() + name.slice(1)]; - } - }; - var Utils = _Utils; - __publicField(Utils, "SUPPORTS_TYPED_ARRAYS", typeof Float32Array !== "undefined"); - var DebugUtils = class { - static logBones(skeleton) { - for (let i = 0; i < skeleton.bones.length; i++) { - let bone = skeleton.bones[i]; - console.log(bone.data.name + ", " + bone.a + ", " + bone.b + ", " + bone.c + ", " + bone.d + ", " + bone.worldX + ", " + bone.worldY); - } - } - }; - var Pool = class { - items = new Array(); - instantiator; - constructor(instantiator) { - this.instantiator = instantiator; - } - obtain() { - return this.items.length > 0 ? this.items.pop() : this.instantiator(); - } - free(item) { - if (item.reset) - item.reset(); - this.items.push(item); - } - freeAll(items) { - for (let i = 0; i < items.length; i++) - this.free(items[i]); - } - clear() { - this.items.length = 0; - } - }; - var Vector2 = class { - constructor(x = 0, y = 0) { - this.x = x; - this.y = y; - } - set(x, y) { - this.x = x; - this.y = y; - return this; - } - length() { - let x = this.x; - let y = this.y; - return Math.sqrt(x * x + y * y); - } - normalize() { - let len = this.length(); - if (len != 0) { - this.x /= len; - this.y /= len; - } - return this; - } - }; - var TimeKeeper = class { - maxDelta = 0.064; - framesPerSecond = 0; - delta = 0; - totalTime = 0; - lastTime = Date.now() / 1e3; - frameCount = 0; - frameTime = 0; - update() { - let now = Date.now() / 1e3; - this.delta = now - this.lastTime; - this.frameTime += this.delta; - this.totalTime += this.delta; - if (this.delta > this.maxDelta) - this.delta = this.maxDelta; - this.lastTime = now; - this.frameCount++; - if (this.frameTime > 1) { - this.framesPerSecond = this.frameCount / this.frameTime; - this.frameTime = 0; - this.frameCount = 0; - } - } - }; - var WindowedMean = class { - values; - addedValues = 0; - lastValue = 0; - mean = 0; - dirty = true; - constructor(windowSize = 32) { - this.values = new Array(windowSize); - } - hasEnoughData() { - return this.addedValues >= this.values.length; - } - addValue(value) { - if (this.addedValues < this.values.length) - this.addedValues++; - this.values[this.lastValue++] = value; - if (this.lastValue > this.values.length - 1) - this.lastValue = 0; - this.dirty = true; - } - getMean() { - if (this.hasEnoughData()) { - if (this.dirty) { - let mean = 0; - for (let i = 0; i < this.values.length; i++) - mean += this.values[i]; - this.mean = mean / this.values.length; - this.dirty = false; - } - return this.mean; - } - return 0; - } - }; - - // spine-core/src/attachments/Attachment.ts - var Attachment = class { - name; - constructor(name) { - if (!name) - throw new Error("name cannot be null."); - this.name = name; - } - }; - var _VertexAttachment = class extends Attachment { - /** The unique ID for this attachment. */ - id = _VertexAttachment.nextID++; - /** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting - * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null - * if this attachment has no weights. */ - bones = null; - /** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y` - * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting - * each vertex. */ - vertices = []; - /** The maximum number of world vertex values that can be output by - * {@link #computeWorldVertices()} using the `count` parameter. */ - worldVerticesLength = 0; - /** Timelines for the timeline attachment are also applied to this attachment. - * May be null if no attachment-specific timelines should be applied. */ - timelineAttachment = this; - constructor(name) { - super(name); - } - /** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is - * not empty, it is used to deform the vertices. - * - * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine - * Runtimes Guide. - * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y. - * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`. - * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` * - * `stride` / 2. - * @param offset The `worldVertices` index to begin writing values. - * @param stride The number of `worldVertices` entries between the value pairs written. */ - computeWorldVertices(slot, start, count, worldVertices2, offset, stride) { - count = offset + (count >> 1) * stride; - let skeleton = slot.bone.skeleton; - let deformArray = slot.deform; - let vertices = this.vertices; - let bones = this.bones; - if (!bones) { - if (deformArray.length > 0) - vertices = deformArray; - let bone = slot.bone; - let x = bone.worldX; - let y = bone.worldY; - let a = bone.a, b = bone.b, c = bone.c, d = bone.d; - for (let v2 = start, w = offset; w < count; v2 += 2, w += stride) { - let vx = vertices[v2], vy = vertices[v2 + 1]; - worldVertices2[w] = vx * a + vy * b + x; - worldVertices2[w + 1] = vx * c + vy * d + y; - } - return; - } - let v = 0, skip = 0; - for (let i = 0; i < start; i += 2) { - let n = bones[v]; - v += n + 1; - skip += n; - } - let skeletonBones = skeleton.bones; - if (deformArray.length == 0) { - for (let w = offset, b = skip * 3; w < count; w += stride) { - let wx = 0, wy = 0; - let n = bones[v++]; - n += v; - for (; v < n; v++, b += 3) { - let bone = skeletonBones[bones[v]]; - let vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; - wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; - wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; - } - worldVertices2[w] = wx; - worldVertices2[w + 1] = wy; - } - } else { - let deform = deformArray; - for (let w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { - let wx = 0, wy = 0; - let n = bones[v++]; - n += v; - for (; v < n; v++, b += 3, f += 2) { - let bone = skeletonBones[bones[v]]; - let vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; - wx += (vx * bone.a + vy * bone.b + bone.worldX) * weight; - wy += (vx * bone.c + vy * bone.d + bone.worldY) * weight; - } - worldVertices2[w] = wx; - worldVertices2[w + 1] = wy; - } - } - } - /** Does not copy id (generated) or name (set on construction). **/ - copyTo(attachment) { - if (this.bones) { - attachment.bones = new Array(this.bones.length); - Utils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length); - } else - attachment.bones = null; - if (this.vertices) { - attachment.vertices = Utils.newFloatArray(this.vertices.length); - Utils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length); - } - attachment.worldVerticesLength = this.worldVerticesLength; - attachment.timelineAttachment = this.timelineAttachment; - } - }; - var VertexAttachment = _VertexAttachment; - __publicField(VertexAttachment, "nextID", 0); - - // spine-core/src/attachments/Sequence.ts - var _Sequence = class { - id = _Sequence.nextID(); - regions; - start = 0; - digits = 0; - /** The index of the region to show for the setup pose. */ - setupIndex = 0; - constructor(count) { - this.regions = new Array(count); - } - copy() { - let copy = new _Sequence(this.regions.length); - Utils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length); - copy.start = this.start; - copy.digits = this.digits; - copy.setupIndex = this.setupIndex; - return copy; - } - apply(slot, attachment) { - let index = slot.sequenceIndex; - if (index == -1) - index = this.setupIndex; - if (index >= this.regions.length) - index = this.regions.length - 1; - let region = this.regions[index]; - if (attachment.region != region) { - attachment.region = region; - attachment.updateRegion(); - } - } - getPath(basePath, index) { - let result = basePath; - let frame = (this.start + index).toString(); - for (let i = this.digits - frame.length; i > 0; i--) - result += "0"; - result += frame; - return result; - } - static nextID() { - return _Sequence._nextID++; - } - }; - var Sequence = _Sequence; - __publicField(Sequence, "_nextID", 0); - var SequenceMode = /* @__PURE__ */ ((SequenceMode2) => { - SequenceMode2[SequenceMode2["hold"] = 0] = "hold"; - SequenceMode2[SequenceMode2["once"] = 1] = "once"; - SequenceMode2[SequenceMode2["loop"] = 2] = "loop"; - SequenceMode2[SequenceMode2["pingpong"] = 3] = "pingpong"; - SequenceMode2[SequenceMode2["onceReverse"] = 4] = "onceReverse"; - SequenceMode2[SequenceMode2["loopReverse"] = 5] = "loopReverse"; - SequenceMode2[SequenceMode2["pingpongReverse"] = 6] = "pingpongReverse"; - return SequenceMode2; - })(SequenceMode || {}); - var SequenceModeValues = [ - 0 /* hold */, - 1 /* once */, - 2 /* loop */, - 3 /* pingpong */, - 4 /* onceReverse */, - 5 /* loopReverse */, - 6 /* pingpongReverse */ - ]; - - // spine-core/src/Animation.ts - var Animation = class { - /** The animation's name, which is unique across all animations in the skeleton. */ - name; - timelines = []; - timelineIds = new StringSet(); - /** The duration of the animation in seconds, which is the highest time of all keys in the timeline. */ - duration; - constructor(name, timelines, duration) { - if (!name) - throw new Error("name cannot be null."); - this.name = name; - this.setTimelines(timelines); - this.duration = duration; - } - setTimelines(timelines) { - if (!timelines) - throw new Error("timelines cannot be null."); - this.timelines = timelines; - this.timelineIds.clear(); - for (var i = 0; i < timelines.length; i++) - this.timelineIds.addAll(timelines[i].getPropertyIds()); - } - hasTimeline(ids) { - for (let i = 0; i < ids.length; i++) - if (this.timelineIds.contains(ids[i])) - return true; - return false; - } - /** Applies all the animation's timelines to the specified skeleton. - * - * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. - * @param loop If true, the animation repeats after {@link #getDuration()}. - * @param events May be null to ignore fired events. */ - apply(skeleton, lastTime, time, loop, events, alpha, blend, direction) { - if (!skeleton) - throw new Error("skeleton cannot be null."); - if (loop && this.duration != 0) { - time %= this.duration; - if (lastTime > 0) - lastTime %= this.duration; - } - let timelines = this.timelines; - for (let i = 0, n = timelines.length; i < n; i++) - timelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction); - } - }; - var MixBlend = /* @__PURE__ */ ((MixBlend2) => { - MixBlend2[MixBlend2["setup"] = 0] = "setup"; - MixBlend2[MixBlend2["first"] = 1] = "first"; - MixBlend2[MixBlend2["replace"] = 2] = "replace"; - MixBlend2[MixBlend2["add"] = 3] = "add"; - return MixBlend2; - })(MixBlend || {}); - var MixDirection = /* @__PURE__ */ ((MixDirection2) => { - MixDirection2[MixDirection2["mixIn"] = 0] = "mixIn"; - MixDirection2[MixDirection2["mixOut"] = 1] = "mixOut"; - return MixDirection2; - })(MixDirection || {}); - var Property = { - rotate: 0, - x: 1, - y: 2, - scaleX: 3, - scaleY: 4, - shearX: 5, - shearY: 6, - inherit: 7, - rgb: 8, - alpha: 9, - rgb2: 10, - attachment: 11, - deform: 12, - event: 13, - drawOrder: 14, - ikConstraint: 15, - transformConstraint: 16, - pathConstraintPosition: 17, - pathConstraintSpacing: 18, - pathConstraintMix: 19, - physicsConstraintInertia: 20, - physicsConstraintStrength: 21, - physicsConstraintDamping: 22, - physicsConstraintMass: 23, - physicsConstraintWind: 24, - physicsConstraintGravity: 25, - physicsConstraintMix: 26, - physicsConstraintReset: 27, - sequence: 28 - }; - var Timeline = class { - propertyIds; - frames; - constructor(frameCount, propertyIds) { - this.propertyIds = propertyIds; - this.frames = Utils.newFloatArray(frameCount * this.getFrameEntries()); - } - getPropertyIds() { - return this.propertyIds; - } - getFrameEntries() { - return 1; - } - getFrameCount() { - return this.frames.length / this.getFrameEntries(); - } - getDuration() { - return this.frames[this.frames.length - this.getFrameEntries()]; - } - static search1(frames, time) { - let n = frames.length; - for (let i = 1; i < n; i++) - if (frames[i] > time) - return i - 1; - return n - 1; - } - static search(frames, time, step) { - let n = frames.length; - for (let i = step; i < n; i += step) - if (frames[i] > time) - return i - step; - return n - step; - } - }; - var CurveTimeline = class extends Timeline { - curves; - // type, x, y, ... - constructor(frameCount, bezierCount, propertyIds) { - super(frameCount, propertyIds); - this.curves = Utils.newFloatArray( - frameCount + bezierCount * 18 - /*BEZIER_SIZE*/ - ); - this.curves[frameCount - 1] = 1; - } - /** Sets the specified key frame to linear interpolation. */ - setLinear(frame) { - this.curves[frame] = 0; - } - /** Sets the specified key frame to stepped interpolation. */ - setStepped(frame) { - this.curves[frame] = 1; - } - /** Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger - * than the actual number of Bezier curves. */ - shrink(bezierCount) { - let size = this.getFrameCount() + bezierCount * 18; - if (this.curves.length > size) { - let newCurves = Utils.newFloatArray(size); - Utils.arrayCopy(this.curves, 0, newCurves, 0, size); - this.curves = newCurves; - } - } - /** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than - * one curve per frame. - * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified - * in the constructor), inclusive. - * @param frame Between 0 and frameCount - 1, inclusive. - * @param value The index of the value for this frame that this curve is used for. - * @param time1 The time for the first key. - * @param value1 The value for the first key. - * @param cx1 The time for the first Bezier handle. - * @param cy1 The value for the first Bezier handle. - * @param cx2 The time of the second Bezier handle. - * @param cy2 The value for the second Bezier handle. - * @param time2 The time for the second key. - * @param value2 The value for the second key. */ - setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) { - let curves = this.curves; - let i = this.getFrameCount() + bezier * 18; - if (value == 0) - curves[frame] = 2 + i; - let tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03; - let dddx = ((cx1 - cx2) * 3 - time1 + time2) * 6e-3, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 6e-3; - let ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy; - let dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667; - let x = time1 + dx, y = value1 + dy; - for (let n = i + 18; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dx += ddx; - dy += ddy; - ddx += dddx; - ddy += dddy; - x += dx; - y += dy; - } - } - /** Returns the Bezier interpolated value for the specified time. - * @param frameIndex The index into {@link #getFrames()} for the values of the frame before time. - * @param valueOffset The offset from frameIndex to the value this curve is used for. - * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */ - getBezierValue(time, frameIndex, valueOffset, i) { - let curves = this.curves; - if (curves[i] > time) { - let x2 = this.frames[frameIndex], y2 = this.frames[frameIndex + valueOffset]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - let n = i + 18; - for (i += 2; i < n; i += 2) { - if (curves[i] >= time) { - let x2 = curves[i - 2], y2 = curves[i - 1]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - } - frameIndex += this.getFrameEntries(); - let x = curves[n - 2], y = curves[n - 1]; - return y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y); - } - }; - var CurveTimeline1 = class extends CurveTimeline { - constructor(frameCount, bezierCount, propertyId) { - super(frameCount, bezierCount, [propertyId]); - } - getFrameEntries() { - return 2; - } - /** Sets the time and value for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, value) { - frame <<= 1; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*VALUE*/ - ] = value; - } - /** Returns the interpolated value for the specified time. */ - getCurveValue(time) { - let frames = this.frames; - let i = frames.length - 2; - for (let ii = 2; ii <= i; ii += 2) { - if (frames[ii] > time) { - i = ii - 2; - break; - } - } - let curveType = this.curves[i >> 1]; - switch (curveType) { - case 0: - let before = frames[i], value = frames[ - i + 1 - /*VALUE*/ - ]; - return value + (time - before) / (frames[ - i + 2 - /*ENTRIES*/ - ] - before) * (frames[ - i + 2 + 1 - /*VALUE*/ - ] - value); - case 1: - return frames[ - i + 1 - /*VALUE*/ - ]; - } - return this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - } - getRelativeValue(time, alpha, blend, current, setup) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - let value = this.getCurveValue(time); - switch (blend) { - case 0 /* setup */: - return setup + value * alpha; - case 1 /* first */: - case 2 /* replace */: - value += setup - current; - } - return current + value * alpha; - } - getAbsoluteValue(time, alpha, blend, current, setup) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - let value = this.getCurveValue(time); - if (blend == 0 /* setup */) - return setup + (value - setup) * alpha; - return current + (value - current) * alpha; - } - getAbsoluteValue2(time, alpha, blend, current, setup, value) { - if (time < this.frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - if (blend == 0 /* setup */) - return setup + (value - setup) * alpha; - return current + (value - current) * alpha; - } - getScaleValue(time, alpha, blend, direction, current, setup) { - const frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - return setup; - case 1 /* first */: - return current + (setup - current) * alpha; - } - return current; - } - let value = this.getCurveValue(time) * setup; - if (alpha == 1) { - if (blend == 3 /* add */) - return current + value - setup; - return value; - } - if (direction == 1 /* mixOut */) { - switch (blend) { - case 0 /* setup */: - return setup + (Math.abs(value) * MathUtils.signum(setup) - setup) * alpha; - case 1 /* first */: - case 2 /* replace */: - return current + (Math.abs(value) * MathUtils.signum(current) - current) * alpha; - } - } else { - let s = 0; - switch (blend) { - case 0 /* setup */: - s = Math.abs(setup) * MathUtils.signum(value); - return s + (value - s) * alpha; - case 1 /* first */: - case 2 /* replace */: - s = Math.abs(current) * MathUtils.signum(value); - return s + (value - s) * alpha; - } - } - return current + (value - setup) * alpha; - } - }; - var CurveTimeline2 = class extends CurveTimeline { - /** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}. - * @param propertyIds Unique identifiers for the properties the timeline modifies. */ - constructor(frameCount, bezierCount, propertyId1, propertyId2) { - super(frameCount, bezierCount, [propertyId1, propertyId2]); - } - getFrameEntries() { - return 3; - } - /** Sets the time and values for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, value1, value2) { - frame *= 3; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*VALUE1*/ - ] = value1; - this.frames[ - frame + 2 - /*VALUE2*/ - ] = value2; - } - }; - var RotateTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.rotate + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.rotation = this.getRelativeValue(time, alpha, blend, bone.rotation, bone.data.rotation); - } - }; - var TranslateTimeline = class extends CurveTimeline2 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super( - frameCount, - bezierCount, - Property.x + "|" + boneIndex, - Property.y + "|" + boneIndex - ); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (!bone.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - bone.x = bone.data.x; - bone.y = bone.data.y; - return; - case 1 /* first */: - bone.x += (bone.data.x - bone.x) * alpha; - bone.y += (bone.data.y - bone.y) * alpha; - } - return; - } - let x = 0, y = 0; - let i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - let t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: - bone.x = bone.data.x + x * alpha; - bone.y = bone.data.y + y * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bone.x += (bone.data.x + x - bone.x) * alpha; - bone.y += (bone.data.y + y - bone.y) * alpha; - break; - case 3 /* add */: - bone.x += x * alpha; - bone.y += y * alpha; - } - } - }; - var TranslateXTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.x + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.x = this.getRelativeValue(time, alpha, blend, bone.x, bone.data.x); - } - }; - var TranslateYTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.y + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.y = this.getRelativeValue(time, alpha, blend, bone.y, bone.data.y); - } - }; - var ScaleTimeline = class extends CurveTimeline2 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super( - frameCount, - bezierCount, - Property.scaleX + "|" + boneIndex, - Property.scaleY + "|" + boneIndex - ); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (!bone.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - bone.scaleX = bone.data.scaleX; - bone.scaleY = bone.data.scaleY; - return; - case 1 /* first */: - bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha; - bone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha; - } - return; - } - let x, y; - let i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - let t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - x *= bone.data.scaleX; - y *= bone.data.scaleY; - if (alpha == 1) { - if (blend == 3 /* add */) { - bone.scaleX += x - bone.data.scaleX; - bone.scaleY += y - bone.data.scaleY; - } else { - bone.scaleX = x; - bone.scaleY = y; - } - } else { - let bx = 0, by = 0; - if (direction == 1 /* mixOut */) { - switch (blend) { - case 0 /* setup */: - bx = bone.data.scaleX; - by = bone.data.scaleY; - bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha; - bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bx = bone.scaleX; - by = bone.scaleY; - bone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha; - bone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha; - break; - case 3 /* add */: - bone.scaleX += (x - bone.data.scaleX) * alpha; - bone.scaleY += (y - bone.data.scaleY) * alpha; - } - } else { - switch (blend) { - case 0 /* setup */: - bx = Math.abs(bone.data.scaleX) * MathUtils.signum(x); - by = Math.abs(bone.data.scaleY) * MathUtils.signum(y); - bone.scaleX = bx + (x - bx) * alpha; - bone.scaleY = by + (y - by) * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bx = Math.abs(bone.scaleX) * MathUtils.signum(x); - by = Math.abs(bone.scaleY) * MathUtils.signum(y); - bone.scaleX = bx + (x - bx) * alpha; - bone.scaleY = by + (y - by) * alpha; - break; - case 3 /* add */: - bone.scaleX += (x - bone.data.scaleX) * alpha; - bone.scaleY += (y - bone.data.scaleY) * alpha; - } - } - } - } - }; - var ScaleXTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.scaleX + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.scaleX = this.getScaleValue(time, alpha, blend, direction, bone.scaleX, bone.data.scaleX); - } - }; - var ScaleYTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.scaleY + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.scaleY, bone.data.scaleY); - } - }; - var ShearTimeline = class extends CurveTimeline2 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super( - frameCount, - bezierCount, - Property.shearX + "|" + boneIndex, - Property.shearY + "|" + boneIndex - ); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (!bone.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - bone.shearX = bone.data.shearX; - bone.shearY = bone.data.shearY; - return; - case 1 /* first */: - bone.shearX += (bone.data.shearX - bone.shearX) * alpha; - bone.shearY += (bone.data.shearY - bone.shearY) * alpha; - } - return; - } - let x = 0, y = 0; - let i = Timeline.search( - frames, - time, - 3 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 3 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - let t = (time - before) / (frames[ - i + 3 - /*ENTRIES*/ - ] - before); - x += (frames[ - i + 3 + 1 - /*VALUE1*/ - ] - x) * t; - y += (frames[ - i + 3 + 2 - /*VALUE2*/ - ] - y) * t; - break; - case 1: - x = frames[ - i + 1 - /*VALUE1*/ - ]; - y = frames[ - i + 2 - /*VALUE2*/ - ]; - break; - default: - x = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - switch (blend) { - case 0 /* setup */: - bone.shearX = bone.data.shearX + x * alpha; - bone.shearY = bone.data.shearY + y * alpha; - break; - case 1 /* first */: - case 2 /* replace */: - bone.shearX += (bone.data.shearX + x - bone.shearX) * alpha; - bone.shearY += (bone.data.shearY + y - bone.shearY) * alpha; - break; - case 3 /* add */: - bone.shearX += x * alpha; - bone.shearY += y * alpha; - } - } - }; - var ShearXTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.shearX + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.shearX = this.getRelativeValue(time, alpha, blend, bone.shearX, bone.data.shearX); - } - }; - var ShearYTimeline = class extends CurveTimeline1 { - boneIndex = 0; - constructor(frameCount, bezierCount, boneIndex) { - super(frameCount, bezierCount, Property.shearY + "|" + boneIndex); - this.boneIndex = boneIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (bone.active) - bone.shearY = this.getRelativeValue(time, alpha, blend, bone.shearY, bone.data.shearY); - } - }; - var InheritTimeline = class extends Timeline { - boneIndex = 0; - constructor(frameCount, boneIndex) { - super(frameCount, [Property.inherit + "|" + boneIndex]); - this.boneIndex = boneIndex; - } - getFrameEntries() { - return 2; - } - /** Sets the transform mode for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time The frame time in seconds. */ - setFrame(frame, time, inherit) { - frame *= 2; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*INHERIT*/ - ] = inherit; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let bone = skeleton.bones[this.boneIndex]; - if (!bone.active) - return; - if (direction == 1 /* mixOut */) { - if (blend == 0 /* setup */) - bone.inherit = bone.data.inherit; - return; - } - let frames = this.frames; - if (time < frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - bone.inherit = bone.data.inherit; - return; - } - bone.inherit = this.frames[ - Timeline.search( - frames, - time, - 2 - /*ENTRIES*/ - ) + 1 - /*INHERIT*/ - ]; - } - }; - var RGBATimeline = class extends CurveTimeline { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, [ - Property.rgb + "|" + slotIndex, - Property.alpha + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - } - getFrameEntries() { - return 5; - } - /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */ - setFrame(frame, time, r, g, b, a) { - frame *= 5; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*A*/ - ] = a; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let frames = this.frames; - let color = slot.color; - if (time < frames[0]) { - let setup = slot.data.color; - switch (blend) { - case 0 /* setup */: - color.setFromColor(setup); - return; - case 1 /* first */: - color.add( - (setup.r - color.r) * alpha, - (setup.g - color.g) * alpha, - (setup.b - color.b) * alpha, - (setup.a - color.a) * alpha - ); - } - return; - } - let r = 0, g = 0, b = 0, a = 0; - let i = Timeline.search( - frames, - time, - 5 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 5 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - let t = (time - before) / (frames[ - i + 5 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 5 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 5 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 5 + 3 - /*B*/ - ] - b) * t; - a += (frames[ - i + 5 + 4 - /*A*/ - ] - a) * t; - break; - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - a = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - } - if (alpha == 1) - color.set(r, g, b, a); - else { - if (blend == 0 /* setup */) - color.setFromColor(slot.data.color); - color.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha); - } - } - }; - var RGBTimeline = class extends CurveTimeline { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, [ - Property.rgb + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - } - getFrameEntries() { - return 4; - } - /** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */ - setFrame(frame, time, r, g, b) { - frame <<= 2; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let frames = this.frames; - let color = slot.color; - if (time < frames[0]) { - let setup = slot.data.color; - switch (blend) { - case 0 /* setup */: - color.r = setup.r; - color.g = setup.g; - color.b = setup.b; - return; - case 1 /* first */: - color.r += (setup.r - color.r) * alpha; - color.g += (setup.g - color.g) * alpha; - color.b += (setup.b - color.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0; - let i = Timeline.search( - frames, - time, - 4 - /*ENTRIES*/ - ); - let curveType = this.curves[i >> 2]; - switch (curveType) { - case 0: - let before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - let t = (time - before) / (frames[ - i + 4 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 4 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 4 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 4 + 3 - /*B*/ - ] - b) * t; - break; - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - } - if (alpha == 1) { - color.r = r; - color.g = g; - color.b = b; - } else { - if (blend == 0 /* setup */) { - let setup = slot.data.color; - color.r = setup.r; - color.g = setup.g; - color.b = setup.b; - } - color.r += (r - color.r) * alpha; - color.g += (g - color.g) * alpha; - color.b += (b - color.b) * alpha; - } - } - }; - var AlphaTimeline = class extends CurveTimeline1 { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, Property.alpha + "|" + slotIndex); - this.slotIndex = slotIndex; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let color = slot.color; - if (time < this.frames[0]) { - let setup = slot.data.color; - switch (blend) { - case 0 /* setup */: - color.a = setup.a; - return; - case 1 /* first */: - color.a += (setup.a - color.a) * alpha; - } - return; - } - let a = this.getCurveValue(time); - if (alpha == 1) - color.a = a; - else { - if (blend == 0 /* setup */) - color.a = slot.data.color.a; - color.a += (a - color.a) * alpha; - } - } - }; - var RGBA2Timeline = class extends CurveTimeline { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, [ - Property.rgb + "|" + slotIndex, - Property.alpha + "|" + slotIndex, - Property.rgb2 + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - } - getFrameEntries() { - return 8; - } - /** Sets the time in seconds, light, and dark colors for the specified key frame. */ - setFrame(frame, time, r, g, b, a, r2, g2, b2) { - frame <<= 3; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*A*/ - ] = a; - this.frames[ - frame + 5 - /*R2*/ - ] = r2; - this.frames[ - frame + 6 - /*G2*/ - ] = g2; - this.frames[ - frame + 7 - /*B2*/ - ] = b2; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let frames = this.frames; - let light = slot.color, dark = slot.darkColor; - if (time < frames[0]) { - let setupLight = slot.data.color, setupDark = slot.data.darkColor; - switch (blend) { - case 0 /* setup */: - light.setFromColor(setupLight); - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - return; - case 1 /* first */: - light.add( - (setupLight.r - light.r) * alpha, - (setupLight.g - light.g) * alpha, - (setupLight.b - light.b) * alpha, - (setupLight.a - light.a) * alpha - ); - dark.r += (setupDark.r - dark.r) * alpha; - dark.g += (setupDark.g - dark.g) * alpha; - dark.b += (setupDark.b - dark.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; - let i = Timeline.search( - frames, - time, - 8 - /*ENTRIES*/ - ); - let curveType = this.curves[i >> 3]; - switch (curveType) { - case 0: - let before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - r2 = frames[ - i + 5 - /*R2*/ - ]; - g2 = frames[ - i + 6 - /*G2*/ - ]; - b2 = frames[ - i + 7 - /*B2*/ - ]; - let t = (time - before) / (frames[ - i + 8 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 8 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 8 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 8 + 3 - /*B*/ - ] - b) * t; - a += (frames[ - i + 8 + 4 - /*A*/ - ] - a) * t; - r2 += (frames[ - i + 8 + 5 - /*R2*/ - ] - r2) * t; - g2 += (frames[ - i + 8 + 6 - /*G2*/ - ] - g2) * t; - b2 += (frames[ - i + 8 + 7 - /*B2*/ - ] - b2) * t; - break; - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - a = frames[ - i + 4 - /*A*/ - ]; - r2 = frames[ - i + 5 - /*R2*/ - ]; - g2 = frames[ - i + 6 - /*G2*/ - ]; - b2 = frames[ - i + 7 - /*B2*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - a = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - r2 = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - g2 = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - b2 = this.getBezierValue( - time, - i, - 7, - curveType + 18 * 6 - 2 - /*BEZIER*/ - ); - } - if (alpha == 1) { - light.set(r, g, b, a); - dark.r = r2; - dark.g = g2; - dark.b = b2; - } else { - if (blend == 0 /* setup */) { - light.setFromColor(slot.data.color); - let setupDark = slot.data.darkColor; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - } - light.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha); - dark.r += (r2 - dark.r) * alpha; - dark.g += (g2 - dark.g) * alpha; - dark.b += (b2 - dark.b) * alpha; - } - } - }; - var RGB2Timeline = class extends CurveTimeline { - slotIndex = 0; - constructor(frameCount, bezierCount, slotIndex) { - super(frameCount, bezierCount, [ - Property.rgb + "|" + slotIndex, - Property.rgb2 + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - } - getFrameEntries() { - return 7; - } - /** Sets the time in seconds, light, and dark colors for the specified key frame. */ - setFrame(frame, time, r, g, b, r2, g2, b2) { - frame *= 7; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*R*/ - ] = r; - this.frames[ - frame + 2 - /*G*/ - ] = g; - this.frames[ - frame + 3 - /*B*/ - ] = b; - this.frames[ - frame + 4 - /*R2*/ - ] = r2; - this.frames[ - frame + 5 - /*G2*/ - ] = g2; - this.frames[ - frame + 6 - /*B2*/ - ] = b2; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let frames = this.frames; - let light = slot.color, dark = slot.darkColor; - if (time < frames[0]) { - let setupLight = slot.data.color, setupDark = slot.data.darkColor; - switch (blend) { - case 0 /* setup */: - light.r = setupLight.r; - light.g = setupLight.g; - light.b = setupLight.b; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - return; - case 1 /* first */: - light.r += (setupLight.r - light.r) * alpha; - light.g += (setupLight.g - light.g) * alpha; - light.b += (setupLight.b - light.b) * alpha; - dark.r += (setupDark.r - dark.r) * alpha; - dark.g += (setupDark.g - dark.g) * alpha; - dark.b += (setupDark.b - dark.b) * alpha; - } - return; - } - let r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0; - let i = Timeline.search( - frames, - time, - 7 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 7 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - r2 = frames[ - i + 4 - /*R2*/ - ]; - g2 = frames[ - i + 5 - /*G2*/ - ]; - b2 = frames[ - i + 6 - /*B2*/ - ]; - let t = (time - before) / (frames[ - i + 7 - /*ENTRIES*/ - ] - before); - r += (frames[ - i + 7 + 1 - /*R*/ - ] - r) * t; - g += (frames[ - i + 7 + 2 - /*G*/ - ] - g) * t; - b += (frames[ - i + 7 + 3 - /*B*/ - ] - b) * t; - r2 += (frames[ - i + 7 + 4 - /*R2*/ - ] - r2) * t; - g2 += (frames[ - i + 7 + 5 - /*G2*/ - ] - g2) * t; - b2 += (frames[ - i + 7 + 6 - /*B2*/ - ] - b2) * t; - break; - case 1: - r = frames[ - i + 1 - /*R*/ - ]; - g = frames[ - i + 2 - /*G*/ - ]; - b = frames[ - i + 3 - /*B*/ - ]; - r2 = frames[ - i + 4 - /*R2*/ - ]; - g2 = frames[ - i + 5 - /*G2*/ - ]; - b2 = frames[ - i + 6 - /*B2*/ - ]; - break; - default: - r = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - g = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - b = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - r2 = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - g2 = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - b2 = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - } - if (alpha == 1) { - light.r = r; - light.g = g; - light.b = b; - dark.r = r2; - dark.g = g2; - dark.b = b2; - } else { - if (blend == 0 /* setup */) { - let setupLight = slot.data.color, setupDark = slot.data.darkColor; - light.r = setupLight.r; - light.g = setupLight.g; - light.b = setupLight.b; - dark.r = setupDark.r; - dark.g = setupDark.g; - dark.b = setupDark.b; - } - light.r += (r - light.r) * alpha; - light.g += (g - light.g) * alpha; - light.b += (b - light.b) * alpha; - dark.r += (r2 - dark.r) * alpha; - dark.g += (g2 - dark.g) * alpha; - dark.b += (b2 - dark.b) * alpha; - } - } - }; - var AttachmentTimeline = class extends Timeline { - slotIndex = 0; - /** The attachment name for each key frame. May contain null values to clear the attachment. */ - attachmentNames; - constructor(frameCount, slotIndex) { - super(frameCount, [ - Property.attachment + "|" + slotIndex - ]); - this.slotIndex = slotIndex; - this.attachmentNames = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the attachment name for the specified key frame. */ - setFrame(frame, time, attachmentName) { - this.frames[frame] = time; - this.attachmentNames[frame] = attachmentName; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - if (direction == 1 /* mixOut */) { - if (blend == 0 /* setup */) - this.setAttachment(skeleton, slot, slot.data.attachmentName); - return; - } - if (time < this.frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - this.setAttachment(skeleton, slot, slot.data.attachmentName); - return; - } - this.setAttachment(skeleton, slot, this.attachmentNames[Timeline.search1(this.frames, time)]); - } - setAttachment(skeleton, slot, attachmentName) { - slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName)); - } - }; - var DeformTimeline = class extends CurveTimeline { - slotIndex = 0; - /** The attachment that will be deformed. */ - attachment; - /** The vertices for each key frame. */ - vertices; - constructor(frameCount, bezierCount, slotIndex, attachment) { - super(frameCount, bezierCount, [ - Property.deform + "|" + slotIndex + "|" + attachment.id - ]); - this.slotIndex = slotIndex; - this.attachment = attachment; - this.vertices = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the vertices for the specified key frame. - * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */ - setFrame(frame, time, vertices) { - this.frames[frame] = time; - this.vertices[frame] = vertices; - } - /** @param value1 Ignored (0 is used for a deform timeline). - * @param value2 Ignored (1 is used for a deform timeline). */ - setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2) { - let curves = this.curves; - let i = this.getFrameCount() + bezier * 18; - if (value == 0) - curves[frame] = 2 + i; - let tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06; - let dddx = ((cx1 - cx2) * 3 - time1 + time2) * 6e-3, dddy = (cy1 - cy2 + 0.33333333) * 0.018; - let ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy; - let dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667; - let x = time1 + dx, y = dy; - for (let n = i + 18; i < n; i += 2) { - curves[i] = x; - curves[i + 1] = y; - dx += ddx; - dy += ddy; - ddx += dddx; - ddy += dddy; - x += dx; - y += dy; - } - } - getCurvePercent(time, frame) { - let curves = this.curves; - let i = curves[frame]; - switch (i) { - case 0: - let x2 = this.frames[frame]; - return (time - x2) / (this.frames[frame + this.getFrameEntries()] - x2); - case 1: - return 0; - } - i -= 2; - if (curves[i] > time) { - let x2 = this.frames[frame]; - return curves[i + 1] * (time - x2) / (curves[i] - x2); - } - let n = i + 18; - for (i += 2; i < n; i += 2) { - if (curves[i] >= time) { - let x2 = curves[i - 2], y2 = curves[i - 1]; - return y2 + (time - x2) / (curves[i] - x2) * (curves[i + 1] - y2); - } - } - let x = curves[n - 2], y = curves[n - 1]; - return y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x); - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let slotAttachment = slot.getAttachment(); - if (!slotAttachment) - return; - if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != this.attachment) - return; - let deform = slot.deform; - if (deform.length == 0) - blend = 0 /* setup */; - let vertices = this.vertices; - let vertexCount = vertices[0].length; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - deform.length = 0; - return; - case 1 /* first */: - if (alpha == 1) { - deform.length = 0; - return; - } - deform.length = vertexCount; - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (var i = 0; i < vertexCount; i++) - deform[i] += (setupVertices[i] - deform[i]) * alpha; - } else { - alpha = 1 - alpha; - for (var i = 0; i < vertexCount; i++) - deform[i] *= alpha; - } - } - return; - } - deform.length = vertexCount; - if (time >= frames[frames.length - 1]) { - let lastVertices = vertices[frames.length - 1]; - if (alpha == 1) { - if (blend == 3 /* add */) { - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += lastVertices[i2] - setupVertices[i2]; - } else { - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += lastVertices[i2]; - } - } else - Utils.arrayCopy(lastVertices, 0, deform, 0, vertexCount); - } else { - switch (blend) { - case 0 /* setup */: { - let vertexAttachment2 = slotAttachment; - if (!vertexAttachment2.bones) { - let setupVertices = vertexAttachment2.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) { - let setup = setupVertices[i2]; - deform[i2] = setup + (lastVertices[i2] - setup) * alpha; - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] = lastVertices[i2] * alpha; - } - break; - } - case 1 /* first */: - case 2 /* replace */: - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += (lastVertices[i2] - deform[i2]) * alpha; - break; - case 3 /* add */: - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += (lastVertices[i2] - setupVertices[i2]) * alpha; - } else { - for (let i2 = 0; i2 < vertexCount; i2++) - deform[i2] += lastVertices[i2] * alpha; - } - } - } - return; - } - let frame = Timeline.search1(frames, time); - let percent = this.getCurvePercent(time, frame); - let prevVertices = vertices[frame]; - let nextVertices = vertices[frame + 1]; - if (alpha == 1) { - if (blend == 3 /* add */) { - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += prev + (nextVertices[i2] - prev) * percent - setupVertices[i2]; - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += prev + (nextVertices[i2] - prev) * percent; - } - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] = prev + (nextVertices[i2] - prev) * percent; - } - } - } else { - switch (blend) { - case 0 /* setup */: { - let vertexAttachment2 = slotAttachment; - if (!vertexAttachment2.bones) { - let setupVertices = vertexAttachment2.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2], setup = setupVertices[i2]; - deform[i2] = setup + (prev + (nextVertices[i2] - prev) * percent - setup) * alpha; - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] = (prev + (nextVertices[i2] - prev) * percent) * alpha; - } - } - break; - } - case 1 /* first */: - case 2 /* replace */: - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += (prev + (nextVertices[i2] - prev) * percent - deform[i2]) * alpha; - } - break; - case 3 /* add */: - let vertexAttachment = slotAttachment; - if (!vertexAttachment.bones) { - let setupVertices = vertexAttachment.vertices; - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += (prev + (nextVertices[i2] - prev) * percent - setupVertices[i2]) * alpha; - } - } else { - for (let i2 = 0; i2 < vertexCount; i2++) { - let prev = prevVertices[i2]; - deform[i2] += (prev + (nextVertices[i2] - prev) * percent) * alpha; - } - } - } - } - } - }; - var _EventTimeline = class extends Timeline { - /** The event for each key frame. */ - events; - constructor(frameCount) { - super(frameCount, _EventTimeline.propertyIds); - this.events = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the event for the specified key frame. */ - setFrame(frame, event) { - this.frames[frame] = event.time; - this.events[frame] = event; - } - /** Fires events for frames > `lastTime` and <= `time`. */ - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - if (!firedEvents) - return; - let frames = this.frames; - let frameCount = this.frames.length; - if (lastTime > time) { - this.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction); - lastTime = -1; - } else if (lastTime >= frames[frameCount - 1]) - return; - if (time < frames[0]) - return; - let i = 0; - if (lastTime < frames[0]) - i = 0; - else { - i = Timeline.search1(frames, lastTime) + 1; - let frameTime = frames[i]; - while (i > 0) { - if (frames[i - 1] != frameTime) - break; - i--; - } - } - for (; i < frameCount && time >= frames[i]; i++) - firedEvents.push(this.events[i]); - } - }; - var EventTimeline = _EventTimeline; - __publicField(EventTimeline, "propertyIds", ["" + Property.event]); - var _DrawOrderTimeline = class extends Timeline { - /** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */ - drawOrders; - constructor(frameCount) { - super(frameCount, _DrawOrderTimeline.propertyIds); - this.drawOrders = new Array(frameCount); - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time in seconds and the draw order for the specified key frame. - * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose - * draw order. */ - setFrame(frame, time, drawOrder) { - this.frames[frame] = time; - this.drawOrders[frame] = drawOrder; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - if (direction == 1 /* mixOut */) { - if (blend == 0 /* setup */) - Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - if (time < this.frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - return; - } - let idx = Timeline.search1(this.frames, time); - let drawOrderToSetupIndex = this.drawOrders[idx]; - if (!drawOrderToSetupIndex) - Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length); - else { - let drawOrder = skeleton.drawOrder; - let slots = skeleton.slots; - for (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++) - drawOrder[i] = slots[drawOrderToSetupIndex[i]]; - } - } - }; - var DrawOrderTimeline = _DrawOrderTimeline; - __publicField(DrawOrderTimeline, "propertyIds", ["" + Property.drawOrder]); - var IkConstraintTimeline = class extends CurveTimeline { - /** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is applied */ - constraintIndex = 0; - constructor(frameCount, bezierCount, ikConstraintIndex) { - super(frameCount, bezierCount, [ - Property.ikConstraint + "|" + ikConstraintIndex - ]); - this.constraintIndex = ikConstraintIndex; - } - getFrameEntries() { - return 6; - } - /** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */ - setFrame(frame, time, mix, softness, bendDirection, compress, stretch) { - frame *= 6; - this.frames[frame] = time; - this.frames[ - frame + 1 - /*MIX*/ - ] = mix; - this.frames[ - frame + 2 - /*SOFTNESS*/ - ] = softness; - this.frames[ - frame + 3 - /*BEND_DIRECTION*/ - ] = bendDirection; - this.frames[ - frame + 4 - /*COMPRESS*/ - ] = compress ? 1 : 0; - this.frames[ - frame + 5 - /*STRETCH*/ - ] = stretch ? 1 : 0; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.ikConstraints[this.constraintIndex]; - if (!constraint.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - constraint.mix = constraint.data.mix; - constraint.softness = constraint.data.softness; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - return; - case 1 /* first */: - constraint.mix += (constraint.data.mix - constraint.mix) * alpha; - constraint.softness += (constraint.data.softness - constraint.softness) * alpha; - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } - return; - } - let mix = 0, softness = 0; - let i = Timeline.search( - frames, - time, - 6 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 6 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - mix = frames[ - i + 1 - /*MIX*/ - ]; - softness = frames[ - i + 2 - /*SOFTNESS*/ - ]; - let t = (time - before) / (frames[ - i + 6 - /*ENTRIES*/ - ] - before); - mix += (frames[ - i + 6 + 1 - /*MIX*/ - ] - mix) * t; - softness += (frames[ - i + 6 + 2 - /*SOFTNESS*/ - ] - softness) * t; - break; - case 1: - mix = frames[ - i + 1 - /*MIX*/ - ]; - softness = frames[ - i + 2 - /*SOFTNESS*/ - ]; - break; - default: - mix = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - softness = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - } - if (blend == 0 /* setup */) { - constraint.mix = constraint.data.mix + (mix - constraint.data.mix) * alpha; - constraint.softness = constraint.data.softness + (softness - constraint.data.softness) * alpha; - if (direction == 1 /* mixOut */) { - constraint.bendDirection = constraint.data.bendDirection; - constraint.compress = constraint.data.compress; - constraint.stretch = constraint.data.stretch; - } else { - constraint.bendDirection = frames[ - i + 3 - /*BEND_DIRECTION*/ - ]; - constraint.compress = frames[ - i + 4 - /*COMPRESS*/ - ] != 0; - constraint.stretch = frames[ - i + 5 - /*STRETCH*/ - ] != 0; - } - } else { - constraint.mix += (mix - constraint.mix) * alpha; - constraint.softness += (softness - constraint.softness) * alpha; - if (direction == 0 /* mixIn */) { - constraint.bendDirection = frames[ - i + 3 - /*BEND_DIRECTION*/ - ]; - constraint.compress = frames[ - i + 4 - /*COMPRESS*/ - ] != 0; - constraint.stretch = frames[ - i + 5 - /*STRETCH*/ - ] != 0; - } - } - } - }; - var TransformConstraintTimeline = class extends CurveTimeline { - /** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, transformConstraintIndex) { - super(frameCount, bezierCount, [ - Property.transformConstraint + "|" + transformConstraintIndex - ]); - this.constraintIndex = transformConstraintIndex; - } - getFrameEntries() { - return 7; - } - /** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */ - setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY) { - let frames = this.frames; - frame *= 7; - frames[frame] = time; - frames[ - frame + 1 - /*ROTATE*/ - ] = mixRotate; - frames[ - frame + 2 - /*X*/ - ] = mixX; - frames[ - frame + 3 - /*Y*/ - ] = mixY; - frames[ - frame + 4 - /*SCALEX*/ - ] = mixScaleX; - frames[ - frame + 5 - /*SCALEY*/ - ] = mixScaleY; - frames[ - frame + 6 - /*SHEARY*/ - ] = mixShearY; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.transformConstraints[this.constraintIndex]; - if (!constraint.active) - return; - let frames = this.frames; - if (time < frames[0]) { - let data = constraint.data; - switch (blend) { - case 0 /* setup */: - constraint.mixRotate = data.mixRotate; - constraint.mixX = data.mixX; - constraint.mixY = data.mixY; - constraint.mixScaleX = data.mixScaleX; - constraint.mixScaleY = data.mixScaleY; - constraint.mixShearY = data.mixShearY; - return; - case 1 /* first */: - constraint.mixRotate += (data.mixRotate - constraint.mixRotate) * alpha; - constraint.mixX += (data.mixX - constraint.mixX) * alpha; - constraint.mixY += (data.mixY - constraint.mixY) * alpha; - constraint.mixScaleX += (data.mixScaleX - constraint.mixScaleX) * alpha; - constraint.mixScaleY += (data.mixScaleY - constraint.mixScaleY) * alpha; - constraint.mixShearY += (data.mixShearY - constraint.mixShearY) * alpha; - } - return; - } - let rotate, x, y, scaleX, scaleY, shearY; - let i = Timeline.search( - frames, - time, - 7 - /*ENTRIES*/ - ); - let curveType = this.curves[ - i / 7 - /*ENTRIES*/ - ]; - switch (curveType) { - case 0: - let before = frames[i]; - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - scaleX = frames[ - i + 4 - /*SCALEX*/ - ]; - scaleY = frames[ - i + 5 - /*SCALEY*/ - ]; - shearY = frames[ - i + 6 - /*SHEARY*/ - ]; - let t = (time - before) / (frames[ - i + 7 - /*ENTRIES*/ - ] - before); - rotate += (frames[ - i + 7 + 1 - /*ROTATE*/ - ] - rotate) * t; - x += (frames[ - i + 7 + 2 - /*X*/ - ] - x) * t; - y += (frames[ - i + 7 + 3 - /*Y*/ - ] - y) * t; - scaleX += (frames[ - i + 7 + 4 - /*SCALEX*/ - ] - scaleX) * t; - scaleY += (frames[ - i + 7 + 5 - /*SCALEY*/ - ] - scaleY) * t; - shearY += (frames[ - i + 7 + 6 - /*SHEARY*/ - ] - shearY) * t; - break; - case 1: - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - scaleX = frames[ - i + 4 - /*SCALEX*/ - ]; - scaleY = frames[ - i + 5 - /*SCALEY*/ - ]; - shearY = frames[ - i + 6 - /*SHEARY*/ - ]; - break; - default: - rotate = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - x = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - scaleX = this.getBezierValue( - time, - i, - 4, - curveType + 18 * 3 - 2 - /*BEZIER*/ - ); - scaleY = this.getBezierValue( - time, - i, - 5, - curveType + 18 * 4 - 2 - /*BEZIER*/ - ); - shearY = this.getBezierValue( - time, - i, - 6, - curveType + 18 * 5 - 2 - /*BEZIER*/ - ); - } - if (blend == 0 /* setup */) { - let data = constraint.data; - constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha; - constraint.mixX = data.mixX + (x - data.mixX) * alpha; - constraint.mixY = data.mixY + (y - data.mixY) * alpha; - constraint.mixScaleX = data.mixScaleX + (scaleX - data.mixScaleX) * alpha; - constraint.mixScaleY = data.mixScaleY + (scaleY - data.mixScaleY) * alpha; - constraint.mixShearY = data.mixShearY + (shearY - data.mixShearY) * alpha; - } else { - constraint.mixRotate += (rotate - constraint.mixRotate) * alpha; - constraint.mixX += (x - constraint.mixX) * alpha; - constraint.mixY += (y - constraint.mixY) * alpha; - constraint.mixScaleX += (scaleX - constraint.mixScaleX) * alpha; - constraint.mixScaleY += (scaleY - constraint.mixScaleY) * alpha; - constraint.mixShearY += (shearY - constraint.mixShearY) * alpha; - } - } - }; - var PathConstraintPositionTimeline = class extends CurveTimeline1 { - /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is - * applied. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, pathConstraintIndex) { - super(frameCount, bezierCount, Property.pathConstraintPosition + "|" + pathConstraintIndex); - this.constraintIndex = pathConstraintIndex; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.pathConstraints[this.constraintIndex]; - if (constraint.active) - constraint.position = this.getAbsoluteValue(time, alpha, blend, constraint.position, constraint.data.position); - } - }; - var PathConstraintSpacingTimeline = class extends CurveTimeline1 { - /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is - * applied. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, pathConstraintIndex) { - super(frameCount, bezierCount, Property.pathConstraintSpacing + "|" + pathConstraintIndex); - this.constraintIndex = pathConstraintIndex; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.pathConstraints[this.constraintIndex]; - if (constraint.active) - constraint.spacing = this.getAbsoluteValue(time, alpha, blend, constraint.spacing, constraint.data.spacing); - } - }; - var PathConstraintMixTimeline = class extends CurveTimeline { - /** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is - * applied. */ - constraintIndex = 0; - constructor(frameCount, bezierCount, pathConstraintIndex) { - super(frameCount, bezierCount, [ - Property.pathConstraintMix + "|" + pathConstraintIndex - ]); - this.constraintIndex = pathConstraintIndex; - } - getFrameEntries() { - return 4; - } - setFrame(frame, time, mixRotate, mixX, mixY) { - let frames = this.frames; - frame <<= 2; - frames[frame] = time; - frames[ - frame + 1 - /*ROTATE*/ - ] = mixRotate; - frames[ - frame + 2 - /*X*/ - ] = mixX; - frames[ - frame + 3 - /*Y*/ - ] = mixY; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint = skeleton.pathConstraints[this.constraintIndex]; - if (!constraint.active) - return; - let frames = this.frames; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - constraint.mixRotate = constraint.data.mixRotate; - constraint.mixX = constraint.data.mixX; - constraint.mixY = constraint.data.mixY; - return; - case 1 /* first */: - constraint.mixRotate += (constraint.data.mixRotate - constraint.mixRotate) * alpha; - constraint.mixX += (constraint.data.mixX - constraint.mixX) * alpha; - constraint.mixY += (constraint.data.mixY - constraint.mixY) * alpha; - } - return; - } - let rotate, x, y; - let i = Timeline.search( - frames, - time, - 4 - /*ENTRIES*/ - ); - let curveType = this.curves[i >> 2]; - switch (curveType) { - case 0: - let before = frames[i]; - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - let t = (time - before) / (frames[ - i + 4 - /*ENTRIES*/ - ] - before); - rotate += (frames[ - i + 4 + 1 - /*ROTATE*/ - ] - rotate) * t; - x += (frames[ - i + 4 + 2 - /*X*/ - ] - x) * t; - y += (frames[ - i + 4 + 3 - /*Y*/ - ] - y) * t; - break; - case 1: - rotate = frames[ - i + 1 - /*ROTATE*/ - ]; - x = frames[ - i + 2 - /*X*/ - ]; - y = frames[ - i + 3 - /*Y*/ - ]; - break; - default: - rotate = this.getBezierValue( - time, - i, - 1, - curveType - 2 - /*BEZIER*/ - ); - x = this.getBezierValue( - time, - i, - 2, - curveType + 18 - 2 - /*BEZIER*/ - ); - y = this.getBezierValue( - time, - i, - 3, - curveType + 18 * 2 - 2 - /*BEZIER*/ - ); - } - if (blend == 0 /* setup */) { - let data = constraint.data; - constraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha; - constraint.mixX = data.mixX + (x - data.mixX) * alpha; - constraint.mixY = data.mixY + (y - data.mixY) * alpha; - } else { - constraint.mixRotate += (rotate - constraint.mixRotate) * alpha; - constraint.mixX += (x - constraint.mixX) * alpha; - constraint.mixY += (y - constraint.mixY) * alpha; - } - } - }; - var PhysicsConstraintTimeline = class extends CurveTimeline1 { - /** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be changed when this timeline - * is applied, or -1 if all physics constraints in the skeleton will be changed. */ - constraintIndex = 0; - /** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */ - constructor(frameCount, bezierCount, physicsConstraintIndex, property) { - super(frameCount, bezierCount, property + "|" + physicsConstraintIndex); - this.constraintIndex = physicsConstraintIndex; - } - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint; - if (this.constraintIndex == -1) { - const value = time >= this.frames[0] ? this.getCurveValue(time) : 0; - for (const constraint2 of skeleton.physicsConstraints) { - if (constraint2.active && this.global(constraint2.data)) - this.set(constraint2, this.getAbsoluteValue2(time, alpha, blend, this.get(constraint2), this.setup(constraint2), value)); - } - } else { - constraint = skeleton.physicsConstraints[this.constraintIndex]; - if (constraint.active) - this.set(constraint, this.getAbsoluteValue(time, alpha, blend, this.get(constraint), this.setup(constraint))); - } - } - }; - var PhysicsConstraintInertiaTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia); - } - setup(constraint) { - return constraint.data.inertia; - } - get(constraint) { - return constraint.inertia; - } - set(constraint, value) { - constraint.inertia = value; - } - global(constraint) { - return constraint.inertiaGlobal; - } - }; - var PhysicsConstraintStrengthTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength); - } - setup(constraint) { - return constraint.data.strength; - } - get(constraint) { - return constraint.strength; - } - set(constraint, value) { - constraint.strength = value; - } - global(constraint) { - return constraint.strengthGlobal; - } - }; - var PhysicsConstraintDampingTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping); - } - setup(constraint) { - return constraint.data.damping; - } - get(constraint) { - return constraint.damping; - } - set(constraint, value) { - constraint.damping = value; - } - global(constraint) { - return constraint.dampingGlobal; - } - }; - var PhysicsConstraintMassTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass); - } - setup(constraint) { - return 1 / constraint.data.massInverse; - } - get(constraint) { - return 1 / constraint.massInverse; - } - set(constraint, value) { - constraint.massInverse = 1 / value; - } - global(constraint) { - return constraint.massGlobal; - } - }; - var PhysicsConstraintWindTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind); - } - setup(constraint) { - return constraint.data.wind; - } - get(constraint) { - return constraint.wind; - } - set(constraint, value) { - constraint.wind = value; - } - global(constraint) { - return constraint.windGlobal; - } - }; - var PhysicsConstraintGravityTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity); - } - setup(constraint) { - return constraint.data.gravity; - } - get(constraint) { - return constraint.gravity; - } - set(constraint, value) { - constraint.gravity = value; - } - global(constraint) { - return constraint.gravityGlobal; - } - }; - var PhysicsConstraintMixTimeline = class extends PhysicsConstraintTimeline { - constructor(frameCount, bezierCount, physicsConstraintIndex) { - super(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix); - } - setup(constraint) { - return constraint.data.mix; - } - get(constraint) { - return constraint.mix; - } - set(constraint, value) { - constraint.mix = value; - } - global(constraint) { - return constraint.mixGlobal; - } - }; - var _PhysicsConstraintResetTimeline = class extends Timeline { - /** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be reset when this timeline is - * applied, or -1 if all physics constraints in the skeleton will be reset. */ - constraintIndex; - /** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */ - constructor(frameCount, physicsConstraintIndex) { - super(frameCount, _PhysicsConstraintResetTimeline.propertyIds); - this.constraintIndex = physicsConstraintIndex; - } - getFrameCount() { - return this.frames.length; - } - /** Sets the time for the specified frame. - * @param frame Between 0 and frameCount, inclusive. */ - setFrame(frame, time) { - this.frames[frame] = time; - } - /** Resets the physics constraint when frames > lastTime and <= time. */ - apply(skeleton, lastTime, time, firedEvents, alpha, blend, direction) { - let constraint; - if (this.constraintIndex != -1) { - constraint = skeleton.physicsConstraints[this.constraintIndex]; - if (!constraint.active) - return; - } - const frames = this.frames; - if (lastTime > time) { - this.apply(skeleton, lastTime, Number.MAX_VALUE, [], alpha, blend, direction); - lastTime = -1; - } else if (lastTime >= frames[frames.length - 1]) - return; - if (time < frames[0]) - return; - if (lastTime < frames[0] || time >= frames[Timeline.search1(frames, lastTime) + 1]) { - if (constraint != null) - constraint.reset(); - else { - for (const constraint2 of skeleton.physicsConstraints) { - if (constraint2.active) - constraint2.reset(); - } - } - } - } - }; - var PhysicsConstraintResetTimeline = _PhysicsConstraintResetTimeline; - __publicField(PhysicsConstraintResetTimeline, "propertyIds", [Property.physicsConstraintReset.toString()]); - var _SequenceTimeline = class extends Timeline { - slotIndex; - attachment; - constructor(frameCount, slotIndex, attachment) { - super(frameCount, [ - Property.sequence + "|" + slotIndex + "|" + attachment.sequence.id - ]); - this.slotIndex = slotIndex; - this.attachment = attachment; - } - getFrameEntries() { - return _SequenceTimeline.ENTRIES; - } - getSlotIndex() { - return this.slotIndex; - } - getAttachment() { - return this.attachment; - } - /** Sets the time, mode, index, and frame time for the specified frame. - * @param frame Between 0 and frameCount, inclusive. - * @param time Seconds between frames. */ - setFrame(frame, time, mode, index, delay) { - let frames = this.frames; - frame *= _SequenceTimeline.ENTRIES; - frames[frame] = time; - frames[frame + _SequenceTimeline.MODE] = mode | index << 4; - frames[frame + _SequenceTimeline.DELAY] = delay; - } - apply(skeleton, lastTime, time, events, alpha, blend, direction) { - let slot = skeleton.slots[this.slotIndex]; - if (!slot.bone.active) - return; - let slotAttachment = slot.attachment; - let attachment = this.attachment; - if (slotAttachment != attachment) { - if (!(slotAttachment instanceof VertexAttachment) || slotAttachment.timelineAttachment != attachment) - return; - } - if (direction == 1 /* mixOut */) { - if (blend == 0 /* setup */) - slot.sequenceIndex = -1; - return; - } - let frames = this.frames; - if (time < frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - slot.sequenceIndex = -1; - return; - } - let i = Timeline.search(frames, time, _SequenceTimeline.ENTRIES); - let before = frames[i]; - let modeAndIndex = frames[i + _SequenceTimeline.MODE]; - let delay = frames[i + _SequenceTimeline.DELAY]; - if (!this.attachment.sequence) - return; - let index = modeAndIndex >> 4, count = this.attachment.sequence.regions.length; - let mode = SequenceModeValues[modeAndIndex & 15]; - if (mode != 0 /* hold */) { - index += (time - before) / delay + 1e-5 | 0; - switch (mode) { - case 1 /* once */: - index = Math.min(count - 1, index); - break; - case 2 /* loop */: - index %= count; - break; - case 3 /* pingpong */: { - let n = (count << 1) - 2; - index = n == 0 ? 0 : index % n; - if (index >= count) - index = n - index; - break; - } - case 4 /* onceReverse */: - index = Math.max(count - 1 - index, 0); - break; - case 5 /* loopReverse */: - index = count - 1 - index % count; - break; - case 6 /* pingpongReverse */: { - let n = (count << 1) - 2; - index = n == 0 ? 0 : (index + count - 1) % n; - if (index >= count) - index = n - index; - } - } - } - slot.sequenceIndex = index; - } - }; - var SequenceTimeline = _SequenceTimeline; - __publicField(SequenceTimeline, "ENTRIES", 3); - __publicField(SequenceTimeline, "MODE", 1); - __publicField(SequenceTimeline, "DELAY", 2); - - // spine-core/src/AnimationState.ts - var _AnimationState = class { - static emptyAnimation() { - return _AnimationState._emptyAnimation; - } - /** The AnimationStateData to look up mix durations. */ - data; - /** The list of tracks that currently have animations, which may contain null entries. */ - tracks = new Array(); - /** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower - * or faster. Defaults to 1. - * - * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */ - timeScale = 1; - unkeyedState = 0; - events = new Array(); - listeners = new Array(); - queue = new EventQueue(this); - propertyIDs = new StringSet(); - animationsChanged = false; - trackEntryPool = new Pool(() => new TrackEntry()); - constructor(data) { - this.data = data; - } - /** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */ - update(delta) { - delta *= this.timeScale; - let tracks = this.tracks; - for (let i = 0, n = tracks.length; i < n; i++) { - let current = tracks[i]; - if (!current) - continue; - current.animationLast = current.nextAnimationLast; - current.trackLast = current.nextTrackLast; - let currentDelta = delta * current.timeScale; - if (current.delay > 0) { - current.delay -= currentDelta; - if (current.delay > 0) - continue; - currentDelta = -current.delay; - current.delay = 0; - } - let next = current.next; - if (next) { - let nextTime = current.trackLast - next.delay; - if (nextTime >= 0) { - next.delay = 0; - next.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale; - current.trackTime += currentDelta; - this.setCurrent(i, next, true); - while (next.mixingFrom) { - next.mixTime += delta; - next = next.mixingFrom; - } - continue; - } - } else if (current.trackLast >= current.trackEnd && !current.mixingFrom) { - tracks[i] = null; - this.queue.end(current); - this.clearNext(current); - continue; - } - if (current.mixingFrom && this.updateMixingFrom(current, delta)) { - let from = current.mixingFrom; - current.mixingFrom = null; - if (from) - from.mixingTo = null; - while (from) { - this.queue.end(from); - from = from.mixingFrom; - } - } - current.trackTime += currentDelta; - } - this.queue.drain(); - } - /** Returns true when all mixing from entries are complete. */ - updateMixingFrom(to, delta) { - let from = to.mixingFrom; - if (!from) - return true; - let finished = this.updateMixingFrom(from, delta); - from.animationLast = from.nextAnimationLast; - from.trackLast = from.nextTrackLast; - if (to.nextTrackLast != -1 && to.mixTime >= to.mixDuration) { - if (from.totalAlpha == 0 || to.mixDuration == 0) { - to.mixingFrom = from.mixingFrom; - if (from.mixingFrom != null) - from.mixingFrom.mixingTo = to; - to.interruptAlpha = from.interruptAlpha; - this.queue.end(from); - } - return finished; - } - from.trackTime += delta * from.timeScale; - to.mixTime += delta; - return false; - } - /** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the - * animation state can be applied to multiple skeletons to pose them identically. - * @returns True if any animations were applied. */ - apply(skeleton) { - if (!skeleton) - throw new Error("skeleton cannot be null."); - if (this.animationsChanged) - this._animationsChanged(); - let events = this.events; - let tracks = this.tracks; - let applied = false; - for (let i2 = 0, n2 = tracks.length; i2 < n2; i2++) { - let current = tracks[i2]; - if (!current || current.delay > 0) - continue; - applied = true; - let blend = i2 == 0 ? 1 /* first */ : current.mixBlend; - let alpha = current.alpha; - if (current.mixingFrom) - alpha *= this.applyMixingFrom(current, skeleton, blend); - else if (current.trackTime >= current.trackEnd && !current.next) - alpha = 0; - let attachments = alpha >= current.alphaAttachmentThreshold; - let animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime; - let applyEvents = events; - if (current.reverse) { - applyTime = current.animation.duration - applyTime; - applyEvents = null; - } - let timelines = current.animation.timelines; - let timelineCount = timelines.length; - if (i2 == 0 && alpha == 1 || blend == 3 /* add */) { - if (i2 == 0) - attachments = true; - for (let ii = 0; ii < timelineCount; ii++) { - Utils.webkit602BugfixHelper(alpha, blend); - var timeline = timelines[ii]; - if (timeline instanceof AttachmentTimeline) - this.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments); - else - timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, 0 /* mixIn */); - } - } else { - let timelineMode = current.timelineMode; - let shortestRotation = current.shortestRotation; - let firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1; - if (firstFrame) - current.timelinesRotation.length = timelineCount << 1; - for (let ii = 0; ii < timelineCount; ii++) { - let timeline2 = timelines[ii]; - let timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : 0 /* setup */; - if (!shortestRotation && timeline2 instanceof RotateTimeline) { - this.applyRotateTimeline(timeline2, skeleton, applyTime, alpha, timelineBlend, current.timelinesRotation, ii << 1, firstFrame); - } else if (timeline2 instanceof AttachmentTimeline) { - this.applyAttachmentTimeline(timeline2, skeleton, applyTime, blend, attachments); - } else { - Utils.webkit602BugfixHelper(alpha, blend); - timeline2.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, 0 /* mixIn */); - } - } - } - this.queueEvents(current, animationTime); - events.length = 0; - current.nextAnimationLast = animationTime; - current.nextTrackLast = current.trackTime; - } - var setupState = this.unkeyedState + SETUP; - var slots = skeleton.slots; - for (var i = 0, n = skeleton.slots.length; i < n; i++) { - var slot = slots[i]; - if (slot.attachmentState == setupState) { - var attachmentName = slot.data.attachmentName; - slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName)); - } - } - this.unkeyedState += 2; - this.queue.drain(); - return applied; - } - applyMixingFrom(to, skeleton, blend) { - let from = to.mixingFrom; - if (from.mixingFrom) - this.applyMixingFrom(from, skeleton, blend); - let mix = 0; - if (to.mixDuration == 0) { - mix = 1; - if (blend == 1 /* first */) - blend = 0 /* setup */; - } else { - mix = to.mixTime / to.mixDuration; - if (mix > 1) - mix = 1; - if (blend != 1 /* first */) - blend = from.mixBlend; - } - let attachments = mix < from.mixAttachmentThreshold, drawOrder = mix < from.mixDrawOrderThreshold; - let timelines = from.animation.timelines; - let timelineCount = timelines.length; - let alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix); - let animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime; - let events = null; - if (from.reverse) - applyTime = from.animation.duration - applyTime; - else if (mix < from.eventThreshold) - events = this.events; - if (blend == 3 /* add */) { - for (let i = 0; i < timelineCount; i++) - timelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, 1 /* mixOut */); - } else { - let timelineMode = from.timelineMode; - let timelineHoldMix = from.timelineHoldMix; - let shortestRotation = from.shortestRotation; - let firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1; - if (firstFrame) - from.timelinesRotation.length = timelineCount << 1; - from.totalAlpha = 0; - for (let i = 0; i < timelineCount; i++) { - let timeline = timelines[i]; - let direction = 1 /* mixOut */; - let timelineBlend; - let alpha = 0; - switch (timelineMode[i]) { - case SUBSEQUENT: - if (!drawOrder && timeline instanceof DrawOrderTimeline) - continue; - timelineBlend = blend; - alpha = alphaMix; - break; - case FIRST: - timelineBlend = 0 /* setup */; - alpha = alphaMix; - break; - case HOLD_SUBSEQUENT: - timelineBlend = blend; - alpha = alphaHold; - break; - case HOLD_FIRST: - timelineBlend = 0 /* setup */; - alpha = alphaHold; - break; - default: - timelineBlend = 0 /* setup */; - let holdMix = timelineHoldMix[i]; - alpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration); - break; - } - from.totalAlpha += alpha; - if (!shortestRotation && timeline instanceof RotateTimeline) - this.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame); - else if (timeline instanceof AttachmentTimeline) - this.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments && alpha >= from.alphaAttachmentThreshold); - else { - Utils.webkit602BugfixHelper(alpha, blend); - if (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == 0 /* setup */) - direction = 0 /* mixIn */; - timeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction); - } - } - } - if (to.mixDuration > 0) - this.queueEvents(from, animationTime); - this.events.length = 0; - from.nextAnimationLast = animationTime; - from.nextTrackLast = from.trackTime; - return mix; - } - applyAttachmentTimeline(timeline, skeleton, time, blend, attachments) { - var slot = skeleton.slots[timeline.slotIndex]; - if (!slot.bone.active) - return; - if (time < timeline.frames[0]) { - if (blend == 0 /* setup */ || blend == 1 /* first */) - this.setAttachment(skeleton, slot, slot.data.attachmentName, attachments); - } else - this.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search1(timeline.frames, time)], attachments); - if (slot.attachmentState <= this.unkeyedState) - slot.attachmentState = this.unkeyedState + SETUP; - } - setAttachment(skeleton, slot, attachmentName, attachments) { - slot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName)); - if (attachments) - slot.attachmentState = this.unkeyedState + CURRENT; - } - applyRotateTimeline(timeline, skeleton, time, alpha, blend, timelinesRotation, i, firstFrame) { - if (firstFrame) - timelinesRotation[i] = 0; - if (alpha == 1) { - timeline.apply(skeleton, 0, time, null, 1, blend, 0 /* mixIn */); - return; - } - let bone = skeleton.bones[timeline.boneIndex]; - if (!bone.active) - return; - let frames = timeline.frames; - let r1 = 0, r2 = 0; - if (time < frames[0]) { - switch (blend) { - case 0 /* setup */: - bone.rotation = bone.data.rotation; - default: - return; - case 1 /* first */: - r1 = bone.rotation; - r2 = bone.data.rotation; - } - } else { - r1 = blend == 0 /* setup */ ? bone.data.rotation : bone.rotation; - r2 = bone.data.rotation + timeline.getCurveValue(time); - } - let total = 0, diff = r2 - r1; - diff -= Math.ceil(diff / 360 - 0.5) * 360; - if (diff == 0) { - total = timelinesRotation[i]; - } else { - let lastTotal = 0, lastDiff = 0; - if (firstFrame) { - lastTotal = 0; - lastDiff = diff; - } else { - lastTotal = timelinesRotation[i]; - lastDiff = timelinesRotation[i + 1]; - } - let loops = lastTotal - lastTotal % 360; - total = diff + loops; - let current = diff >= 0, dir = lastTotal >= 0; - if (Math.abs(lastDiff) <= 90 && MathUtils.signum(lastDiff) != MathUtils.signum(diff)) { - if (Math.abs(lastTotal - loops) > 180) { - total += 360 * MathUtils.signum(lastTotal); - dir = current; - } else if (loops != 0) - total -= 360 * MathUtils.signum(lastTotal); - else - dir = current; - } - if (dir != current) - total += 360 * MathUtils.signum(lastTotal); - timelinesRotation[i] = total; - } - timelinesRotation[i + 1] = diff; - bone.rotation = r1 + total * alpha; - } - queueEvents(entry, animationTime) { - let animationStart = entry.animationStart, animationEnd = entry.animationEnd; - let duration = animationEnd - animationStart; - let trackLastWrapped = entry.trackLast % duration; - let events = this.events; - let i = 0, n = events.length; - for (; i < n; i++) { - let event = events[i]; - if (event.time < trackLastWrapped) - break; - if (event.time > animationEnd) - continue; - this.queue.event(entry, event); - } - let complete = false; - if (entry.loop) { - if (duration == 0) - complete = true; - else { - const cycles = Math.floor(entry.trackTime / duration); - complete = cycles > 0 && cycles > Math.floor(entry.trackLast / duration); - } - } else - complete = animationTime >= animationEnd && entry.animationLast < animationEnd; - if (complete) - this.queue.complete(entry); - for (; i < n; i++) { - let event = events[i]; - if (event.time < animationStart) - continue; - this.queue.event(entry, event); - } - } - /** Removes all animations from all tracks, leaving skeletons in their current pose. - * - * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose, - * rather than leaving them in their current pose. */ - clearTracks() { - let oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (let i = 0, n = this.tracks.length; i < n; i++) - this.clearTrack(i); - this.tracks.length = 0; - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - } - /** Removes all animations from the track, leaving skeletons in their current pose. - * - * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose, - * rather than leaving them in their current pose. */ - clearTrack(trackIndex) { - if (trackIndex >= this.tracks.length) - return; - let current = this.tracks[trackIndex]; - if (!current) - return; - this.queue.end(current); - this.clearNext(current); - let entry = current; - while (true) { - let from = entry.mixingFrom; - if (!from) - break; - this.queue.end(from); - entry.mixingFrom = null; - entry.mixingTo = null; - entry = from; - } - this.tracks[current.trackIndex] = null; - this.queue.drain(); - } - setCurrent(index, current, interrupt) { - let from = this.expandToIndex(index); - this.tracks[index] = current; - current.previous = null; - if (from) { - if (interrupt) - this.queue.interrupt(from); - current.mixingFrom = from; - from.mixingTo = current; - current.mixTime = 0; - if (from.mixingFrom && from.mixDuration > 0) - current.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration); - from.timelinesRotation.length = 0; - } - this.queue.start(current); - } - /** Sets an animation by name. - * - * See {@link #setAnimationWith()}. */ - setAnimation(trackIndex, animationName, loop = false) { - let animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) - throw new Error("Animation not found: " + animationName); - return this.setAnimationWith(trackIndex, animation, loop); - } - /** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never - * applied to a skeleton, it is replaced (not mixed from). - * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its - * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared. - * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose()} event occurs. */ - setAnimationWith(trackIndex, animation, loop = false) { - if (!animation) - throw new Error("animation cannot be null."); - let interrupt = true; - let current = this.expandToIndex(trackIndex); - if (current) { - if (current.nextTrackLast == -1) { - this.tracks[trackIndex] = current.mixingFrom; - this.queue.interrupt(current); - this.queue.end(current); - this.clearNext(current); - current = current.mixingFrom; - interrupt = false; - } else - this.clearNext(current); - } - let entry = this.trackEntry(trackIndex, animation, loop, current); - this.setCurrent(trackIndex, entry, interrupt); - this.queue.drain(); - return entry; - } - /** Queues an animation by name. - * - * See {@link #addAnimationWith()}. */ - addAnimation(trackIndex, animationName, loop = false, delay = 0) { - let animation = this.data.skeletonData.findAnimation(animationName); - if (!animation) - throw new Error("Animation not found: " + animationName); - return this.addAnimationWith(trackIndex, animation, loop, delay); - } - /** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is - * equivalent to calling {@link #setAnimationWith()}. - * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry - * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix - * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the - * previous entry is looping, its next loop completion is used instead of its duration. - * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose()} event occurs. */ - addAnimationWith(trackIndex, animation, loop = false, delay = 0) { - if (!animation) - throw new Error("animation cannot be null."); - let last = this.expandToIndex(trackIndex); - if (last) { - while (last.next) - last = last.next; - } - let entry = this.trackEntry(trackIndex, animation, loop, last); - if (!last) { - this.setCurrent(trackIndex, entry, true); - this.queue.drain(); - } else { - last.next = entry; - entry.previous = last; - if (delay <= 0) - delay += last.getTrackComplete() - entry.mixDuration; - } - entry.delay = delay; - return entry; - } - /** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's - * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out. - * - * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()}, - * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes - * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation - * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of - * 0 still mixes out over one frame. - * - * Mixing in is done by first setting an empty animation, then adding an animation using - * {@link #addAnimation()} and on the returned track entry, set the - * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and - * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the - * setup pose value if no lower tracks key the property to the value keyed in the new animation. */ - setEmptyAnimation(trackIndex, mixDuration = 0) { - let entry = this.setAnimationWith(trackIndex, _AnimationState.emptyAnimation(), false); - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - } - /** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's - * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling - * {@link #setEmptyAnimation()}. - * - * See {@link #setEmptyAnimation()}. - * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry - * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or - * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next - * loop completion is used instead of its duration. - * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept - * after the {@link AnimationStateListener#dispose()} event occurs. */ - addEmptyAnimation(trackIndex, mixDuration = 0, delay = 0) { - let entry = this.addAnimationWith(trackIndex, _AnimationState.emptyAnimation(), false, delay); - if (delay <= 0) - entry.delay += entry.mixDuration - mixDuration; - entry.mixDuration = mixDuration; - entry.trackEnd = mixDuration; - return entry; - } - /** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix - * duration. */ - setEmptyAnimations(mixDuration = 0) { - let oldDrainDisabled = this.queue.drainDisabled; - this.queue.drainDisabled = true; - for (let i = 0, n = this.tracks.length; i < n; i++) { - let current = this.tracks[i]; - if (current) - this.setEmptyAnimation(current.trackIndex, mixDuration); - } - this.queue.drainDisabled = oldDrainDisabled; - this.queue.drain(); - } - expandToIndex(index) { - if (index < this.tracks.length) - return this.tracks[index]; - Utils.ensureArrayCapacity(this.tracks, index + 1, null); - this.tracks.length = index + 1; - return null; - } - /** @param last May be null. */ - trackEntry(trackIndex, animation, loop, last) { - let entry = this.trackEntryPool.obtain(); - entry.reset(); - entry.trackIndex = trackIndex; - entry.animation = animation; - entry.loop = loop; - entry.holdPrevious = false; - entry.reverse = false; - entry.shortestRotation = false; - entry.eventThreshold = 0; - entry.alphaAttachmentThreshold = 0; - entry.mixAttachmentThreshold = 0; - entry.mixDrawOrderThreshold = 0; - entry.animationStart = 0; - entry.animationEnd = animation.duration; - entry.animationLast = -1; - entry.nextAnimationLast = -1; - entry.delay = 0; - entry.trackTime = 0; - entry.trackLast = -1; - entry.nextTrackLast = -1; - entry.trackEnd = Number.MAX_VALUE; - entry.timeScale = 1; - entry.alpha = 1; - entry.mixTime = 0; - entry.mixDuration = !last ? 0 : this.data.getMix(last.animation, animation); - entry.interruptAlpha = 1; - entry.totalAlpha = 0; - entry.mixBlend = 2 /* replace */; - return entry; - } - /** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */ - clearNext(entry) { - let next = entry.next; - while (next) { - this.queue.dispose(next); - next = next.next; - } - entry.next = null; - } - _animationsChanged() { - this.animationsChanged = false; - this.propertyIDs.clear(); - let tracks = this.tracks; - for (let i = 0, n = tracks.length; i < n; i++) { - let entry = tracks[i]; - if (!entry) - continue; - while (entry.mixingFrom) - entry = entry.mixingFrom; - do { - if (!entry.mixingTo || entry.mixBlend != 3 /* add */) - this.computeHold(entry); - entry = entry.mixingTo; - } while (entry); - } - } - computeHold(entry) { - let to = entry.mixingTo; - let timelines = entry.animation.timelines; - let timelinesCount = entry.animation.timelines.length; - let timelineMode = entry.timelineMode; - timelineMode.length = timelinesCount; - let timelineHoldMix = entry.timelineHoldMix; - timelineHoldMix.length = 0; - let propertyIDs = this.propertyIDs; - if (to && to.holdPrevious) { - for (let i = 0; i < timelinesCount; i++) - timelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT; - return; - } - outer: - for (let i = 0; i < timelinesCount; i++) { - let timeline = timelines[i]; - let ids = timeline.getPropertyIds(); - if (!propertyIDs.addAll(ids)) - timelineMode[i] = SUBSEQUENT; - else if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline || timeline instanceof EventTimeline || !to.animation.hasTimeline(ids)) { - timelineMode[i] = FIRST; - } else { - for (let next = to.mixingTo; next; next = next.mixingTo) { - if (next.animation.hasTimeline(ids)) - continue; - if (entry.mixDuration > 0) { - timelineMode[i] = HOLD_MIX; - timelineHoldMix[i] = next; - continue outer; - } - break; - } - timelineMode[i] = HOLD_FIRST; - } - } - } - /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */ - getCurrent(trackIndex) { - if (trackIndex >= this.tracks.length) - return null; - return this.tracks[trackIndex]; - } - /** Adds a listener to receive events for all track entries. */ - addListener(listener) { - if (!listener) - throw new Error("listener cannot be null."); - this.listeners.push(listener); - } - /** Removes the listener added with {@link #addListener()}. */ - removeListener(listener) { - let index = this.listeners.indexOf(listener); - if (index >= 0) - this.listeners.splice(index, 1); - } - /** Removes all listeners added with {@link #addListener()}. */ - clearListeners() { - this.listeners.length = 0; - } - /** Discards all listener notifications that have not yet been delivered. This can be useful to call from an - * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery - * are not wanted because new animations are being set. */ - clearListenerNotifications() { - this.queue.clear(); - } - }; - var AnimationState = _AnimationState; - __publicField(AnimationState, "_emptyAnimation", new Animation("", [], 0)); - var TrackEntry = class { - /** The animation to apply for this track entry. */ - animation = null; - previous = null; - /** The animation queued to start after this animation, or null. `next` makes up a linked list. */ - next = null; - /** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no - * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */ - mixingFrom = null; - /** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is - * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */ - mixingTo = null; - /** The listener for events generated by this track entry, or null. - * - * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation - * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */ - listener = null; - /** The index of the track where this track entry is either current or queued. - * - * See {@link AnimationState#getCurrent()}. */ - trackIndex = 0; - /** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its - * duration. */ - loop = false; - /** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead - * of being mixed out. - * - * When mixing between animations that key the same property, if a lower track also keys that property then the value will - * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0% - * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation - * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which - * keys the property, only when a higher track also keys the property. - * - * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the - * previous animation. */ - holdPrevious = false; - reverse = false; - shortestRotation = false; - /** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the - * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event - * timelines are not applied while this animation is being mixed out. */ - eventThreshold = 0; - /** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the - * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to - * 0, so attachment timelines are not applied while this animation is being mixed out. */ - mixAttachmentThreshold = 0; - /** When {@link #getAlpha()} is greater than alphaAttachmentThreshold, attachment timelines are applied. - * Defaults to 0, so attachment timelines are always applied. */ - alphaAttachmentThreshold = 0; - /** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the - * mixDrawOrderThreshold, draw order timelines are applied while this animation is being mixed out. Defaults to - * 0, so draw order timelines are not applied while this animation is being mixed out. */ - mixDrawOrderThreshold = 0; - /** Seconds when this animation starts, both initially and after looping. Defaults to 0. - * - * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same - * value to prevent timeline keys before the start time from triggering. */ - animationStart = 0; - /** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will - * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */ - animationEnd = 0; - /** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this - * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and - * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation - * is applied. */ - animationLast = 0; - nextAnimationLast = 0; - /** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay` - * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from - * the start of the previous animation to when this track entry will become the current track entry (ie when the previous - * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`). - * - * {@link #timeScale} affects the delay. */ - delay = 0; - /** Current time in seconds this track entry has been the current track entry. The track time determines - * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting - * looping. */ - trackTime = 0; - trackLast = 0; - nextTrackLast = 0; - /** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float - * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time - * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the - * properties keyed by the animation are set to the setup pose and the track is cleared. - * - * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation - * abruptly cease being applied. */ - trackEnd = 0; - /** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or - * faster. Defaults to 1. - * - * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to - * match the animation speed. - * - * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the - * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If - * the time scale is not 1, the delay may need to be adjusted. - * - * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */ - timeScale = 0; - /** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults - * to 1, which overwrites the skeleton's current pose with this animation. - * - * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to - * use alpha on track 0 if the skeleton pose is from the last frame render. */ - alpha = 0; - /** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be - * slightly more than `mixDuration` when the mix is complete. */ - mixTime = 0; - /** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData - * {@link AnimationStateData#getMix()} based on the animation before this animation (if any). - * - * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the - * properties it was animating. - * - * The `mixDuration` can be set manually rather than use the value from - * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new - * track entry only before {@link AnimationState#update(float)} is first called. - * - * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the - * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set - * afterward. */ - _mixDuration = 0; - interruptAlpha = 0; - totalAlpha = 0; - get mixDuration() { - return this._mixDuration; - } - set mixDuration(mixDuration) { - this._mixDuration = mixDuration; - } - setMixDurationWithDelay(mixDuration, delay) { - this._mixDuration = mixDuration; - if (this.previous != null && delay <= 0) - delay += this.previous.getTrackComplete() - mixDuration; - this.delay = delay; - } - /** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which - * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to - * the values from the lower tracks. - * - * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first - * called. */ - mixBlend = 2 /* replace */; - timelineMode = new Array(); - timelineHoldMix = new Array(); - timelinesRotation = new Array(); - reset() { - this.next = null; - this.previous = null; - this.mixingFrom = null; - this.mixingTo = null; - this.animation = null; - this.listener = null; - this.timelineMode.length = 0; - this.timelineHoldMix.length = 0; - this.timelinesRotation.length = 0; - } - /** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart} - * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the - * `animationStart` time. */ - getAnimationTime() { - if (this.loop) { - let duration = this.animationEnd - this.animationStart; - if (duration == 0) - return this.animationStart; - return this.trackTime % duration + this.animationStart; - } - return Math.min(this.trackTime + this.animationStart, this.animationEnd); - } - setAnimationLast(animationLast) { - this.animationLast = animationLast; - this.nextAnimationLast = animationLast; - } - /** Returns true if at least one loop has been completed. - * - * See {@link AnimationStateListener#complete()}. */ - isComplete() { - return this.trackTime >= this.animationEnd - this.animationStart; - } - /** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the - * long way around when using {@link #alpha} and starting animations on other tracks. - * - * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions: - * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long - * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the - * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */ - resetRotationDirections() { - this.timelinesRotation.length = 0; - } - getTrackComplete() { - let duration = this.animationEnd - this.animationStart; - if (duration != 0) { - if (this.loop) - return duration * (1 + (this.trackTime / duration | 0)); - if (this.trackTime < duration) - return duration; - } - return this.trackTime; - } - /** Returns true if this track entry has been applied at least once. - *

- * See {@link AnimationState#apply(Skeleton)}. */ - wasApplied() { - return this.nextTrackLast != -1; - } - /** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next - * {@link AnimationState#update(float)}. */ - isNextReady() { - return this.next != null && this.nextTrackLast - this.next.delay >= 0; - } - }; - var EventQueue = class { - objects = []; - drainDisabled = false; - animState; - constructor(animState) { - this.animState = animState; - } - start(entry) { - this.objects.push(EventType.start); - this.objects.push(entry); - this.animState.animationsChanged = true; - } - interrupt(entry) { - this.objects.push(EventType.interrupt); - this.objects.push(entry); - } - end(entry) { - this.objects.push(EventType.end); - this.objects.push(entry); - this.animState.animationsChanged = true; - } - dispose(entry) { - this.objects.push(EventType.dispose); - this.objects.push(entry); - } - complete(entry) { - this.objects.push(EventType.complete); - this.objects.push(entry); - } - event(entry, event) { - this.objects.push(EventType.event); - this.objects.push(entry); - this.objects.push(event); - } - drain() { - if (this.drainDisabled) - return; - this.drainDisabled = true; - let objects = this.objects; - let listeners = this.animState.listeners; - for (let i = 0; i < objects.length; i += 2) { - let type = objects[i]; - let entry = objects[i + 1]; - switch (type) { - case EventType.start: - if (entry.listener && entry.listener.start) - entry.listener.start(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.start) - listener.start(entry); - } - break; - case EventType.interrupt: - if (entry.listener && entry.listener.interrupt) - entry.listener.interrupt(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.interrupt) - listener.interrupt(entry); - } - break; - case EventType.end: - if (entry.listener && entry.listener.end) - entry.listener.end(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.end) - listener.end(entry); - } - case EventType.dispose: - if (entry.listener && entry.listener.dispose) - entry.listener.dispose(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.dispose) - listener.dispose(entry); - } - this.animState.trackEntryPool.free(entry); - break; - case EventType.complete: - if (entry.listener && entry.listener.complete) - entry.listener.complete(entry); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.complete) - listener.complete(entry); - } - break; - case EventType.event: - let event = objects[i++ + 2]; - if (entry.listener && entry.listener.event) - entry.listener.event(entry, event); - for (let ii = 0; ii < listeners.length; ii++) { - let listener = listeners[ii]; - if (listener.event) - listener.event(entry, event); - } - break; - } - } - this.clear(); - this.drainDisabled = false; - } - clear() { - this.objects.length = 0; - } - }; - var EventType = /* @__PURE__ */ ((EventType2) => { - EventType2[EventType2["start"] = 0] = "start"; - EventType2[EventType2["interrupt"] = 1] = "interrupt"; - EventType2[EventType2["end"] = 2] = "end"; - EventType2[EventType2["dispose"] = 3] = "dispose"; - EventType2[EventType2["complete"] = 4] = "complete"; - EventType2[EventType2["event"] = 5] = "event"; - return EventType2; - })(EventType || {}); - var AnimationStateAdapter = class { - start(entry) { - } - interrupt(entry) { - } - end(entry) { - } - dispose(entry) { - } - complete(entry) { - } - event(entry, event) { - } - }; - var SUBSEQUENT = 0; - var FIRST = 1; - var HOLD_SUBSEQUENT = 2; - var HOLD_FIRST = 3; - var HOLD_MIX = 4; - var SETUP = 1; - var CURRENT = 2; - - // spine-core/src/AnimationStateData.ts - var AnimationStateData = class { - /** The SkeletonData to look up animations when they are specified by name. */ - skeletonData; - animationToMixTime = {}; - /** The mix duration to use when no mix duration has been defined between two animations. */ - defaultMix = 0; - constructor(skeletonData) { - if (!skeletonData) - throw new Error("skeletonData cannot be null."); - this.skeletonData = skeletonData; - } - /** Sets a mix duration by animation name. - * - * See {@link #setMixWith()}. */ - setMix(fromName, toName, duration) { - let from = this.skeletonData.findAnimation(fromName); - if (!from) - throw new Error("Animation not found: " + fromName); - let to = this.skeletonData.findAnimation(toName); - if (!to) - throw new Error("Animation not found: " + toName); - this.setMixWith(from, to, duration); - } - /** Sets the mix duration when changing from the specified animation to the other. - * - * See {@link TrackEntry#mixDuration}. */ - setMixWith(from, to, duration) { - if (!from) - throw new Error("from cannot be null."); - if (!to) - throw new Error("to cannot be null."); - let key = from.name + "." + to.name; - this.animationToMixTime[key] = duration; - } - /** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if - * no mix duration has been set. */ - getMix(from, to) { - let key = from.name + "." + to.name; - let value = this.animationToMixTime[key]; - return value === void 0 ? this.defaultMix : value; - } - }; - - // spine-core/src/attachments/BoundingBoxAttachment.ts - var BoundingBoxAttachment = class extends VertexAttachment { - color = new Color(1, 1, 1, 1); - constructor(name) { - super(name); - } - copy() { - let copy = new BoundingBoxAttachment(this.name); - this.copyTo(copy); - copy.color.setFromColor(this.color); - return copy; - } - }; - - // spine-core/src/attachments/ClippingAttachment.ts - var ClippingAttachment = class extends VertexAttachment { - /** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of - * the skeleton's rendering. */ - endSlot = null; - // Nonessential. - /** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons - * are not usually rendered at runtime. */ - color = new Color(0.2275, 0.2275, 0.8078, 1); - // ce3a3aff - constructor(name) { - super(name); - } - copy() { - let copy = new ClippingAttachment(this.name); - this.copyTo(copy); - copy.endSlot = this.endSlot; - copy.color.setFromColor(this.color); - return copy; - } - }; - - // spine-core/src/Texture.ts - var Texture = class { - _image; - constructor(image) { - this._image = image; - } - getImage() { - return this._image; - } - }; - var TextureFilter = /* @__PURE__ */ ((TextureFilter3) => { - TextureFilter3[TextureFilter3["Nearest"] = 9728] = "Nearest"; - TextureFilter3[TextureFilter3["Linear"] = 9729] = "Linear"; - TextureFilter3[TextureFilter3["MipMap"] = 9987] = "MipMap"; - TextureFilter3[TextureFilter3["MipMapNearestNearest"] = 9984] = "MipMapNearestNearest"; - TextureFilter3[TextureFilter3["MipMapLinearNearest"] = 9985] = "MipMapLinearNearest"; - TextureFilter3[TextureFilter3["MipMapNearestLinear"] = 9986] = "MipMapNearestLinear"; - TextureFilter3[TextureFilter3["MipMapLinearLinear"] = 9987] = "MipMapLinearLinear"; - return TextureFilter3; - })(TextureFilter || {}); - var TextureWrap = /* @__PURE__ */ ((TextureWrap4) => { - TextureWrap4[TextureWrap4["MirroredRepeat"] = 33648] = "MirroredRepeat"; - TextureWrap4[TextureWrap4["ClampToEdge"] = 33071] = "ClampToEdge"; - TextureWrap4[TextureWrap4["Repeat"] = 10497] = "Repeat"; - return TextureWrap4; - })(TextureWrap || {}); - var TextureRegion = class { - texture; - u = 0; - v = 0; - u2 = 0; - v2 = 0; - width = 0; - height = 0; - degrees = 0; - offsetX = 0; - offsetY = 0; - originalWidth = 0; - originalHeight = 0; - }; - var FakeTexture = class extends Texture { - setFilters(minFilter, magFilter) { - } - setWraps(uWrap, vWrap) { - } - dispose() { - } - }; - - // spine-core/src/TextureAtlas.ts - var TextureAtlas = class { - pages = new Array(); - regions = new Array(); - constructor(atlasText) { - let reader = new TextureAtlasReader(atlasText); - let entry = new Array(4); - let pageFields = {}; - pageFields["size"] = (page2) => { - page2.width = parseInt(entry[1]); - page2.height = parseInt(entry[2]); - }; - pageFields["format"] = () => { - }; - pageFields["filter"] = (page2) => { - page2.minFilter = Utils.enumValue(TextureFilter, entry[1]); - page2.magFilter = Utils.enumValue(TextureFilter, entry[2]); - }; - pageFields["repeat"] = (page2) => { - if (entry[1].indexOf("x") != -1) - page2.uWrap = 10497 /* Repeat */; - if (entry[1].indexOf("y") != -1) - page2.vWrap = 10497 /* Repeat */; - }; - pageFields["pma"] = (page2) => { - page2.pma = entry[1] == "true"; - }; - var regionFields = {}; - regionFields["xy"] = (region) => { - region.x = parseInt(entry[1]); - region.y = parseInt(entry[2]); - }; - regionFields["size"] = (region) => { - region.width = parseInt(entry[1]); - region.height = parseInt(entry[2]); - }; - regionFields["bounds"] = (region) => { - region.x = parseInt(entry[1]); - region.y = parseInt(entry[2]); - region.width = parseInt(entry[3]); - region.height = parseInt(entry[4]); - }; - regionFields["offset"] = (region) => { - region.offsetX = parseInt(entry[1]); - region.offsetY = parseInt(entry[2]); - }; - regionFields["orig"] = (region) => { - region.originalWidth = parseInt(entry[1]); - region.originalHeight = parseInt(entry[2]); - }; - regionFields["offsets"] = (region) => { - region.offsetX = parseInt(entry[1]); - region.offsetY = parseInt(entry[2]); - region.originalWidth = parseInt(entry[3]); - region.originalHeight = parseInt(entry[4]); - }; - regionFields["rotate"] = (region) => { - let value = entry[1]; - if (value == "true") - region.degrees = 90; - else if (value != "false") - region.degrees = parseInt(value); - }; - regionFields["index"] = (region) => { - region.index = parseInt(entry[1]); - }; - let line = reader.readLine(); - while (line && line.trim().length == 0) - line = reader.readLine(); - while (true) { - if (!line || line.trim().length == 0) - break; - if (reader.readEntry(entry, line) == 0) - break; - line = reader.readLine(); - } - let page = null; - let names = null; - let values = null; - while (true) { - if (line === null) - break; - if (line.trim().length == 0) { - page = null; - line = reader.readLine(); - } else if (!page) { - page = new TextureAtlasPage(line.trim()); - while (true) { - if (reader.readEntry(entry, line = reader.readLine()) == 0) - break; - let field = pageFields[entry[0]]; - if (field) - field(page); - } - this.pages.push(page); - } else { - let region = new TextureAtlasRegion(page, line); - while (true) { - let count = reader.readEntry(entry, line = reader.readLine()); - if (count == 0) - break; - let field = regionFields[entry[0]]; - if (field) - field(region); - else { - if (!names) - names = []; - if (!values) - values = []; - names.push(entry[0]); - let entryValues = []; - for (let i = 0; i < count; i++) - entryValues.push(parseInt(entry[i + 1])); - values.push(entryValues); - } - } - if (region.originalWidth == 0 && region.originalHeight == 0) { - region.originalWidth = region.width; - region.originalHeight = region.height; - } - if (names && names.length > 0 && values && values.length > 0) { - region.names = names; - region.values = values; - names = null; - values = null; - } - region.u = region.x / page.width; - region.v = region.y / page.height; - if (region.degrees == 90) { - region.u2 = (region.x + region.height) / page.width; - region.v2 = (region.y + region.width) / page.height; - } else { - region.u2 = (region.x + region.width) / page.width; - region.v2 = (region.y + region.height) / page.height; - } - this.regions.push(region); - } - } - } - findRegion(name) { - for (let i = 0; i < this.regions.length; i++) { - if (this.regions[i].name == name) { - return this.regions[i]; - } - } - return null; - } - setTextures(assetManager, pathPrefix = "") { - for (let page of this.pages) - page.setTexture(assetManager.get(pathPrefix + page.name)); - } - dispose() { - for (let i = 0; i < this.pages.length; i++) { - this.pages[i].texture?.dispose(); - } - } - }; - var TextureAtlasReader = class { - lines; - index = 0; - constructor(text) { - this.lines = text.split(/\r\n|\r|\n/); - } - readLine() { - if (this.index >= this.lines.length) - return null; - return this.lines[this.index++]; - } - readEntry(entry, line) { - if (!line) - return 0; - line = line.trim(); - if (line.length == 0) - return 0; - let colon = line.indexOf(":"); - if (colon == -1) - return 0; - entry[0] = line.substr(0, colon).trim(); - for (let i = 1, lastMatch = colon + 1; ; i++) { - let comma = line.indexOf(",", lastMatch); - if (comma == -1) { - entry[i] = line.substr(lastMatch).trim(); - return i; - } - entry[i] = line.substr(lastMatch, comma - lastMatch).trim(); - lastMatch = comma + 1; - if (i == 4) - return 4; - } - } - }; - var TextureAtlasPage = class { - name; - minFilter = 9728 /* Nearest */; - magFilter = 9728 /* Nearest */; - uWrap = 33071 /* ClampToEdge */; - vWrap = 33071 /* ClampToEdge */; - texture = null; - width = 0; - height = 0; - pma = false; - regions = new Array(); - constructor(name) { - this.name = name; - } - setTexture(texture) { - this.texture = texture; - texture.setFilters(this.minFilter, this.magFilter); - texture.setWraps(this.uWrap, this.vWrap); - for (let region of this.regions) - region.texture = texture; - } - }; - var TextureAtlasRegion = class extends TextureRegion { - page; - name; - x = 0; - y = 0; - offsetX = 0; - offsetY = 0; - originalWidth = 0; - originalHeight = 0; - index = 0; - degrees = 0; - names = null; - values = null; - constructor(page, name) { - super(); - this.page = page; - this.name = name; - page.regions.push(this); - } - }; - - // spine-core/src/attachments/MeshAttachment.ts - var MeshAttachment = class extends VertexAttachment { - region = null; - /** The name of the texture region for this attachment. */ - path; - /** The UV pair for each vertex, normalized within the texture region. */ - regionUVs = []; - /** The UV pair for each vertex, normalized within the entire texture. - * - * See {@link #updateUVs}. */ - uvs = []; - /** Triplets of vertex indices which describe the mesh's triangulation. */ - triangles = []; - /** The color to tint the mesh. */ - color = new Color(1, 1, 1, 1); - /** The width of the mesh's image. Available only when nonessential data was exported. */ - width = 0; - /** The height of the mesh's image. Available only when nonessential data was exported. */ - height = 0; - /** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */ - hullLength = 0; - /** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if - * nonessential data was exported. Triangulation is not performed at runtime. */ - edges = []; - parentMesh = null; - sequence = null; - tempColor = new Color(0, 0, 0, 0); - constructor(name, path) { - super(name); - this.path = path; - } - /** Calculates {@link #uvs} using the {@link #regionUVs} and region. Must be called if the region, the region's properties, or - * the {@link #regionUVs} are changed. */ - updateRegion() { - if (!this.region) - throw new Error("Region not set."); - let regionUVs = this.regionUVs; - if (!this.uvs || this.uvs.length != regionUVs.length) - this.uvs = Utils.newFloatArray(regionUVs.length); - let uvs = this.uvs; - let n = this.uvs.length; - let u = this.region.u, v = this.region.v, width = 0, height = 0; - if (this.region instanceof TextureAtlasRegion) { - let region = this.region, page = region.page; - let textureWidth = page.width, textureHeight = page.height; - switch (region.degrees) { - case 90: - u -= (region.originalHeight - region.offsetY - region.height) / textureWidth; - v -= (region.originalWidth - region.offsetX - region.width) / textureHeight; - width = region.originalHeight / textureWidth; - height = region.originalWidth / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + regionUVs[i + 1] * width; - uvs[i + 1] = v + (1 - regionUVs[i]) * height; - } - return; - case 180: - u -= (region.originalWidth - region.offsetX - region.width) / textureWidth; - v -= region.offsetY / textureHeight; - width = region.originalWidth / textureWidth; - height = region.originalHeight / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + (1 - regionUVs[i]) * width; - uvs[i + 1] = v + (1 - regionUVs[i + 1]) * height; - } - return; - case 270: - u -= region.offsetY / textureWidth; - v -= region.offsetX / textureHeight; - width = region.originalHeight / textureWidth; - height = region.originalWidth / textureHeight; - for (let i = 0; i < n; i += 2) { - uvs[i] = u + (1 - regionUVs[i + 1]) * width; - uvs[i + 1] = v + regionUVs[i] * height; - } - return; - } - u -= region.offsetX / textureWidth; - v -= (region.originalHeight - region.offsetY - region.height) / textureHeight; - width = region.originalWidth / textureWidth; - height = region.originalHeight / textureHeight; - } else if (!this.region) { - u = v = 0; - width = height = 1; - } else { - width = this.region.u2 - u; - height = this.region.v2 - v; - } - for (let i = 0; i < n; i += 2) { - uvs[i] = u + regionUVs[i] * width; - uvs[i + 1] = v + regionUVs[i + 1] * height; - } - } - /** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices}, - * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the - * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */ - getParentMesh() { - return this.parentMesh; - } - /** @param parentMesh May be null. */ - setParentMesh(parentMesh) { - this.parentMesh = parentMesh; - if (parentMesh) { - this.bones = parentMesh.bones; - this.vertices = parentMesh.vertices; - this.worldVerticesLength = parentMesh.worldVerticesLength; - this.regionUVs = parentMesh.regionUVs; - this.triangles = parentMesh.triangles; - this.hullLength = parentMesh.hullLength; - this.worldVerticesLength = parentMesh.worldVerticesLength; - } - } - copy() { - if (this.parentMesh) - return this.newLinkedMesh(); - let copy = new MeshAttachment(this.name, this.path); - copy.region = this.region; - copy.color.setFromColor(this.color); - this.copyTo(copy); - copy.regionUVs = new Array(this.regionUVs.length); - Utils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length); - copy.uvs = new Array(this.uvs.length); - Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length); - copy.triangles = new Array(this.triangles.length); - Utils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length); - copy.hullLength = this.hullLength; - copy.sequence = this.sequence != null ? this.sequence.copy() : null; - if (this.edges) { - copy.edges = new Array(this.edges.length); - Utils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length); - } - copy.width = this.width; - copy.height = this.height; - return copy; - } - computeWorldVertices(slot, start, count, worldVertices2, offset, stride) { - if (this.sequence != null) - this.sequence.apply(slot, this); - super.computeWorldVertices(slot, start, count, worldVertices2, offset, stride); - } - /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/ - newLinkedMesh() { - let copy = new MeshAttachment(this.name, this.path); - copy.region = this.region; - copy.color.setFromColor(this.color); - copy.timelineAttachment = this.timelineAttachment; - copy.setParentMesh(this.parentMesh ? this.parentMesh : this); - if (copy.region != null) - copy.updateRegion(); - return copy; - } - }; - - // spine-core/src/attachments/PathAttachment.ts - var PathAttachment = class extends VertexAttachment { - /** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */ - lengths = []; - /** If true, the start and end knots are connected. */ - closed = false; - /** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer - * calculations are performed but calculating positions along the path is less accurate. */ - constantSpeed = false; - /** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually - * rendered at runtime. */ - color = new Color(1, 1, 1, 1); - constructor(name) { - super(name); - } - copy() { - let copy = new PathAttachment(this.name); - this.copyTo(copy); - copy.lengths = new Array(this.lengths.length); - Utils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length); - copy.closed = closed; - copy.constantSpeed = this.constantSpeed; - copy.color.setFromColor(this.color); - return copy; - } - }; - - // spine-core/src/attachments/PointAttachment.ts - var PointAttachment = class extends VertexAttachment { - x = 0; - y = 0; - rotation = 0; - /** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments - * are not usually rendered at runtime. */ - color = new Color(0.38, 0.94, 0, 1); - constructor(name) { - super(name); - } - computeWorldPosition(bone, point) { - point.x = this.x * bone.a + this.y * bone.b + bone.worldX; - point.y = this.x * bone.c + this.y * bone.d + bone.worldY; - return point; - } - computeWorldRotation(bone) { - const r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r); - const x = cos * bone.a + sin * bone.b; - const y = cos * bone.c + sin * bone.d; - return MathUtils.atan2Deg(y, x); - } - copy() { - let copy = new PointAttachment(this.name); - copy.x = this.x; - copy.y = this.y; - copy.rotation = this.rotation; - copy.color.setFromColor(this.color); - return copy; - } - }; - - // spine-core/src/attachments/RegionAttachment.ts - var _RegionAttachment = class extends Attachment { - /** The local x translation. */ - x = 0; - /** The local y translation. */ - y = 0; - /** The local scaleX. */ - scaleX = 1; - /** The local scaleY. */ - scaleY = 1; - /** The local rotation. */ - rotation = 0; - /** The width of the region attachment in Spine. */ - width = 0; - /** The height of the region attachment in Spine. */ - height = 0; - /** The color to tint the region attachment. */ - color = new Color(1, 1, 1, 1); - /** The name of the texture region for this attachment. */ - path; - region = null; - sequence = null; - /** For each of the 4 vertices, a pair of x,y values that is the local position of the vertex. - * - * See {@link #updateOffset()}. */ - offset = Utils.newFloatArray(8); - uvs = Utils.newFloatArray(8); - tempColor = new Color(1, 1, 1, 1); - constructor(name, path) { - super(name); - this.path = path; - } - /** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */ - updateRegion() { - if (!this.region) - throw new Error("Region not set."); - let region = this.region; - let uvs = this.uvs; - if (region == null) { - uvs[0] = 0; - uvs[1] = 0; - uvs[2] = 0; - uvs[3] = 1; - uvs[4] = 1; - uvs[5] = 1; - uvs[6] = 1; - uvs[7] = 0; - return; - } - let regionScaleX = this.width / this.region.originalWidth * this.scaleX; - let regionScaleY = this.height / this.region.originalHeight * this.scaleY; - let localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX; - let localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY; - let localX2 = localX + this.region.width * regionScaleX; - let localY2 = localY + this.region.height * regionScaleY; - let radians = this.rotation * MathUtils.degRad; - let cos = Math.cos(radians); - let sin = Math.sin(radians); - let x = this.x, y = this.y; - let localXCos = localX * cos + x; - let localXSin = localX * sin; - let localYCos = localY * cos + y; - let localYSin = localY * sin; - let localX2Cos = localX2 * cos + x; - let localX2Sin = localX2 * sin; - let localY2Cos = localY2 * cos + y; - let localY2Sin = localY2 * sin; - let offset = this.offset; - offset[0] = localXCos - localYSin; - offset[1] = localYCos + localXSin; - offset[2] = localXCos - localY2Sin; - offset[3] = localY2Cos + localXSin; - offset[4] = localX2Cos - localY2Sin; - offset[5] = localY2Cos + localX2Sin; - offset[6] = localX2Cos - localYSin; - offset[7] = localYCos + localX2Sin; - if (region.degrees == 90) { - uvs[0] = region.u2; - uvs[1] = region.v2; - uvs[2] = region.u; - uvs[3] = region.v2; - uvs[4] = region.u; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v; - } else { - uvs[0] = region.u; - uvs[1] = region.v2; - uvs[2] = region.u; - uvs[3] = region.v; - uvs[4] = region.u2; - uvs[5] = region.v; - uvs[6] = region.u2; - uvs[7] = region.v2; - } - } - /** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may - * be changed. - *

- * See World transforms in the Spine - * Runtimes Guide. - * @param worldVertices The output world vertices. Must have a length >= offset + 8. - * @param offset The worldVertices index to begin writing values. - * @param stride The number of worldVertices entries between the value pairs written. */ - computeWorldVertices(slot, worldVertices2, offset, stride) { - if (this.sequence != null) - this.sequence.apply(slot, this); - let bone = slot.bone; - let vertexOffset = this.offset; - let x = bone.worldX, y = bone.worldY; - let a = bone.a, b = bone.b, c = bone.c, d = bone.d; - let offsetX = 0, offsetY = 0; - offsetX = vertexOffset[0]; - offsetY = vertexOffset[1]; - worldVertices2[offset] = offsetX * a + offsetY * b + x; - worldVertices2[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[2]; - offsetY = vertexOffset[3]; - worldVertices2[offset] = offsetX * a + offsetY * b + x; - worldVertices2[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[4]; - offsetY = vertexOffset[5]; - worldVertices2[offset] = offsetX * a + offsetY * b + x; - worldVertices2[offset + 1] = offsetX * c + offsetY * d + y; - offset += stride; - offsetX = vertexOffset[6]; - offsetY = vertexOffset[7]; - worldVertices2[offset] = offsetX * a + offsetY * b + x; - worldVertices2[offset + 1] = offsetX * c + offsetY * d + y; - } - copy() { - let copy = new _RegionAttachment(this.name, this.path); - copy.region = this.region; - copy.x = this.x; - copy.y = this.y; - copy.scaleX = this.scaleX; - copy.scaleY = this.scaleY; - copy.rotation = this.rotation; - copy.width = this.width; - copy.height = this.height; - Utils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8); - Utils.arrayCopy(this.offset, 0, copy.offset, 0, 8); - copy.color.setFromColor(this.color); - copy.sequence = this.sequence != null ? this.sequence.copy() : null; - return copy; - } - }; - var RegionAttachment = _RegionAttachment; - __publicField(RegionAttachment, "X1", 0); - __publicField(RegionAttachment, "Y1", 1); - __publicField(RegionAttachment, "C1R", 2); - __publicField(RegionAttachment, "C1G", 3); - __publicField(RegionAttachment, "C1B", 4); - __publicField(RegionAttachment, "C1A", 5); - __publicField(RegionAttachment, "U1", 6); - __publicField(RegionAttachment, "V1", 7); - __publicField(RegionAttachment, "X2", 8); - __publicField(RegionAttachment, "Y2", 9); - __publicField(RegionAttachment, "C2R", 10); - __publicField(RegionAttachment, "C2G", 11); - __publicField(RegionAttachment, "C2B", 12); - __publicField(RegionAttachment, "C2A", 13); - __publicField(RegionAttachment, "U2", 14); - __publicField(RegionAttachment, "V2", 15); - __publicField(RegionAttachment, "X3", 16); - __publicField(RegionAttachment, "Y3", 17); - __publicField(RegionAttachment, "C3R", 18); - __publicField(RegionAttachment, "C3G", 19); - __publicField(RegionAttachment, "C3B", 20); - __publicField(RegionAttachment, "C3A", 21); - __publicField(RegionAttachment, "U3", 22); - __publicField(RegionAttachment, "V3", 23); - __publicField(RegionAttachment, "X4", 24); - __publicField(RegionAttachment, "Y4", 25); - __publicField(RegionAttachment, "C4R", 26); - __publicField(RegionAttachment, "C4G", 27); - __publicField(RegionAttachment, "C4B", 28); - __publicField(RegionAttachment, "C4A", 29); - __publicField(RegionAttachment, "U4", 30); - __publicField(RegionAttachment, "V4", 31); - - // spine-core/src/AtlasAttachmentLoader.ts - var AtlasAttachmentLoader = class { - atlas; - constructor(atlas) { - this.atlas = atlas; - } - loadSequence(name, basePath, sequence) { - let regions = sequence.regions; - for (let i = 0, n = regions.length; i < n; i++) { - let path = sequence.getPath(basePath, i); - let region = this.atlas.findRegion(path); - if (region == null) - throw new Error("Region not found in atlas: " + path + " (sequence: " + name + ")"); - regions[i] = region; - } - } - newRegionAttachment(skin, name, path, sequence) { - let attachment = new RegionAttachment(name, path); - if (sequence != null) { - this.loadSequence(name, path, sequence); - } else { - let region = this.atlas.findRegion(path); - if (!region) - throw new Error("Region not found in atlas: " + path + " (region attachment: " + name + ")"); - attachment.region = region; - } - return attachment; - } - newMeshAttachment(skin, name, path, sequence) { - let attachment = new MeshAttachment(name, path); - if (sequence != null) { - this.loadSequence(name, path, sequence); - } else { - let region = this.atlas.findRegion(path); - if (!region) - throw new Error("Region not found in atlas: " + path + " (mesh attachment: " + name + ")"); - attachment.region = region; - } - return attachment; - } - newBoundingBoxAttachment(skin, name) { - return new BoundingBoxAttachment(name); - } - newPathAttachment(skin, name) { - return new PathAttachment(name); - } - newPointAttachment(skin, name) { - return new PointAttachment(name); - } - newClippingAttachment(skin, name) { - return new ClippingAttachment(name); - } - }; - - // spine-core/src/BoneData.ts - var BoneData = class { - /** The index of the bone in {@link Skeleton#getBones()}. */ - index = 0; - /** The name of the bone, which is unique across all bones in the skeleton. */ - name; - /** @returns May be null. */ - parent = null; - /** The bone's length. */ - length = 0; - /** The local x translation. */ - x = 0; - /** The local y translation. */ - y = 0; - /** The local rotation in degrees, counter clockwise. */ - rotation = 0; - /** The local scaleX. */ - scaleX = 1; - /** The local scaleY. */ - scaleY = 1; - /** The local shearX. */ - shearX = 0; - /** The local shearX. */ - shearY = 0; - /** The transform mode for how parent world transforms affect this bone. */ - inherit = Inherit.Normal; - /** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this - * bone. - * @see Skin#bones */ - skinRequired = false; - /** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually - * rendered at runtime. */ - color = new Color(); - /** The bone icon as it was in Spine, or null if nonessential data was not exported. */ - icon; - /** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */ - visible = false; - constructor(index, name, parent) { - if (index < 0) - throw new Error("index must be >= 0."); - if (!name) - throw new Error("name cannot be null."); - this.index = index; - this.name = name; - this.parent = parent; - } - }; - var Inherit = /* @__PURE__ */ ((Inherit2) => { - Inherit2[Inherit2["Normal"] = 0] = "Normal"; - Inherit2[Inherit2["OnlyTranslation"] = 1] = "OnlyTranslation"; - Inherit2[Inherit2["NoRotationOrReflection"] = 2] = "NoRotationOrReflection"; - Inherit2[Inherit2["NoScale"] = 3] = "NoScale"; - Inherit2[Inherit2["NoScaleOrReflection"] = 4] = "NoScaleOrReflection"; - return Inherit2; - })(Inherit || {}); - - // spine-core/src/Bone.ts - var Bone = class { - /** The bone's setup pose data. */ - data; - /** The skeleton this bone belongs to. */ - skeleton; - /** The parent bone, or null if this is the root bone. */ - parent = null; - /** The immediate children of this bone. */ - children = new Array(); - /** The local x translation. */ - x = 0; - /** The local y translation. */ - y = 0; - /** The local rotation in degrees, counter clockwise. */ - rotation = 0; - /** The local scaleX. */ - scaleX = 0; - /** The local scaleY. */ - scaleY = 0; - /** The local shearX. */ - shearX = 0; - /** The local shearY. */ - shearY = 0; - /** The applied local x translation. */ - ax = 0; - /** The applied local y translation. */ - ay = 0; - /** The applied local rotation in degrees, counter clockwise. */ - arotation = 0; - /** The applied local scaleX. */ - ascaleX = 0; - /** The applied local scaleY. */ - ascaleY = 0; - /** The applied local shearX. */ - ashearX = 0; - /** The applied local shearY. */ - ashearY = 0; - /** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */ - a = 0; - /** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */ - b = 0; - /** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */ - c = 0; - /** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */ - d = 0; - /** The world X position. If changed, {@link #updateAppliedTransform()} should be called. */ - worldY = 0; - /** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */ - worldX = 0; - inherit = 0 /* Normal */; - sorted = false; - active = false; - /** @param parent May be null. */ - constructor(data, skeleton, parent) { - if (!data) - throw new Error("data cannot be null."); - if (!skeleton) - throw new Error("skeleton cannot be null."); - this.data = data; - this.skeleton = skeleton; - this.parent = parent; - this.setToSetupPose(); - } - /** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the - * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */ - isActive() { - return this.active; - } - /** Computes the world transform using the parent bone and this bone's local applied transform. */ - update(physics) { - this.updateWorldTransformWith(this.ax, this.ay, this.arotation, this.ascaleX, this.ascaleY, this.ashearX, this.ashearY); - } - /** Computes the world transform using the parent bone and this bone's local transform. - * - * See {@link #updateWorldTransformWith()}. */ - updateWorldTransform() { - this.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY); - } - /** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the - * specified local transform. Child bones are not updated. - * - * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine - * Runtimes Guide. */ - updateWorldTransformWith(x, y, rotation, scaleX, scaleY, shearX, shearY) { - this.ax = x; - this.ay = y; - this.arotation = rotation; - this.ascaleX = scaleX; - this.ascaleY = scaleY; - this.ashearX = shearX; - this.ashearY = shearY; - let parent = this.parent; - if (!parent) { - let skeleton = this.skeleton; - const sx = skeleton.scaleX, sy = skeleton.scaleY; - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - this.a = Math.cos(rx) * scaleX * sx; - this.b = Math.cos(ry) * scaleY * sx; - this.c = Math.sin(rx) * scaleX * sy; - this.d = Math.sin(ry) * scaleY * sy; - this.worldX = x * sx + skeleton.x; - this.worldY = y * sy + skeleton.y; - return; - } - let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - this.worldX = pa * x + pb * y + parent.worldX; - this.worldY = pc * x + pd * y + parent.worldY; - switch (this.inherit) { - case 0 /* Normal */: { - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - const la = Math.cos(rx) * scaleX; - const lb = Math.cos(ry) * scaleY; - const lc = Math.sin(rx) * scaleX; - const ld = Math.sin(ry) * scaleY; - this.a = pa * la + pb * lc; - this.b = pa * lb + pb * ld; - this.c = pc * la + pd * lc; - this.d = pc * lb + pd * ld; - return; - } - case 1 /* OnlyTranslation */: { - const rx = (rotation + shearX) * MathUtils.degRad; - const ry = (rotation + 90 + shearY) * MathUtils.degRad; - this.a = Math.cos(rx) * scaleX; - this.b = Math.cos(ry) * scaleY; - this.c = Math.sin(rx) * scaleX; - this.d = Math.sin(ry) * scaleY; - break; - } - case 2 /* NoRotationOrReflection */: { - let sx = 1 / this.skeleton.scaleX, sy = 1 / this.skeleton.scaleY; - pa *= sx; - pc *= sy; - let s = pa * pa + pc * pc; - let prx = 0; - if (s > 1e-4) { - s = Math.abs(pa * pd * sy - pb * sx * pc) / s; - pb = pc * s; - pd = pa * s; - prx = Math.atan2(pc, pa) * MathUtils.radDeg; - } else { - pa = 0; - pc = 0; - prx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg; - } - const rx = (rotation + shearX - prx) * MathUtils.degRad; - const ry = (rotation + shearY - prx + 90) * MathUtils.degRad; - const la = Math.cos(rx) * scaleX; - const lb = Math.cos(ry) * scaleY; - const lc = Math.sin(rx) * scaleX; - const ld = Math.sin(ry) * scaleY; - this.a = pa * la - pb * lc; - this.b = pa * lb - pb * ld; - this.c = pc * la + pd * lc; - this.d = pc * lb + pd * ld; - break; - } - case 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: { - rotation *= MathUtils.degRad; - const cos = Math.cos(rotation), sin = Math.sin(rotation); - let za = (pa * cos + pb * sin) / this.skeleton.scaleX; - let zc = (pc * cos + pd * sin) / this.skeleton.scaleY; - let s = Math.sqrt(za * za + zc * zc); - if (s > 1e-5) - s = 1 / s; - za *= s; - zc *= s; - s = Math.sqrt(za * za + zc * zc); - if (this.inherit == 3 /* NoScale */ && pa * pd - pb * pc < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) - s = -s; - rotation = Math.PI / 2 + Math.atan2(zc, za); - const zb = Math.cos(rotation) * s; - const zd = Math.sin(rotation) * s; - shearX *= MathUtils.degRad; - shearY = (90 + shearY) * MathUtils.degRad; - const la = Math.cos(shearX) * scaleX; - const lb = Math.cos(shearY) * scaleY; - const lc = Math.sin(shearX) * scaleX; - const ld = Math.sin(shearY) * scaleY; - this.a = za * la + zb * lc; - this.b = za * lb + zb * ld; - this.c = zc * la + zd * lc; - this.d = zc * lb + zd * ld; - break; - } - } - this.a *= this.skeleton.scaleX; - this.b *= this.skeleton.scaleX; - this.c *= this.skeleton.scaleY; - this.d *= this.skeleton.scaleY; - } - /** Sets this bone's local transform to the setup pose. */ - setToSetupPose() { - let data = this.data; - this.x = data.x; - this.y = data.y; - this.rotation = data.rotation; - this.scaleX = data.scaleX; - this.scaleY = data.scaleY; - this.shearX = data.shearX; - this.shearY = data.shearY; - this.inherit = data.inherit; - } - /** Computes the applied transform values from the world transform. - * - * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so - * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other - * constraints). - * - * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after - * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */ - updateAppliedTransform() { - let parent = this.parent; - if (!parent) { - this.ax = this.worldX - this.skeleton.x; - this.ay = this.worldY - this.skeleton.y; - this.arotation = Math.atan2(this.c, this.a) * MathUtils.radDeg; - this.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c); - this.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d); - this.ashearX = 0; - this.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * MathUtils.radDeg; - return; - } - let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - let pid = 1 / (pa * pd - pb * pc); - let ia = pd * pid, ib = pb * pid, ic = pc * pid, id = pa * pid; - let dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY; - this.ax = dx * ia - dy * ib; - this.ay = dy * id - dx * ic; - let ra, rb, rc, rd; - if (this.inherit == 1 /* OnlyTranslation */) { - ra = this.a; - rb = this.b; - rc = this.c; - rd = this.d; - } else { - switch (this.inherit) { - case 2 /* NoRotationOrReflection */: { - let s2 = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc); - pb = -pc * this.skeleton.scaleX * s2 / this.skeleton.scaleY; - pd = pa * this.skeleton.scaleY * s2 / this.skeleton.scaleX; - pid = 1 / (pa * pd - pb * pc); - ia = pd * pid; - ib = pb * pid; - break; - } - case 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: - let cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation); - pa = (pa * cos + pb * sin) / this.skeleton.scaleX; - pc = (pc * cos + pd * sin) / this.skeleton.scaleY; - let s = Math.sqrt(pa * pa + pc * pc); - if (s > 1e-5) - s = 1 / s; - pa *= s; - pc *= s; - s = Math.sqrt(pa * pa + pc * pc); - if (this.inherit == 3 /* NoScale */ && pid < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) - s = -s; - let r = MathUtils.PI / 2 + Math.atan2(pc, pa); - pb = Math.cos(r) * s; - pd = Math.sin(r) * s; - pid = 1 / (pa * pd - pb * pc); - ia = pd * pid; - ib = pb * pid; - ic = pc * pid; - id = pa * pid; - } - ra = ia * this.a - ib * this.c; - rb = ia * this.b - ib * this.d; - rc = id * this.c - ic * this.a; - rd = id * this.d - ic * this.b; - } - this.ashearX = 0; - this.ascaleX = Math.sqrt(ra * ra + rc * rc); - if (this.ascaleX > 1e-4) { - let det = ra * rd - rb * rc; - this.ascaleY = det / this.ascaleX; - this.ashearY = -Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg; - this.arotation = Math.atan2(rc, ra) * MathUtils.radDeg; - } else { - this.ascaleX = 0; - this.ascaleY = Math.sqrt(rb * rb + rd * rd); - this.ashearY = 0; - this.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg; - } - } - /** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */ - getWorldRotationX() { - return Math.atan2(this.c, this.a) * MathUtils.radDeg; - } - /** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */ - getWorldRotationY() { - return Math.atan2(this.d, this.b) * MathUtils.radDeg; - } - /** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */ - getWorldScaleX() { - return Math.sqrt(this.a * this.a + this.c * this.c); - } - /** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */ - getWorldScaleY() { - return Math.sqrt(this.b * this.b + this.d * this.d); - } - /** Transforms a point from world coordinates to the bone's local coordinates. */ - worldToLocal(world) { - let invDet = 1 / (this.a * this.d - this.b * this.c); - let x = world.x - this.worldX, y = world.y - this.worldY; - world.x = x * this.d * invDet - y * this.b * invDet; - world.y = y * this.a * invDet - x * this.c * invDet; - return world; - } - /** Transforms a point from the bone's local coordinates to world coordinates. */ - localToWorld(local) { - let x = local.x, y = local.y; - local.x = x * this.a + y * this.b + this.worldX; - local.y = x * this.c + y * this.d + this.worldY; - return local; - } - /** Transforms a point from world coordinates to the parent bone's local coordinates. */ - worldToParent(world) { - if (world == null) - throw new Error("world cannot be null."); - return this.parent == null ? world : this.parent.worldToLocal(world); - } - /** Transforms a point from the parent bone's coordinates to world coordinates. */ - parentToWorld(world) { - if (world == null) - throw new Error("world cannot be null."); - return this.parent == null ? world : this.parent.localToWorld(world); - } - /** Transforms a world rotation to a local rotation. */ - worldToLocalRotation(worldRotation) { - let sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation); - return Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * MathUtils.radDeg + this.rotation - this.shearX; - } - /** Transforms a local rotation to a world rotation. */ - localToWorldRotation(localRotation) { - localRotation -= this.rotation - this.shearX; - let sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation); - return Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * MathUtils.radDeg; - } - /** Rotates the world transform the specified amount. - *

- * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and - * {@link #update(Physics)} will need to be called on any child bones, recursively. */ - rotateWorld(degrees) { - degrees *= MathUtils.degRad; - const sin = Math.sin(degrees), cos = Math.cos(degrees); - const ra = this.a, rb = this.b; - this.a = cos * ra - sin * this.c; - this.b = cos * rb - sin * this.d; - this.c = sin * ra + cos * this.c; - this.d = sin * rb + cos * this.d; - } - }; - - // spine-core/src/ConstraintData.ts - var ConstraintData = class { - constructor(name, order, skinRequired) { - this.name = name; - this.order = order; - this.skinRequired = skinRequired; - } - }; - - // spine-core/src/AssetManagerBase.ts - var AssetManagerBase = class { - pathPrefix = ""; - textureLoader; - downloader; - assets = {}; - errors = {}; - toLoad = 0; - loaded = 0; - constructor(textureLoader, pathPrefix = "", downloader = new Downloader()) { - this.textureLoader = textureLoader; - this.pathPrefix = pathPrefix; - this.downloader = downloader; - } - start(path) { - this.toLoad++; - return this.pathPrefix + path; - } - success(callback, path, asset) { - this.toLoad--; - this.loaded++; - this.assets[path] = asset; - if (callback) - callback(path, asset); - } - error(callback, path, message) { - this.toLoad--; - this.loaded++; - this.errors[path] = message; - if (callback) - callback(path, message); - } - loadAll() { - let promise = new Promise((resolve, reject) => { - let check = () => { - if (this.isLoadingComplete()) { - if (this.hasErrors()) - reject(this.errors); - else - resolve(this); - return; - } - requestAnimationFrame(check); - }; - requestAnimationFrame(check); - }); - return promise; - } - setRawDataURI(path, data) { - this.downloader.rawDataUris[this.pathPrefix + path] = data; - } - loadBinary(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - this.downloader.downloadBinary(path, (data) => { - this.success(success, path, data); - }, (status, responseText) => { - this.error(error, path, `Couldn't load binary ${path}: status ${status}, ${responseText}`); - }); - } - loadText(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - this.downloader.downloadText(path, (data) => { - this.success(success, path, data); - }, (status, responseText) => { - this.error(error, path, `Couldn't load text ${path}: status ${status}, ${responseText}`); - }); - } - loadJson(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - this.downloader.downloadJson(path, (data) => { - this.success(success, path, data); - }, (status, responseText) => { - this.error(error, path, `Couldn't load JSON ${path}: status ${status}, ${responseText}`); - }); - } - loadTexture(path, success = () => { - }, error = () => { - }) { - path = this.start(path); - let isBrowser = !!(typeof window !== "undefined" && typeof navigator !== "undefined" && window.document); - let isWebWorker = !isBrowser; - if (isWebWorker) { - fetch(path, { mode: "cors" }).then((response) => { - if (response.ok) - return response.blob(); - this.error(error, path, `Couldn't load image: ${path}`); - return null; - }).then((blob) => { - return blob ? createImageBitmap(blob, { premultiplyAlpha: "none", colorSpaceConversion: "none" }) : null; - }).then((bitmap) => { - if (bitmap) - this.success(success, path, this.textureLoader(bitmap)); - }); - } else { - let image = new Image(); - image.crossOrigin = "anonymous"; - image.onload = () => { - this.success(success, path, this.textureLoader(image)); - }; - image.onerror = () => { - this.error(error, path, `Couldn't load image: ${path}`); - }; - if (this.downloader.rawDataUris[path]) - path = this.downloader.rawDataUris[path]; - image.src = path; - } - } - loadTextureAtlas(path, success = () => { - }, error = () => { - }, fileAlias) { - let index = path.lastIndexOf("/"); - let parent = index >= 0 ? path.substring(0, index + 1) : ""; - path = this.start(path); - this.downloader.downloadText(path, (atlasText) => { - try { - let atlas = new TextureAtlas(atlasText); - let toLoad = atlas.pages.length, abort = false; - for (let page of atlas.pages) { - this.loadTexture( - !fileAlias ? parent + page.name : fileAlias[page.name], - (imagePath, texture) => { - if (!abort) { - page.setTexture(texture); - if (--toLoad == 0) - this.success(success, path, atlas); - } - }, - (imagePath, message) => { - if (!abort) - this.error(error, path, `Couldn't load texture atlas ${path} page image: ${imagePath}`); - abort = true; - } - ); - } - } catch (e) { - this.error(error, path, `Couldn't parse texture atlas ${path}: ${e.message}`); - } - }, (status, responseText) => { - this.error(error, path, `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`); - }); - } - get(path) { - return this.assets[this.pathPrefix + path]; - } - require(path) { - path = this.pathPrefix + path; - let asset = this.assets[path]; - if (asset) - return asset; - let error = this.errors[path]; - throw Error("Asset not found: " + path + (error ? "\n" + error : "")); - } - remove(path) { - path = this.pathPrefix + path; - let asset = this.assets[path]; - if (asset.dispose) - asset.dispose(); - delete this.assets[path]; - return asset; - } - removeAll() { - for (let key in this.assets) { - let asset = this.assets[key]; - if (asset.dispose) - asset.dispose(); - } - this.assets = {}; - } - isLoadingComplete() { - return this.toLoad == 0; - } - getToLoad() { - return this.toLoad; - } - getLoaded() { - return this.loaded; - } - dispose() { - this.removeAll(); - } - hasErrors() { - return Object.keys(this.errors).length > 0; - } - getErrors() { - return this.errors; - } - }; - var Downloader = class { - callbacks = {}; - rawDataUris = {}; - dataUriToString(dataUri) { - if (!dataUri.startsWith("data:")) { - throw new Error("Not a data URI."); - } - let base64Idx = dataUri.indexOf("base64,"); - if (base64Idx != -1) { - base64Idx += "base64,".length; - return atob(dataUri.substr(base64Idx)); - } else { - return dataUri.substr(dataUri.indexOf(",") + 1); - } - } - base64ToUint8Array(base64) { - var binary_string = window.atob(base64); - var len = binary_string.length; - var bytes = new Uint8Array(len); - for (var i = 0; i < len; i++) { - bytes[i] = binary_string.charCodeAt(i); - } - return bytes; - } - dataUriToUint8Array(dataUri) { - if (!dataUri.startsWith("data:")) { - throw new Error("Not a data URI."); - } - let base64Idx = dataUri.indexOf("base64,"); - if (base64Idx == -1) - throw new Error("Not a binary data URI."); - base64Idx += "base64,".length; - return this.base64ToUint8Array(dataUri.substr(base64Idx)); - } - downloadText(url, success, error) { - if (this.start(url, success, error)) - return; - if (this.rawDataUris[url]) { - try { - let dataUri = this.rawDataUris[url]; - this.finish(url, 200, this.dataUriToString(dataUri)); - } catch (e) { - this.finish(url, 400, JSON.stringify(e)); - } - return; - } - let request = new XMLHttpRequest(); - request.overrideMimeType("text/html"); - request.open("GET", url, true); - let done = () => { - this.finish(url, request.status, request.responseText); - }; - request.onload = done; - request.onerror = done; - request.send(); - } - downloadJson(url, success, error) { - this.downloadText(url, (data) => { - success(JSON.parse(data)); - }, error); - } - downloadBinary(url, success, error) { - if (this.start(url, success, error)) - return; - if (this.rawDataUris[url]) { - try { - let dataUri = this.rawDataUris[url]; - this.finish(url, 200, this.dataUriToUint8Array(dataUri)); - } catch (e) { - this.finish(url, 400, JSON.stringify(e)); - } - return; - } - let request = new XMLHttpRequest(); - request.open("GET", url, true); - request.responseType = "arraybuffer"; - let onerror = () => { - this.finish(url, request.status, request.response); - }; - request.onload = () => { - if (request.status == 200 || request.status == 0) - this.finish(url, 200, new Uint8Array(request.response)); - else - onerror(); - }; - request.onerror = onerror; - request.send(); - } - start(url, success, error) { - let callbacks = this.callbacks[url]; - try { - if (callbacks) - return true; - this.callbacks[url] = callbacks = []; - } finally { - callbacks.push(success, error); - } - } - finish(url, status, data) { - let callbacks = this.callbacks[url]; - delete this.callbacks[url]; - let args = status == 200 || status == 0 ? [data] : [status, data]; - for (let i = args.length - 1, n = callbacks.length; i < n; i += 2) - callbacks[i].apply(null, args); - } - }; - - // spine-core/src/Event.ts - var Event = class { - data; - intValue = 0; - floatValue = 0; - stringValue = null; - time = 0; - volume = 0; - balance = 0; - constructor(time, data) { - if (!data) - throw new Error("data cannot be null."); - this.time = time; - this.data = data; - } - }; - - // spine-core/src/EventData.ts - var EventData = class { - name; - intValue = 0; - floatValue = 0; - stringValue = null; - audioPath = null; - volume = 0; - balance = 0; - constructor(name) { - this.name = name; - } - }; - - // spine-core/src/IkConstraint.ts - var IkConstraint = class { - /** The IK constraint's setup pose data. */ - data; - /** The bones that will be modified by this IK constraint. */ - bones; - /** The bone that is the IK target. */ - target; - /** Controls the bend direction of the IK bones, either 1 or -1. */ - bendDirection = 0; - /** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */ - compress = false; - /** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained - * and the parent bone has local nonuniform scale, stretch is not applied. */ - stretch = false; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */ - mix = 1; - /** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */ - softness = 0; - active = false; - constructor(data, skeleton) { - if (!data) - throw new Error("data cannot be null."); - if (!skeleton) - throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = new Array(); - for (let i = 0; i < data.bones.length; i++) { - let bone = skeleton.findBone(data.bones[i].name); - if (!bone) - throw new Error(`Couldn't find bone ${data.bones[i].name}`); - this.bones.push(bone); - } - let target = skeleton.findBone(data.target.name); - if (!target) - throw new Error(`Couldn't find bone ${data.target.name}`); - this.target = target; - this.mix = data.mix; - this.softness = data.softness; - this.bendDirection = data.bendDirection; - this.compress = data.compress; - this.stretch = data.stretch; - } - isActive() { - return this.active; - } - setToSetupPose() { - const data = this.data; - this.mix = data.mix; - this.softness = data.softness; - this.bendDirection = data.bendDirection; - this.compress = data.compress; - this.stretch = data.stretch; - } - update(physics) { - if (this.mix == 0) - return; - let target = this.target; - let bones = this.bones; - switch (bones.length) { - case 1: - this.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix); - break; - case 2: - this.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.data.uniform, this.softness, this.mix); - break; - } - } - /** Applies 1 bone IK. The target is specified in the world coordinate system. */ - apply1(bone, targetX, targetY, compress, stretch, uniform, alpha) { - let p = bone.parent; - if (!p) - throw new Error("IK bone must have parent."); - let pa = p.a, pb = p.b, pc = p.c, pd = p.d; - let rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0; - switch (bone.inherit) { - case 1 /* OnlyTranslation */: - tx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX); - ty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY); - break; - case 2 /* NoRotationOrReflection */: - let s = Math.abs(pa * pd - pb * pc) / Math.max(1e-4, pa * pa + pc * pc); - let sa = pa / bone.skeleton.scaleX; - let sc = pc / bone.skeleton.scaleY; - pb = -sc * s * bone.skeleton.scaleX; - pd = sa * s * bone.skeleton.scaleY; - rotationIK += Math.atan2(sc, sa) * MathUtils.radDeg; - default: - let x = targetX - p.worldX, y = targetY - p.worldY; - let d = pa * pd - pb * pc; - if (Math.abs(d) <= 1e-4) { - tx = 0; - ty = 0; - } else { - tx = (x * pd - y * pb) / d - bone.ax; - ty = (y * pa - x * pc) / d - bone.ay; - } - } - rotationIK += Math.atan2(ty, tx) * MathUtils.radDeg; - if (bone.ascaleX < 0) - rotationIK += 180; - if (rotationIK > 180) - rotationIK -= 360; - else if (rotationIK < -180) - rotationIK += 360; - let sx = bone.ascaleX, sy = bone.ascaleY; - if (compress || stretch) { - switch (bone.inherit) { - case 3 /* NoScale */: - case 4 /* NoScaleOrReflection */: - tx = targetX - bone.worldX; - ty = targetY - bone.worldY; - } - const b = bone.data.length * sx; - if (b > 1e-4) { - const dd = tx * tx + ty * ty; - if (compress && dd < b * b || stretch && dd > b * b) { - const s = (Math.sqrt(dd) / b - 1) * alpha + 1; - sx *= s; - if (uniform) - sy *= s; - } - } - } - bone.updateWorldTransformWith( - bone.ax, - bone.ay, - bone.arotation + rotationIK * alpha, - sx, - sy, - bone.ashearX, - bone.ashearY - ); - } - /** Applies 2 bone IK. The target is specified in the world coordinate system. - * @param child A direct descendant of the parent bone. */ - apply2(parent, child, targetX, targetY, bendDir, stretch, uniform, softness, alpha) { - if (parent.inherit != 0 /* Normal */ || child.inherit != 0 /* Normal */) - return; - let px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX; - let os1 = 0, os2 = 0, s2 = 0; - if (psx < 0) { - psx = -psx; - os1 = 180; - s2 = -1; - } else { - os1 = 0; - s2 = 1; - } - if (psy < 0) { - psy = -psy; - s2 = -s2; - } - if (csx < 0) { - csx = -csx; - os2 = 180; - } else - os2 = 0; - let cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d; - let u = Math.abs(psx - psy) <= 1e-4; - if (!u || stretch) { - cy = 0; - cwx = a * cx + parent.worldX; - cwy = c * cx + parent.worldY; - } else { - cy = child.ay; - cwx = a * cx + b * cy + parent.worldX; - cwy = c * cx + d * cy + parent.worldY; - } - let pp = parent.parent; - if (!pp) - throw new Error("IK parent must itself have a parent."); - a = pp.a; - b = pp.b; - c = pp.c; - d = pp.d; - let id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY; - id = Math.abs(id) <= 1e-4 ? 0 : 1 / id; - let dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py; - let l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2; - if (l1 < 1e-4) { - this.apply1(parent, targetX, targetY, false, stretch, false, alpha); - child.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); - return; - } - x = targetX - pp.worldX; - y = targetY - pp.worldY; - let tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py; - let dd = tx * tx + ty * ty; - if (softness != 0) { - softness *= psx * (csx + 1) * 0.5; - let td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness; - if (sd > 0) { - let p = Math.min(1, sd / (softness * 2)) - 1; - p = (sd - softness * (1 - p * p)) / td; - tx -= p * tx; - ty -= p * ty; - dd = tx * tx + ty * ty; - } - } - outer: - if (u) { - l2 *= psx; - let cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2); - if (cos < -1) { - cos = -1; - a2 = Math.PI * bendDir; - } else if (cos > 1) { - cos = 1; - a2 = 0; - if (stretch) { - a = (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1; - sx *= a; - if (uniform) - sy *= a; - } - } else - a2 = Math.acos(cos) * bendDir; - a = l1 + l2 * cos; - b = l2 * Math.sin(a2); - a1 = Math.atan2(ty * a - tx * b, tx * a + ty * b); - } else { - a = psx * l2; - b = psy * l2; - let aa = a * a, bb = b * b, ta = Math.atan2(ty, tx); - c = bb * l1 * l1 + aa * dd - aa * bb; - let c1 = -2 * bb * l1, c2 = bb - aa; - d = c1 * c1 - 4 * c2 * c; - if (d >= 0) { - let q = Math.sqrt(d); - if (c1 < 0) - q = -q; - q = -(c1 + q) * 0.5; - let r0 = q / c2, r1 = c / q; - let r = Math.abs(r0) < Math.abs(r1) ? r0 : r1; - r0 = dd - r * r; - if (r0 >= 0) { - y = Math.sqrt(r0) * bendDir; - a1 = ta - Math.atan2(y, r); - a2 = Math.atan2(y / psy, (r - l1) / psx); - break outer; - } - } - let minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0; - let maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0; - c = -a * l1 / (aa - bb); - if (c >= -1 && c <= 1) { - c = Math.acos(c); - x = a * Math.cos(c) + l1; - y = b * Math.sin(c); - d = x * x + y * y; - if (d < minDist) { - minAngle = c; - minDist = d; - minX = x; - minY = y; - } - if (d > maxDist) { - maxAngle = c; - maxDist = d; - maxX = x; - maxY = y; - } - } - if (dd <= (minDist + maxDist) * 0.5) { - a1 = ta - Math.atan2(minY * bendDir, minX); - a2 = minAngle * bendDir; - } else { - a1 = ta - Math.atan2(maxY * bendDir, maxX); - a2 = maxAngle * bendDir; - } - } - let os = Math.atan2(cy, cx) * s2; - let rotation = parent.arotation; - a1 = (a1 - os) * MathUtils.radDeg + os1 - rotation; - if (a1 > 180) - a1 -= 360; - else if (a1 < -180) - a1 += 360; - parent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, sy, 0, 0); - rotation = child.arotation; - a2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation; - if (a2 > 180) - a2 -= 360; - else if (a2 < -180) - a2 += 360; - child.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY); - } - }; - - // spine-core/src/IkConstraintData.ts - var IkConstraintData = class extends ConstraintData { - /** The bones that are constrained by this IK constraint. */ - bones = new Array(); - /** The bone that is the IK target. */ - _target = null; - set target(boneData) { - this._target = boneData; - } - get target() { - if (!this._target) - throw new Error("BoneData not set."); - else - return this._target; - } - /** Controls the bend direction of the IK bones, either 1 or -1. */ - bendDirection = 0; - /** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */ - compress = false; - /** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained - * and the parent bone has local nonuniform scale, stretch is not applied. */ - stretch = false; - /** When true, only a single bone is being constrained, and {@link #getCompress()} or {@link #getStretch()} is used, the bone - * is scaled on both the X and Y axes. */ - uniform = false; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */ - mix = 0; - /** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */ - softness = 0; - constructor(name) { - super(name, 0, false); - } - }; - - // spine-core/src/PathConstraintData.ts - var PathConstraintData = class extends ConstraintData { - /** The bones that will be modified by this path constraint. */ - bones = new Array(); - /** The slot whose path attachment will be used to constrained the bones. */ - _target = null; - set target(slotData) { - this._target = slotData; - } - get target() { - if (!this._target) - throw new Error("SlotData not set."); - else - return this._target; - } - /** The mode for positioning the first bone on the path. */ - positionMode = PositionMode.Fixed; - /** The mode for positioning the bones after the first bone on the path. */ - spacingMode = SpacingMode.Fixed; - /** The mode for adjusting the rotation of the bones. */ - rotateMode = RotateMode.Chain; - /** An offset added to the constrained bone rotation. */ - offsetRotation = 0; - /** The position along the path. */ - position = 0; - /** The spacing between bones. */ - spacing = 0; - mixRotate = 0; - mixX = 0; - mixY = 0; - constructor(name) { - super(name, 0, false); - } - }; - var PositionMode = /* @__PURE__ */ ((PositionMode2) => { - PositionMode2[PositionMode2["Fixed"] = 0] = "Fixed"; - PositionMode2[PositionMode2["Percent"] = 1] = "Percent"; - return PositionMode2; - })(PositionMode || {}); - var SpacingMode = /* @__PURE__ */ ((SpacingMode2) => { - SpacingMode2[SpacingMode2["Length"] = 0] = "Length"; - SpacingMode2[SpacingMode2["Fixed"] = 1] = "Fixed"; - SpacingMode2[SpacingMode2["Percent"] = 2] = "Percent"; - SpacingMode2[SpacingMode2["Proportional"] = 3] = "Proportional"; - return SpacingMode2; - })(SpacingMode || {}); - var RotateMode = /* @__PURE__ */ ((RotateMode2) => { - RotateMode2[RotateMode2["Tangent"] = 0] = "Tangent"; - RotateMode2[RotateMode2["Chain"] = 1] = "Chain"; - RotateMode2[RotateMode2["ChainScale"] = 2] = "ChainScale"; - return RotateMode2; - })(RotateMode || {}); - - // spine-core/src/PathConstraint.ts - var _PathConstraint = class { - /** The path constraint's setup pose data. */ - data; - /** The bones that will be modified by this path constraint. */ - bones; - /** The slot whose path attachment will be used to constrained the bones. */ - target; - /** The position along the path. */ - position = 0; - /** The spacing between bones. */ - spacing = 0; - mixRotate = 0; - mixX = 0; - mixY = 0; - spaces = new Array(); - positions = new Array(); - world = new Array(); - curves = new Array(); - lengths = new Array(); - segments = new Array(); - active = false; - constructor(data, skeleton) { - if (!data) - throw new Error("data cannot be null."); - if (!skeleton) - throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = new Array(); - for (let i = 0, n = data.bones.length; i < n; i++) { - let bone = skeleton.findBone(data.bones[i].name); - if (!bone) - throw new Error(`Couldn't find bone ${data.bones[i].name}.`); - this.bones.push(bone); - } - let target = skeleton.findSlot(data.target.name); - if (!target) - throw new Error(`Couldn't find target bone ${data.target.name}`); - this.target = target; - this.position = data.position; - this.spacing = data.spacing; - this.mixRotate = data.mixRotate; - this.mixX = data.mixX; - this.mixY = data.mixY; - } - isActive() { - return this.active; - } - setToSetupPose() { - const data = this.data; - this.position = data.position; - this.spacing = data.spacing; - this.mixRotate = data.mixRotate; - this.mixX = data.mixX; - this.mixY = data.mixY; - } - update(physics) { - let attachment = this.target.getAttachment(); - if (!(attachment instanceof PathAttachment)) - return; - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY; - if (mixRotate == 0 && mixX == 0 && mixY == 0) - return; - let data = this.data; - let tangents = data.rotateMode == 0 /* Tangent */, scale = data.rotateMode == 2 /* ChainScale */; - let bones = this.bones; - let boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1; - let spaces = Utils.setArraySize(this.spaces, spacesCount), lengths = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : []; - let spacing = this.spacing; - switch (data.spacingMode) { - case 2 /* Percent */: - if (scale) { - for (let i = 0, n = spacesCount - 1; i < n; i++) { - let bone = bones[i]; - let setupLength = bone.data.length; - let x = setupLength * bone.a, y = setupLength * bone.c; - lengths[i] = Math.sqrt(x * x + y * y); - } - } - Utils.arrayFill(spaces, 1, spacesCount, spacing); - break; - case 3 /* Proportional */: - let sum = 0; - for (let i = 0, n = spacesCount - 1; i < n; ) { - let bone = bones[i]; - let setupLength = bone.data.length; - if (setupLength < _PathConstraint.epsilon) { - if (scale) - lengths[i] = 0; - spaces[++i] = spacing; - } else { - let x = setupLength * bone.a, y = setupLength * bone.c; - let length = Math.sqrt(x * x + y * y); - if (scale) - lengths[i] = length; - spaces[++i] = length; - sum += length; - } - } - if (sum > 0) { - sum = spacesCount / sum * spacing; - for (let i = 1; i < spacesCount; i++) - spaces[i] *= sum; - } - break; - default: - let lengthSpacing = data.spacingMode == 0 /* Length */; - for (let i = 0, n = spacesCount - 1; i < n; ) { - let bone = bones[i]; - let setupLength = bone.data.length; - if (setupLength < _PathConstraint.epsilon) { - if (scale) - lengths[i] = 0; - spaces[++i] = spacing; - } else { - let x = setupLength * bone.a, y = setupLength * bone.c; - let length = Math.sqrt(x * x + y * y); - if (scale) - lengths[i] = length; - spaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength; - } - } - } - let positions = this.computeWorldPositions(attachment, spacesCount, tangents); - let boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation; - let tip = false; - if (offsetRotation == 0) - tip = data.rotateMode == 1 /* Chain */; - else { - tip = false; - let p = this.target.bone; - offsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad; - } - for (let i = 0, p = 3; i < boneCount; i++, p += 3) { - let bone = bones[i]; - bone.worldX += (boneX - bone.worldX) * mixX; - bone.worldY += (boneY - bone.worldY) * mixY; - let x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY; - if (scale) { - let length = lengths[i]; - if (length != 0) { - let s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * mixRotate + 1; - bone.a *= s; - bone.c *= s; - } - } - boneX = x; - boneY = y; - if (mixRotate > 0) { - let a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0; - if (tangents) - r = positions[p - 1]; - else if (spaces[i + 1] == 0) - r = positions[p + 2]; - else - r = Math.atan2(dy, dx); - r -= Math.atan2(c, a); - if (tip) { - cos = Math.cos(r); - sin = Math.sin(r); - let length = bone.data.length; - boneX += (length * (cos * a - sin * c) - dx) * mixRotate; - boneY += (length * (sin * a + cos * c) - dy) * mixRotate; - } else { - r += offsetRotation; - } - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r *= mixRotate; - cos = Math.cos(r); - sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - } - bone.updateAppliedTransform(); - } - } - computeWorldPositions(path, spacesCount, tangents) { - let target = this.target; - let position = this.position; - let spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world = this.world; - let closed2 = path.closed; - let verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = _PathConstraint.NONE; - if (!path.constantSpeed) { - let lengths = path.lengths; - curveCount -= closed2 ? 1 : 2; - let pathLength2 = lengths[curveCount]; - if (this.data.positionMode == 1 /* Percent */) - position *= pathLength2; - let multiplier2; - switch (this.data.spacingMode) { - case 2 /* Percent */: - multiplier2 = pathLength2; - break; - case 3 /* Proportional */: - multiplier2 = pathLength2 / spacesCount; - break; - default: - multiplier2 = 1; - } - world = Utils.setArraySize(this.world, 8); - for (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) { - let space = spaces[i] * multiplier2; - position += space; - let p = position; - if (closed2) { - p %= pathLength2; - if (p < 0) - p += pathLength2; - curve = 0; - } else if (p < 0) { - if (prevCurve != _PathConstraint.BEFORE) { - prevCurve = _PathConstraint.BEFORE; - path.computeWorldVertices(target, 2, 4, world, 0, 2); - } - this.addBeforePosition(p, world, 0, out, o); - continue; - } else if (p > pathLength2) { - if (prevCurve != _PathConstraint.AFTER) { - prevCurve = _PathConstraint.AFTER; - path.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2); - } - this.addAfterPosition(p - pathLength2, world, 0, out, o); - continue; - } - for (; ; curve++) { - let length = lengths[curve]; - if (p > length) - continue; - if (curve == 0) - p /= length; - else { - let prev = lengths[curve - 1]; - p = (p - prev) / (length - prev); - } - break; - } - if (curve != prevCurve) { - prevCurve = curve; - if (closed2 && curve == curveCount) { - path.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2); - path.computeWorldVertices(target, 0, 4, world, 4, 2); - } else - path.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2); - } - this.addCurvePosition( - p, - world[0], - world[1], - world[2], - world[3], - world[4], - world[5], - world[6], - world[7], - out, - o, - tangents || i > 0 && space == 0 - ); - } - return out; - } - if (closed2) { - verticesLength += 2; - world = Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2); - path.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2); - world[verticesLength - 2] = world[0]; - world[verticesLength - 1] = world[1]; - } else { - curveCount--; - verticesLength -= 4; - world = Utils.setArraySize(this.world, verticesLength); - path.computeWorldVertices(target, 2, verticesLength, world, 0, 2); - } - let curves = Utils.setArraySize(this.curves, curveCount); - let pathLength = 0; - let x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0; - let tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0; - for (let i = 0, w = 2; i < curveCount; i++, w += 6) { - cx1 = world[w]; - cy1 = world[w + 1]; - cx2 = world[w + 2]; - cy2 = world[w + 3]; - x2 = world[w + 4]; - y2 = world[w + 5]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.1875; - tmpy = (y1 - cy1 * 2 + cy2) * 0.1875; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667; - dfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx; - dfy += ddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - pathLength += Math.sqrt(dfx * dfx + dfy * dfy); - curves[i] = pathLength; - x1 = x2; - y1 = y2; - } - if (this.data.positionMode == 1 /* Percent */) - position *= pathLength; - let multiplier; - switch (this.data.spacingMode) { - case 2 /* Percent */: - multiplier = pathLength; - break; - case 3 /* Proportional */: - multiplier = pathLength / spacesCount; - break; - default: - multiplier = 1; - } - let segments = this.segments; - let curveLength = 0; - for (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) { - let space = spaces[i] * multiplier; - position += space; - let p = position; - if (closed2) { - p %= pathLength; - if (p < 0) - p += pathLength; - curve = 0; - } else if (p < 0) { - this.addBeforePosition(p, world, 0, out, o); - continue; - } else if (p > pathLength) { - this.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o); - continue; - } - for (; ; curve++) { - let length = curves[curve]; - if (p > length) - continue; - if (curve == 0) - p /= length; - else { - let prev = curves[curve - 1]; - p = (p - prev) / (length - prev); - } - break; - } - if (curve != prevCurve) { - prevCurve = curve; - let ii = curve * 6; - x1 = world[ii]; - y1 = world[ii + 1]; - cx1 = world[ii + 2]; - cy1 = world[ii + 3]; - cx2 = world[ii + 4]; - cy2 = world[ii + 5]; - x2 = world[ii + 6]; - y2 = world[ii + 7]; - tmpx = (x1 - cx1 * 2 + cx2) * 0.03; - tmpy = (y1 - cy1 * 2 + cy2) * 0.03; - dddfx = ((cx1 - cx2) * 3 - x1 + x2) * 6e-3; - dddfy = ((cy1 - cy2) * 3 - y1 + y2) * 6e-3; - ddfx = tmpx * 2 + dddfx; - ddfy = tmpy * 2 + dddfy; - dfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667; - dfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667; - curveLength = Math.sqrt(dfx * dfx + dfy * dfy); - segments[0] = curveLength; - for (ii = 1; ii < 8; ii++) { - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[ii] = curveLength; - } - dfx += ddfx; - dfy += ddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[8] = curveLength; - dfx += ddfx + dddfx; - dfy += ddfy + dddfy; - curveLength += Math.sqrt(dfx * dfx + dfy * dfy); - segments[9] = curveLength; - segment = 0; - } - p *= curveLength; - for (; ; segment++) { - let length = segments[segment]; - if (p > length) - continue; - if (segment == 0) - p /= length; - else { - let prev = segments[segment - 1]; - p = segment + (p - prev) / (length - prev); - } - break; - } - this.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || i > 0 && space == 0); - } - return out; - } - addBeforePosition(p, temp, i, out, o) { - let x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx); - out[o] = x1 + p * Math.cos(r); - out[o + 1] = y1 + p * Math.sin(r); - out[o + 2] = r; - } - addAfterPosition(p, temp, i, out, o) { - let x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx); - out[o] = x1 + p * Math.cos(r); - out[o + 1] = y1 + p * Math.sin(r); - out[o + 2] = r; - } - addCurvePosition(p, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents) { - if (p == 0 || isNaN(p)) { - out[o] = x1; - out[o + 1] = y1; - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - return; - } - let tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u; - let ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p; - let x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt; - out[o] = x; - out[o + 1] = y; - if (tangents) { - if (p < 1e-3) - out[o + 2] = Math.atan2(cy1 - y1, cx1 - x1); - else - out[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt)); - } - } - }; - var PathConstraint = _PathConstraint; - __publicField(PathConstraint, "NONE", -1); - __publicField(PathConstraint, "BEFORE", -2); - __publicField(PathConstraint, "AFTER", -3); - __publicField(PathConstraint, "epsilon", 1e-5); - - // spine-core/src/PhysicsConstraint.ts - var PhysicsConstraint = class { - data; - _bone = null; - /** The bone constrained by this physics constraint. */ - set bone(bone) { - this._bone = bone; - } - get bone() { - if (!this._bone) - throw new Error("Bone not set."); - else - return this._bone; - } - inertia = 0; - strength = 0; - damping = 0; - massInverse = 0; - wind = 0; - gravity = 0; - mix = 0; - _reset = true; - ux = 0; - uy = 0; - cx = 0; - cy = 0; - tx = 0; - ty = 0; - xOffset = 0; - xVelocity = 0; - yOffset = 0; - yVelocity = 0; - rotateOffset = 0; - rotateVelocity = 0; - scaleOffset = 0; - scaleVelocity = 0; - active = false; - skeleton; - remaining = 0; - lastTime = 0; - constructor(data, skeleton) { - this.data = data; - this.skeleton = skeleton; - this.bone = skeleton.bones[data.bone.index]; - this.inertia = data.inertia; - this.strength = data.strength; - this.damping = data.damping; - this.massInverse = data.massInverse; - this.wind = data.wind; - this.gravity = data.gravity; - this.mix = data.mix; - } - reset() { - this.remaining = 0; - this.lastTime = this.skeleton.time; - this._reset = true; - this.xOffset = 0; - this.xVelocity = 0; - this.yOffset = 0; - this.yVelocity = 0; - this.rotateOffset = 0; - this.rotateVelocity = 0; - this.scaleOffset = 0; - this.scaleVelocity = 0; - } - setToSetupPose() { - const data = this.data; - this.inertia = data.inertia; - this.strength = data.strength; - this.damping = data.damping; - this.massInverse = data.massInverse; - this.wind = data.wind; - this.gravity = data.gravity; - this.mix = data.mix; - } - isActive() { - return this.active; - } - /** Applies the constraint to the constrained bones. */ - update(physics) { - const mix = this.mix; - if (mix == 0) - return; - const x = this.data.x > 0, y = this.data.y > 0, rotateOrShearX = this.data.rotate > 0 || this.data.shearX > 0, scaleX = this.data.scaleX > 0; - const bone = this.bone; - const l = bone.data.length; - switch (physics) { - case 0 /* none */: - return; - case 1 /* reset */: - this.reset(); - case 2 /* update */: - const skeleton = this.skeleton; - const delta = Math.max(this.skeleton.time - this.lastTime, 0); - this.remaining += delta; - this.lastTime = skeleton.time; - const bx = bone.worldX, by = bone.worldY; - if (this._reset) { - this._reset = false; - this.ux = bx; - this.uy = by; - } else { - let a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1; - let qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY); - qx *= Math.abs(skeleton.scaleX); - if (x || y) { - if (x) { - const u = (this.ux - bx) * i; - this.xOffset += u > qx ? qx : u < -qx ? -qx : u; - this.ux = bx; - } - if (y) { - const u = (this.uy - by) * i; - this.yOffset += u > qy ? qy : u < -qy ? -qy : u; - this.uy = by; - } - if (a >= t) { - d = Math.pow(this.damping, 60 * t); - const m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = this.gravity * f * skeleton.scaleY; - do { - if (x) { - this.xVelocity += (w - this.xOffset * e) * m; - this.xOffset += this.xVelocity * t; - this.xVelocity *= d; - } - if (y) { - this.yVelocity -= (g + this.yOffset * e) * m; - this.yOffset += this.yVelocity * t; - this.yVelocity *= d; - } - a -= t; - } while (a >= t); - } - if (x) - bone.worldX += this.xOffset * mix * this.data.x; - if (y) - bone.worldY += this.yOffset * mix * this.data.y; - } - if (rotateOrShearX || scaleX) { - let ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0; - let dx = this.cx - bone.worldX, dy = this.cy - bone.worldY; - if (dx > qx) - dx = qx; - else if (dx < -qx) - dx = -qx; - if (dy > qy) - dy = qy; - else if (dy < -qy) - dy = -qy; - if (rotateOrShearX) { - mr = (this.data.rotate + this.data.shearX) * mix; - let r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr; - this.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i; - r = this.rotateOffset * mr + ca; - c = Math.cos(r); - s = Math.sin(r); - if (scaleX) { - r = l * bone.getWorldScaleX(); - if (r > 0) - this.scaleOffset += (dx * c + dy * s) * i / r; - } - } else { - c = Math.cos(ca); - s = Math.sin(ca); - const r = l * bone.getWorldScaleX(); - if (r > 0) - this.scaleOffset += (dx * c + dy * s) * i / r; - } - a = this.remaining; - if (a >= t) { - if (d == -1) - d = Math.pow(this.damping, 60 * t); - const m = this.massInverse * t, e = this.strength, w = this.wind, g = Skeleton.yDown ? -this.gravity : this.gravity, h = l / f; - while (true) { - a -= t; - if (scaleX) { - this.scaleVelocity += (w * c - g * s - this.scaleOffset * e) * m; - this.scaleOffset += this.scaleVelocity * t; - this.scaleVelocity *= d; - } - if (rotateOrShearX) { - this.rotateVelocity -= ((w * s + g * c) * h + this.rotateOffset * e) * m; - this.rotateOffset += this.rotateVelocity * t; - this.rotateVelocity *= d; - if (a < t) - break; - const r = this.rotateOffset * mr + ca; - c = Math.cos(r); - s = Math.sin(r); - } else if (a < t) - break; - } - } - } - this.remaining = a; - } - this.cx = bone.worldX; - this.cy = bone.worldY; - break; - case 3 /* pose */: - if (x) - bone.worldX += this.xOffset * mix * this.data.x; - if (y) - bone.worldY += this.yOffset * mix * this.data.y; - } - if (rotateOrShearX) { - let o = this.rotateOffset * mix, s = 0, c = 0, a = 0; - if (this.data.shearX > 0) { - let r = 0; - if (this.data.rotate > 0) { - r = o * this.data.rotate; - s = Math.sin(r); - c = Math.cos(r); - a = bone.b; - bone.b = c * a - s * bone.d; - bone.d = s * a + c * bone.d; - } - r += o * this.data.shearX; - s = Math.sin(r); - c = Math.cos(r); - a = bone.a; - bone.a = c * a - s * bone.c; - bone.c = s * a + c * bone.c; - } else { - o *= this.data.rotate; - s = Math.sin(o); - c = Math.cos(o); - a = bone.a; - bone.a = c * a - s * bone.c; - bone.c = s * a + c * bone.c; - a = bone.b; - bone.b = c * a - s * bone.d; - bone.d = s * a + c * bone.d; - } - } - if (scaleX) { - const s = 1 + this.scaleOffset * mix * this.data.scaleX; - bone.a *= s; - bone.c *= s; - } - if (physics != 3 /* pose */) { - this.tx = l * bone.a; - this.ty = l * bone.c; - } - bone.updateAppliedTransform(); - } - /** Translates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone moved an additional - * amount in world space. */ - translate(x, y) { - this.ux -= x; - this.uy -= y; - this.cx -= x; - this.cy -= y; - } - /** Rotates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone rotated around the - * specified point in world space. */ - rotate(x, y, degrees) { - const r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r); - const dx = this.cx - x, dy = this.cy - y; - this.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy); - } - }; - - // spine-core/src/Slot.ts - var Slot = class { - /** The slot's setup pose data. */ - data; - /** The bone this slot belongs to. */ - bone; - /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two - * color tinting. */ - color; - /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark - * color's alpha is not used. */ - darkColor = null; - attachment = null; - attachmentState = 0; - /** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the - * {@link Sequence#getSetupIndex()}. */ - sequenceIndex = -1; - /** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a - * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions. - * - * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */ - deform = new Array(); - constructor(data, bone) { - if (!data) - throw new Error("data cannot be null."); - if (!bone) - throw new Error("bone cannot be null."); - this.data = data; - this.bone = bone; - this.color = new Color(); - this.darkColor = !data.darkColor ? null : new Color(); - this.setToSetupPose(); - } - /** The skeleton this slot belongs to. */ - getSkeleton() { - return this.bone.skeleton; - } - /** The current attachment for the slot, or null if the slot has no attachment. */ - getAttachment() { - return this.attachment; - } - /** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}. - * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the - * specified attachment. */ - setAttachment(attachment) { - if (this.attachment == attachment) - return; - if (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment) || attachment.timelineAttachment != this.attachment.timelineAttachment) { - this.deform.length = 0; - } - this.attachment = attachment; - this.sequenceIndex = -1; - } - /** Sets this slot to the setup pose. */ - setToSetupPose() { - this.color.setFromColor(this.data.color); - if (this.darkColor) - this.darkColor.setFromColor(this.data.darkColor); - if (!this.data.attachmentName) - this.attachment = null; - else { - this.attachment = null; - this.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName)); - } - } - }; - - // spine-core/src/TransformConstraint.ts - var TransformConstraint = class { - /** The transform constraint's setup pose data. */ - data; - /** The bones that will be modified by this transform constraint. */ - bones; - /** The target bone whose world transform will be copied to the constrained bones. */ - target; - mixRotate = 0; - mixX = 0; - mixY = 0; - mixScaleX = 0; - mixScaleY = 0; - mixShearY = 0; - temp = new Vector2(); - active = false; - constructor(data, skeleton) { - if (!data) - throw new Error("data cannot be null."); - if (!skeleton) - throw new Error("skeleton cannot be null."); - this.data = data; - this.bones = new Array(); - for (let i = 0; i < data.bones.length; i++) { - let bone = skeleton.findBone(data.bones[i].name); - if (!bone) - throw new Error(`Couldn't find bone ${data.bones[i].name}.`); - this.bones.push(bone); - } - let target = skeleton.findBone(data.target.name); - if (!target) - throw new Error(`Couldn't find target bone ${data.target.name}.`); - this.target = target; - this.mixRotate = data.mixRotate; - this.mixX = data.mixX; - this.mixY = data.mixY; - this.mixScaleX = data.mixScaleX; - this.mixScaleY = data.mixScaleY; - this.mixShearY = data.mixShearY; - } - isActive() { - return this.active; - } - setToSetupPose() { - const data = this.data; - this.mixRotate = data.mixRotate; - this.mixX = data.mixX; - this.mixY = data.mixY; - this.mixScaleX = data.mixScaleX; - this.mixScaleY = data.mixScaleY; - this.mixShearY = data.mixShearY; - } - update(physics) { - if (this.mixRotate == 0 && this.mixX == 0 && this.mixY == 0 && this.mixScaleX == 0 && this.mixScaleY == 0 && this.mixShearY == 0) - return; - if (this.data.local) { - if (this.data.relative) - this.applyRelativeLocal(); - else - this.applyAbsoluteLocal(); - } else { - if (this.data.relative) - this.applyRelativeWorld(); - else - this.applyAbsoluteWorld(); - } - } - applyAbsoluteWorld() { - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY; - let translate = mixX != 0 || mixY != 0; - let target = this.target; - let ta = target.a, tb = target.b, tc = target.c, td = target.d; - let degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad; - let offsetRotation = this.data.offsetRotation * degRadReflect; - let offsetShearY = this.data.offsetShearY * degRadReflect; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (mixRotate != 0) { - let a = bone.a, b = bone.b, c = bone.c, d = bone.d; - let r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation; - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r *= mixRotate; - let cos = Math.cos(r), sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - } - if (translate) { - let temp = this.temp; - target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - bone.worldX += (temp.x - bone.worldX) * mixX; - bone.worldY += (temp.y - bone.worldY) * mixY; - } - if (mixScaleX != 0) { - let s = Math.sqrt(bone.a * bone.a + bone.c * bone.c); - if (s != 0) - s = (s + (Math.sqrt(ta * ta + tc * tc) - s + this.data.offsetScaleX) * mixScaleX) / s; - bone.a *= s; - bone.c *= s; - } - if (mixScaleY != 0) { - let s = Math.sqrt(bone.b * bone.b + bone.d * bone.d); - if (s != 0) - s = (s + (Math.sqrt(tb * tb + td * td) - s + this.data.offsetScaleY) * mixScaleY) / s; - bone.b *= s; - bone.d *= s; - } - if (mixShearY > 0) { - let b = bone.b, d = bone.d; - let by = Math.atan2(d, b); - let r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a)); - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r = by + (r + offsetShearY) * mixShearY; - let s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(r) * s; - bone.d = Math.sin(r) * s; - } - bone.updateAppliedTransform(); - } - } - applyRelativeWorld() { - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY; - let translate = mixX != 0 || mixY != 0; - let target = this.target; - let ta = target.a, tb = target.b, tc = target.c, td = target.d; - let degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad; - let offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (mixRotate != 0) { - let a = bone.a, b = bone.b, c = bone.c, d = bone.d; - let r = Math.atan2(tc, ta) + offsetRotation; - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - r *= mixRotate; - let cos = Math.cos(r), sin = Math.sin(r); - bone.a = cos * a - sin * c; - bone.b = cos * b - sin * d; - bone.c = sin * a + cos * c; - bone.d = sin * b + cos * d; - } - if (translate) { - let temp = this.temp; - target.localToWorld(temp.set(this.data.offsetX, this.data.offsetY)); - bone.worldX += temp.x * mixX; - bone.worldY += temp.y * mixY; - } - if (mixScaleX != 0) { - let s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * mixScaleX + 1; - bone.a *= s; - bone.c *= s; - } - if (mixScaleY != 0) { - let s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * mixScaleY + 1; - bone.b *= s; - bone.d *= s; - } - if (mixShearY > 0) { - let r = Math.atan2(td, tb) - Math.atan2(tc, ta); - if (r > MathUtils.PI) - r -= MathUtils.PI2; - else if (r < -MathUtils.PI) - r += MathUtils.PI2; - let b = bone.b, d = bone.d; - r = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * mixShearY; - let s = Math.sqrt(b * b + d * d); - bone.b = Math.cos(r) * s; - bone.d = Math.sin(r) * s; - } - bone.updateAppliedTransform(); - } - } - applyAbsoluteLocal() { - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY; - let target = this.target; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - let rotation = bone.arotation; - if (mixRotate != 0) - rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate; - let x = bone.ax, y = bone.ay; - x += (target.ax - x + this.data.offsetX) * mixX; - y += (target.ay - y + this.data.offsetY) * mixY; - let scaleX = bone.ascaleX, scaleY = bone.ascaleY; - if (mixScaleX != 0 && scaleX != 0) - scaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * mixScaleX) / scaleX; - if (mixScaleY != 0 && scaleY != 0) - scaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY; - let shearY = bone.ashearY; - if (mixShearY != 0) - shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY; - bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); - } - } - applyRelativeLocal() { - let mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX, mixScaleY = this.mixScaleY, mixShearY = this.mixShearY; - let target = this.target; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - let rotation = bone.arotation + (target.arotation + this.data.offsetRotation) * mixRotate; - let x = bone.ax + (target.ax + this.data.offsetX) * mixX; - let y = bone.ay + (target.ay + this.data.offsetY) * mixY; - let scaleX = bone.ascaleX * ((target.ascaleX - 1 + this.data.offsetScaleX) * mixScaleX + 1); - let scaleY = bone.ascaleY * ((target.ascaleY - 1 + this.data.offsetScaleY) * mixScaleY + 1); - let shearY = bone.ashearY + (target.ashearY + this.data.offsetShearY) * mixShearY; - bone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY); - } - } - }; - - // spine-core/src/Skeleton.ts - var _Skeleton = class { - /** The skeleton's setup pose data. */ - data; - /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ - bones; - /** The skeleton's slots in the setup pose draw order. */ - slots; - /** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */ - drawOrder; - /** The skeleton's IK constraints. */ - ikConstraints; - /** The skeleton's transform constraints. */ - transformConstraints; - /** The skeleton's path constraints. */ - pathConstraints; - /** The skeleton's physics constraints. */ - physicsConstraints; - /** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}. */ - _updateCache = new Array(); - /** The skeleton's current skin. May be null. */ - skin = null; - /** The color to tint all the skeleton's attachments. */ - color; - /** Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale - * inheritance. */ - scaleX = 1; - /** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale - * inheritance. */ - _scaleY = 1; - get scaleY() { - return _Skeleton.yDown ? -this._scaleY : this._scaleY; - } - set scaleY(scaleY) { - this._scaleY = scaleY; - } - /** Sets the skeleton X position, which is added to the root bone worldX position. */ - x = 0; - /** Sets the skeleton Y position, which is added to the root bone worldY position. */ - y = 0; - /** Returns the skeleton's time. This is used for time-based manipulations, such as {@link PhysicsConstraint}. - *

- * See {@link #update(float)}. */ - time = 0; - constructor(data) { - if (!data) - throw new Error("data cannot be null."); - this.data = data; - this.bones = new Array(); - for (let i = 0; i < data.bones.length; i++) { - let boneData = data.bones[i]; - let bone; - if (!boneData.parent) - bone = new Bone(boneData, this, null); - else { - let parent = this.bones[boneData.parent.index]; - bone = new Bone(boneData, this, parent); - parent.children.push(bone); - } - this.bones.push(bone); - } - this.slots = new Array(); - this.drawOrder = new Array(); - for (let i = 0; i < data.slots.length; i++) { - let slotData = data.slots[i]; - let bone = this.bones[slotData.boneData.index]; - let slot = new Slot(slotData, bone); - this.slots.push(slot); - this.drawOrder.push(slot); - } - this.ikConstraints = new Array(); - for (let i = 0; i < data.ikConstraints.length; i++) { - let ikConstraintData = data.ikConstraints[i]; - this.ikConstraints.push(new IkConstraint(ikConstraintData, this)); - } - this.transformConstraints = new Array(); - for (let i = 0; i < data.transformConstraints.length; i++) { - let transformConstraintData = data.transformConstraints[i]; - this.transformConstraints.push(new TransformConstraint(transformConstraintData, this)); - } - this.pathConstraints = new Array(); - for (let i = 0; i < data.pathConstraints.length; i++) { - let pathConstraintData = data.pathConstraints[i]; - this.pathConstraints.push(new PathConstraint(pathConstraintData, this)); - } - this.physicsConstraints = new Array(); - for (let i = 0; i < data.physicsConstraints.length; i++) { - let physicsConstraintData = data.physicsConstraints[i]; - this.physicsConstraints.push(new PhysicsConstraint(physicsConstraintData, this)); - } - this.color = new Color(1, 1, 1, 1); - this.updateCache(); - } - /** Caches information about bones and constraints. Must be called if the {@link #getSkin()} is modified or if bones, - * constraints, or weighted path attachments are added or removed. */ - updateCache() { - let updateCache = this._updateCache; - updateCache.length = 0; - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - bone.sorted = bone.data.skinRequired; - bone.active = !bone.sorted; - } - if (this.skin) { - let skinBones = this.skin.bones; - for (let i = 0, n = this.skin.bones.length; i < n; i++) { - let bone = this.bones[skinBones[i].index]; - do { - bone.sorted = false; - bone.active = true; - bone = bone.parent; - } while (bone); - } - } - let ikConstraints = this.ikConstraints; - let transformConstraints = this.transformConstraints; - let pathConstraints = this.pathConstraints; - let physicsConstraints = this.physicsConstraints; - let ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length, physicsCount = this.physicsConstraints.length; - let constraintCount = ikCount + transformCount + pathCount + physicsCount; - outer: - for (let i = 0; i < constraintCount; i++) { - for (let ii = 0; ii < ikCount; ii++) { - let constraint = ikConstraints[ii]; - if (constraint.data.order == i) { - this.sortIkConstraint(constraint); - continue outer; - } - } - for (let ii = 0; ii < transformCount; ii++) { - let constraint = transformConstraints[ii]; - if (constraint.data.order == i) { - this.sortTransformConstraint(constraint); - continue outer; - } - } - for (let ii = 0; ii < pathCount; ii++) { - let constraint = pathConstraints[ii]; - if (constraint.data.order == i) { - this.sortPathConstraint(constraint); - continue outer; - } - } - for (let ii = 0; ii < physicsCount; ii++) { - const constraint = physicsConstraints[ii]; - if (constraint.data.order == i) { - this.sortPhysicsConstraint(constraint); - continue outer; - } - } - } - for (let i = 0, n = bones.length; i < n; i++) - this.sortBone(bones[i]); - } - sortIkConstraint(constraint) { - constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || this.skin && Utils.contains(this.skin.constraints, constraint.data, true)); - if (!constraint.active) - return; - let target = constraint.target; - this.sortBone(target); - let constrained = constraint.bones; - let parent = constrained[0]; - this.sortBone(parent); - if (constrained.length == 1) { - this._updateCache.push(constraint); - this.sortReset(parent.children); - } else { - let child = constrained[constrained.length - 1]; - this.sortBone(child); - this._updateCache.push(constraint); - this.sortReset(parent.children); - child.sorted = true; - } - } - sortPathConstraint(constraint) { - constraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || this.skin && Utils.contains(this.skin.constraints, constraint.data, true)); - if (!constraint.active) - return; - let slot = constraint.target; - let slotIndex = slot.data.index; - let slotBone = slot.bone; - if (this.skin) - this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone); - if (this.data.defaultSkin && this.data.defaultSkin != this.skin) - this.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone); - for (let i = 0, n = this.data.skins.length; i < n; i++) - this.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone); - let attachment = slot.getAttachment(); - if (attachment instanceof PathAttachment) - this.sortPathConstraintAttachmentWith(attachment, slotBone); - let constrained = constraint.bones; - let boneCount = constrained.length; - for (let i = 0; i < boneCount; i++) - this.sortBone(constrained[i]); - this._updateCache.push(constraint); - for (let i = 0; i < boneCount; i++) - this.sortReset(constrained[i].children); - for (let i = 0; i < boneCount; i++) - constrained[i].sorted = true; - } - sortTransformConstraint(constraint) { - constraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || this.skin && Utils.contains(this.skin.constraints, constraint.data, true)); - if (!constraint.active) - return; - this.sortBone(constraint.target); - let constrained = constraint.bones; - let boneCount = constrained.length; - if (constraint.data.local) { - for (let i = 0; i < boneCount; i++) { - let child = constrained[i]; - this.sortBone(child.parent); - this.sortBone(child); - } - } else { - for (let i = 0; i < boneCount; i++) { - this.sortBone(constrained[i]); - } - } - this._updateCache.push(constraint); - for (let i = 0; i < boneCount; i++) - this.sortReset(constrained[i].children); - for (let i = 0; i < boneCount; i++) - constrained[i].sorted = true; - } - sortPathConstraintAttachment(skin, slotIndex, slotBone) { - let attachments = skin.attachments[slotIndex]; - if (!attachments) - return; - for (let key in attachments) { - this.sortPathConstraintAttachmentWith(attachments[key], slotBone); - } - } - sortPathConstraintAttachmentWith(attachment, slotBone) { - if (!(attachment instanceof PathAttachment)) - return; - let pathBones = attachment.bones; - if (!pathBones) - this.sortBone(slotBone); - else { - let bones = this.bones; - for (let i = 0, n = pathBones.length; i < n; ) { - let nn = pathBones[i++]; - nn += i; - while (i < nn) - this.sortBone(bones[pathBones[i++]]); - } - } - } - sortPhysicsConstraint(constraint) { - const bone = constraint.bone; - constraint.active = bone.active && (!constraint.data.skinRequired || this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)); - if (!constraint.active) - return; - this.sortBone(bone); - this._updateCache.push(constraint); - this.sortReset(bone.children); - bone.sorted = true; - } - sortBone(bone) { - if (!bone) - return; - if (bone.sorted) - return; - let parent = bone.parent; - if (parent) - this.sortBone(parent); - bone.sorted = true; - this._updateCache.push(bone); - } - sortReset(bones) { - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (!bone.active) - continue; - if (bone.sorted) - this.sortReset(bone.children); - bone.sorted = false; - } - } - /** Updates the world transform for each bone and applies all constraints. - * - * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine - * Runtimes Guide. */ - updateWorldTransform(physics) { - if (physics === void 0 || physics === null) - throw new Error("physics is undefined"); - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - bone.ax = bone.x; - bone.ay = bone.y; - bone.arotation = bone.rotation; - bone.ascaleX = bone.scaleX; - bone.ascaleY = bone.scaleY; - bone.ashearX = bone.shearX; - bone.ashearY = bone.shearY; - } - let updateCache = this._updateCache; - for (let i = 0, n = updateCache.length; i < n; i++) - updateCache[i].update(physics); - } - updateWorldTransformWith(physics, parent) { - if (!parent) - throw new Error("parent cannot be null."); - let bones = this.bones; - for (let i = 1, n = bones.length; i < n; i++) { - let bone = bones[i]; - bone.ax = bone.x; - bone.ay = bone.y; - bone.arotation = bone.rotation; - bone.ascaleX = bone.scaleX; - bone.ascaleY = bone.scaleY; - bone.ashearX = bone.shearX; - bone.ashearY = bone.shearY; - } - let rootBone = this.getRootBone(); - if (!rootBone) - throw new Error("Root bone must not be null."); - let pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d; - rootBone.worldX = pa * this.x + pb * this.y + parent.worldX; - rootBone.worldY = pc * this.x + pd * this.y + parent.worldY; - const rx = (rootBone.rotation + rootBone.shearX) * MathUtils.degRad; - const ry = (rootBone.rotation + 90 + rootBone.shearY) * MathUtils.degRad; - const la = Math.cos(rx) * rootBone.scaleX; - const lb = Math.cos(ry) * rootBone.scaleY; - const lc = Math.sin(rx) * rootBone.scaleX; - const ld = Math.sin(ry) * rootBone.scaleY; - rootBone.a = (pa * la + pb * lc) * this.scaleX; - rootBone.b = (pa * lb + pb * ld) * this.scaleX; - rootBone.c = (pc * la + pd * lc) * this.scaleY; - rootBone.d = (pc * lb + pd * ld) * this.scaleY; - let updateCache = this._updateCache; - for (let i = 0, n = updateCache.length; i < n; i++) { - let updatable = updateCache[i]; - if (updatable != rootBone) - updatable.update(physics); - } - } - /** Sets the bones, constraints, and slots to their setup pose values. */ - setToSetupPose() { - this.setBonesToSetupPose(); - this.setSlotsToSetupPose(); - } - /** Sets the bones and constraints to their setup pose values. */ - setBonesToSetupPose() { - for (const bone of this.bones) - bone.setToSetupPose(); - for (const constraint of this.ikConstraints) - constraint.setToSetupPose(); - for (const constraint of this.transformConstraints) - constraint.setToSetupPose(); - for (const constraint of this.pathConstraints) - constraint.setToSetupPose(); - for (const constraint of this.physicsConstraints) - constraint.setToSetupPose(); - } - /** Sets the slots and draw order to their setup pose values. */ - setSlotsToSetupPose() { - let slots = this.slots; - Utils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length); - for (let i = 0, n = slots.length; i < n; i++) - slots[i].setToSetupPose(); - } - /** @returns May return null. */ - getRootBone() { - if (this.bones.length == 0) - return null; - return this.bones[0]; - } - /** @returns May be null. */ - findBone(boneName) { - if (!boneName) - throw new Error("boneName cannot be null."); - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (bone.data.name == boneName) - return bone; - } - return null; - } - /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it - * repeatedly. - * @returns May be null. */ - findSlot(slotName) { - if (!slotName) - throw new Error("slotName cannot be null."); - let slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (slot.data.name == slotName) - return slot; - } - return null; - } - /** Sets a skin by name. - * - * See {@link #setSkin()}. */ - setSkinByName(skinName) { - let skin = this.data.findSkin(skinName); - if (!skin) - throw new Error("Skin not found: " + skinName); - this.setSkin(skin); - } - /** Sets the skin used to look up attachments before looking in the {@link SkeletonData#defaultSkin default skin}. If the - * skin is changed, {@link #updateCache()} is called. - * - * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no - * old skin, each slot's setup mode attachment is attached from the new skin. - * - * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling - * {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply()} is called before the next time the - * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin. - * @param newSkin May be null. */ - setSkin(newSkin) { - if (newSkin == this.skin) - return; - if (newSkin) { - if (this.skin) - newSkin.attachAll(this, this.skin); - else { - let slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - let name = slot.data.attachmentName; - if (name) { - let attachment = newSkin.getAttachment(i, name); - if (attachment) - slot.setAttachment(attachment); - } - } - } - } - this.skin = newSkin; - this.updateCache(); - } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment - * name. - * - * See {@link #getAttachment()}. - * @returns May be null. */ - getAttachmentByName(slotName, attachmentName) { - let slot = this.data.findSlot(slotName); - if (!slot) - throw new Error(`Can't find slot with name ${slotName}`); - return this.getAttachment(slot.index, attachmentName); - } - /** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and - * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked. - * - * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. - * @returns May be null. */ - getAttachment(slotIndex, attachmentName) { - if (!attachmentName) - throw new Error("attachmentName cannot be null."); - if (this.skin) { - let attachment = this.skin.getAttachment(slotIndex, attachmentName); - if (attachment) - return attachment; - } - if (this.data.defaultSkin) - return this.data.defaultSkin.getAttachment(slotIndex, attachmentName); - return null; - } - /** A convenience method to set an attachment by finding the slot with {@link #findSlot()}, finding the attachment with - * {@link #getAttachment()}, then setting the slot's {@link Slot#attachment}. - * @param attachmentName May be null to clear the slot's attachment. */ - setAttachment(slotName, attachmentName) { - if (!slotName) - throw new Error("slotName cannot be null."); - let slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (slot.data.name == slotName) { - let attachment = null; - if (attachmentName) { - attachment = this.getAttachment(i, attachmentName); - if (!attachment) - throw new Error("Attachment not found: " + attachmentName + ", for slot: " + slotName); - } - slot.setAttachment(attachment); - return; - } - } - throw new Error("Slot not found: " + slotName); - } - /** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method - * than to call it repeatedly. - * @return May be null. */ - findIkConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - return this.ikConstraints.find((constraint) => constraint.data.name == constraintName) ?? null; - } - /** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of - * this method than to call it repeatedly. - * @return May be null. */ - findTransformConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - return this.transformConstraints.find((constraint) => constraint.data.name == constraintName) ?? null; - } - /** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method - * than to call it repeatedly. - * @return May be null. */ - findPathConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - return this.pathConstraints.find((constraint) => constraint.data.name == constraintName) ?? null; - } - /** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this - * method than to call it repeatedly. */ - findPhysicsConstraint(constraintName) { - if (constraintName == null) - throw new Error("constraintName cannot be null."); - return this.physicsConstraints.find((constraint) => constraint.data.name == constraintName) ?? null; - } - /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`. - * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */ - getBoundsRect(clipper) { - let offset = new Vector2(); - let size = new Vector2(); - this.getBounds(offset, size, void 0, clipper); - return { x: offset.x, y: offset.y, width: size.x, height: size.y }; - } - /** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose. - * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB. - * @param size An output value, the width and height of the AABB. - * @param temp Working memory to temporarily store attachments' computed world vertices. - * @param clipper {@link SkeletonClipping} to use. If null, no clipping is applied. */ - getBounds(offset, size, temp = new Array(2), clipper = null) { - if (!offset) - throw new Error("offset cannot be null."); - if (!size) - throw new Error("size cannot be null."); - let drawOrder = this.drawOrder; - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - for (let i = 0, n = drawOrder.length; i < n; i++) { - let slot = drawOrder[i]; - if (!slot.bone.active) - continue; - let verticesLength = 0; - let vertices = null; - let triangles = null; - let attachment = slot.getAttachment(); - if (attachment instanceof RegionAttachment) { - verticesLength = 8; - vertices = Utils.setArraySize(temp, verticesLength, 0); - attachment.computeWorldVertices(slot, vertices, 0, 2); - triangles = _Skeleton.quadTriangles; - } else if (attachment instanceof MeshAttachment) { - let mesh = attachment; - verticesLength = mesh.worldVerticesLength; - vertices = Utils.setArraySize(temp, verticesLength, 0); - mesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2); - triangles = mesh.triangles; - } else if (attachment instanceof ClippingAttachment && clipper != null) { - clipper.clipStart(slot, attachment); - continue; - } - if (vertices && triangles) { - if (clipper != null && clipper.isClipping()) { - clipper.clipTriangles(vertices, triangles, triangles.length); - vertices = clipper.clippedVertices; - verticesLength = clipper.clippedVertices.length; - } - for (let ii = 0, nn = vertices.length; ii < nn; ii += 2) { - let x = vertices[ii], y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - if (clipper != null) - clipper.clipEndWithSlot(slot); - } - if (clipper != null) - clipper.clipEnd(); - offset.set(minX, minY); - size.set(maxX - minX, maxY - minY); - } - /** Increments the skeleton's {@link #time}. */ - update(delta) { - this.time += delta; - } - physicsTranslate(x, y) { - const physicsConstraints = this.physicsConstraints; - for (let i = 0, n = physicsConstraints.length; i < n; i++) - physicsConstraints[i].translate(x, y); - } - /** Calls {@link PhysicsConstraint#rotate(float, float, float)} for each physics constraint. */ - physicsRotate(x, y, degrees) { - const physicsConstraints = this.physicsConstraints; - for (let i = 0, n = physicsConstraints.length; i < n; i++) - physicsConstraints[i].rotate(x, y, degrees); - } - }; - var Skeleton = _Skeleton; - __publicField(Skeleton, "quadTriangles", [0, 1, 2, 2, 3, 0]); - __publicField(Skeleton, "yDown", false); - var Physics = /* @__PURE__ */ ((Physics2) => { - Physics2[Physics2["none"] = 0] = "none"; - Physics2[Physics2["reset"] = 1] = "reset"; - Physics2[Physics2["update"] = 2] = "update"; - Physics2[Physics2["pose"] = 3] = "pose"; - return Physics2; - })(Physics || {}); - - // spine-core/src/PhysicsConstraintData.ts - var PhysicsConstraintData = class extends ConstraintData { - _bone = null; - /** The bone constrained by this physics constraint. */ - set bone(boneData) { - this._bone = boneData; - } - get bone() { - if (!this._bone) - throw new Error("BoneData not set."); - else - return this._bone; - } - x = 0; - y = 0; - rotate = 0; - scaleX = 0; - shearX = 0; - limit = 0; - step = 0; - inertia = 0; - strength = 0; - damping = 0; - massInverse = 0; - wind = 0; - gravity = 0; - /** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */ - mix = 0; - inertiaGlobal = false; - strengthGlobal = false; - dampingGlobal = false; - massGlobal = false; - windGlobal = false; - gravityGlobal = false; - mixGlobal = false; - constructor(name) { - super(name, 0, false); - } - }; - - // spine-core/src/SkeletonData.ts - var SkeletonData = class { - /** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */ - name = null; - /** The skeleton's bones, sorted parent first. The root bone is always the first bone. */ - bones = new Array(); - // Ordered parents first. - /** The skeleton's slots in the setup pose draw order. */ - slots = new Array(); - // Setup pose draw order. - skins = new Array(); - /** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine. - * - * See {@link Skeleton#getAttachmentByName()}. - * May be null. */ - defaultSkin = null; - /** The skeleton's events. */ - events = new Array(); - /** The skeleton's animations. */ - animations = new Array(); - /** The skeleton's IK constraints. */ - ikConstraints = new Array(); - /** The skeleton's transform constraints. */ - transformConstraints = new Array(); - /** The skeleton's path constraints. */ - pathConstraints = new Array(); - /** The skeleton's physics constraints. */ - physicsConstraints = new Array(); - /** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */ - x = 0; - /** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */ - y = 0; - /** The width of the skeleton's axis aligned bounding box in the setup pose. */ - width = 0; - /** The height of the skeleton's axis aligned bounding box in the setup pose. */ - height = 0; - /** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default - * is 100. */ - referenceScale = 100; - /** The Spine version used to export the skeleton data, or null. */ - version = null; - /** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */ - hash = null; - // Nonessential - /** The dopesheet FPS in Spine. Available only when nonessential data was exported. */ - fps = 0; - /** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */ - imagesPath = null; - /** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */ - audioPath = null; - /** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it - * multiple times. - * @returns May be null. */ - findBone(boneName) { - if (!boneName) - throw new Error("boneName cannot be null."); - let bones = this.bones; - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (bone.name == boneName) - return bone; - } - return null; - } - /** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it - * multiple times. - * @returns May be null. */ - findSlot(slotName) { - if (!slotName) - throw new Error("slotName cannot be null."); - let slots = this.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (slot.name == slotName) - return slot; - } - return null; - } - /** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it - * multiple times. - * @returns May be null. */ - findSkin(skinName) { - if (!skinName) - throw new Error("skinName cannot be null."); - let skins = this.skins; - for (let i = 0, n = skins.length; i < n; i++) { - let skin = skins[i]; - if (skin.name == skinName) - return skin; - } - return null; - } - /** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it - * multiple times. - * @returns May be null. */ - findEvent(eventDataName) { - if (!eventDataName) - throw new Error("eventDataName cannot be null."); - let events = this.events; - for (let i = 0, n = events.length; i < n; i++) { - let event = events[i]; - if (event.name == eventDataName) - return event; - } - return null; - } - /** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to - * call it multiple times. - * @returns May be null. */ - findAnimation(animationName) { - if (!animationName) - throw new Error("animationName cannot be null."); - let animations = this.animations; - for (let i = 0, n = animations.length; i < n; i++) { - let animation = animations[i]; - if (animation.name == animationName) - return animation; - } - return null; - } - /** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method - * than to call it multiple times. - * @return May be null. */ - findIkConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - const ikConstraints = this.ikConstraints; - for (let i = 0, n = ikConstraints.length; i < n; i++) { - const constraint = ikConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - } - /** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of - * this method than to call it multiple times. - * @return May be null. */ - findTransformConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - const transformConstraints = this.transformConstraints; - for (let i = 0, n = transformConstraints.length; i < n; i++) { - const constraint = transformConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - } - /** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method - * than to call it multiple times. - * @return May be null. */ - findPathConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - const pathConstraints = this.pathConstraints; - for (let i = 0, n = pathConstraints.length; i < n; i++) { - const constraint = pathConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - } - /** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this method - * than to call it multiple times. - * @return May be null. */ - findPhysicsConstraint(constraintName) { - if (!constraintName) - throw new Error("constraintName cannot be null."); - const physicsConstraints = this.physicsConstraints; - for (let i = 0, n = physicsConstraints.length; i < n; i++) { - const constraint = physicsConstraints[i]; - if (constraint.name == constraintName) - return constraint; - } - return null; - } - }; - - // spine-core/src/Skin.ts - var SkinEntry = class { - constructor(slotIndex = 0, name, attachment) { - this.slotIndex = slotIndex; - this.name = name; - this.attachment = attachment; - } - }; - var Skin = class { - /** The skin's name, which is unique across all skins in the skeleton. */ - name; - attachments = new Array(); - bones = Array(); - constraints = new Array(); - /** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */ - color = new Color(0.99607843, 0.61960787, 0.30980393, 1); - // fe9e4fff - constructor(name) { - if (!name) - throw new Error("name cannot be null."); - this.name = name; - } - /** Adds an attachment to the skin for the specified slot index and name. */ - setAttachment(slotIndex, name, attachment) { - if (!attachment) - throw new Error("attachment cannot be null."); - let attachments = this.attachments; - if (slotIndex >= attachments.length) - attachments.length = slotIndex + 1; - if (!attachments[slotIndex]) - attachments[slotIndex] = {}; - attachments[slotIndex][name] = attachment; - } - /** Adds all attachments, bones, and constraints from the specified skin to this skin. */ - addSkin(skin) { - for (let i = 0; i < skin.bones.length; i++) { - let bone = skin.bones[i]; - let contained = false; - for (let ii = 0; ii < this.bones.length; ii++) { - if (this.bones[ii] == bone) { - contained = true; - break; - } - } - if (!contained) - this.bones.push(bone); - } - for (let i = 0; i < skin.constraints.length; i++) { - let constraint = skin.constraints[i]; - let contained = false; - for (let ii = 0; ii < this.constraints.length; ii++) { - if (this.constraints[ii] == constraint) { - contained = true; - break; - } - } - if (!contained) - this.constraints.push(constraint); - } - let attachments = skin.getAttachments(); - for (let i = 0; i < attachments.length; i++) { - var attachment = attachments[i]; - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } - } - /** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not - * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */ - copySkin(skin) { - for (let i = 0; i < skin.bones.length; i++) { - let bone = skin.bones[i]; - let contained = false; - for (let ii = 0; ii < this.bones.length; ii++) { - if (this.bones[ii] == bone) { - contained = true; - break; - } - } - if (!contained) - this.bones.push(bone); - } - for (let i = 0; i < skin.constraints.length; i++) { - let constraint = skin.constraints[i]; - let contained = false; - for (let ii = 0; ii < this.constraints.length; ii++) { - if (this.constraints[ii] == constraint) { - contained = true; - break; - } - } - if (!contained) - this.constraints.push(constraint); - } - let attachments = skin.getAttachments(); - for (let i = 0; i < attachments.length; i++) { - var attachment = attachments[i]; - if (!attachment.attachment) - continue; - if (attachment.attachment instanceof MeshAttachment) { - attachment.attachment = attachment.attachment.newLinkedMesh(); - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } else { - attachment.attachment = attachment.attachment.copy(); - this.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment); - } - } - } - /** Returns the attachment for the specified slot index and name, or null. */ - getAttachment(slotIndex, name) { - let dictionary = this.attachments[slotIndex]; - return dictionary ? dictionary[name] : null; - } - /** Removes the attachment in the skin for the specified slot index and name, if any. */ - removeAttachment(slotIndex, name) { - let dictionary = this.attachments[slotIndex]; - if (dictionary) - delete dictionary[name]; - } - /** Returns all attachments in this skin. */ - getAttachments() { - let entries = new Array(); - for (var i = 0; i < this.attachments.length; i++) { - let slotAttachments = this.attachments[i]; - if (slotAttachments) { - for (let name in slotAttachments) { - let attachment = slotAttachments[name]; - if (attachment) - entries.push(new SkinEntry(i, name, attachment)); - } - } - } - return entries; - } - /** Returns all attachments in this skin for the specified slot index. */ - getAttachmentsForSlot(slotIndex, attachments) { - let slotAttachments = this.attachments[slotIndex]; - if (slotAttachments) { - for (let name in slotAttachments) { - let attachment = slotAttachments[name]; - if (attachment) - attachments.push(new SkinEntry(slotIndex, name, attachment)); - } - } - } - /** Clears all attachments, bones, and constraints. */ - clear() { - this.attachments.length = 0; - this.bones.length = 0; - this.constraints.length = 0; - } - /** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */ - attachAll(skeleton, oldSkin) { - let slotIndex = 0; - for (let i = 0; i < skeleton.slots.length; i++) { - let slot = skeleton.slots[i]; - let slotAttachment = slot.getAttachment(); - if (slotAttachment && slotIndex < oldSkin.attachments.length) { - let dictionary = oldSkin.attachments[slotIndex]; - for (let key in dictionary) { - let skinAttachment = dictionary[key]; - if (slotAttachment == skinAttachment) { - let attachment = this.getAttachment(slotIndex, key); - if (attachment) - slot.setAttachment(attachment); - break; - } - } - } - slotIndex++; - } - } - }; - - // spine-core/src/SlotData.ts - var SlotData = class { - /** The index of the slot in {@link Skeleton#getSlots()}. */ - index = 0; - /** The name of the slot, which is unique across all slots in the skeleton. */ - name; - /** The bone this slot belongs to. */ - boneData; - /** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two - * color tinting. */ - color = new Color(1, 1, 1, 1); - /** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark - * color's alpha is not used. */ - darkColor = null; - /** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */ - attachmentName = null; - /** The blend mode for drawing the slot's attachment. */ - blendMode = BlendMode.Normal; - /** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */ - visible = true; - constructor(index, name, boneData) { - if (index < 0) - throw new Error("index must be >= 0."); - if (!name) - throw new Error("name cannot be null."); - if (!boneData) - throw new Error("boneData cannot be null."); - this.index = index; - this.name = name; - this.boneData = boneData; - } - }; - var BlendMode = /* @__PURE__ */ ((BlendMode4) => { - BlendMode4[BlendMode4["Normal"] = 0] = "Normal"; - BlendMode4[BlendMode4["Additive"] = 1] = "Additive"; - BlendMode4[BlendMode4["Multiply"] = 2] = "Multiply"; - BlendMode4[BlendMode4["Screen"] = 3] = "Screen"; - return BlendMode4; - })(BlendMode || {}); - - // spine-core/src/TransformConstraintData.ts - var TransformConstraintData = class extends ConstraintData { - /** The bones that will be modified by this transform constraint. */ - bones = new Array(); - /** The target bone whose world transform will be copied to the constrained bones. */ - _target = null; - set target(boneData) { - this._target = boneData; - } - get target() { - if (!this._target) - throw new Error("BoneData not set."); - else - return this._target; - } - mixRotate = 0; - mixX = 0; - mixY = 0; - mixScaleX = 0; - mixScaleY = 0; - mixShearY = 0; - /** An offset added to the constrained bone rotation. */ - offsetRotation = 0; - /** An offset added to the constrained bone X translation. */ - offsetX = 0; - /** An offset added to the constrained bone Y translation. */ - offsetY = 0; - /** An offset added to the constrained bone scaleX. */ - offsetScaleX = 0; - /** An offset added to the constrained bone scaleY. */ - offsetScaleY = 0; - /** An offset added to the constrained bone shearY. */ - offsetShearY = 0; - relative = false; - local = false; - constructor(name) { - super(name, 0, false); - } - }; - - // spine-core/src/SkeletonBinary.ts - var SkeletonBinary = class { - /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at - * runtime than were used in Spine. - * - * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */ - scale = 1; - attachmentLoader; - linkedMeshes = new Array(); - constructor(attachmentLoader) { - this.attachmentLoader = attachmentLoader; - } - readSkeletonData(binary) { - let scale = this.scale; - let skeletonData = new SkeletonData(); - skeletonData.name = ""; - let input = new BinaryInput(binary); - let lowHash = input.readInt32(); - let highHash = input.readInt32(); - skeletonData.hash = highHash == 0 && lowHash == 0 ? null : highHash.toString(16) + lowHash.toString(16); - skeletonData.version = input.readString(); - skeletonData.x = input.readFloat(); - skeletonData.y = input.readFloat(); - skeletonData.width = input.readFloat(); - skeletonData.height = input.readFloat(); - skeletonData.referenceScale = input.readFloat() * scale; - let nonessential = input.readBoolean(); - if (nonessential) { - skeletonData.fps = input.readFloat(); - skeletonData.imagesPath = input.readString(); - skeletonData.audioPath = input.readString(); - } - let n = 0; - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let str = input.readString(); - if (!str) - throw new Error("String in string table must not be null."); - input.strings.push(str); - } - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let name = input.readString(); - if (!name) - throw new Error("Bone name must not be null."); - let parent = i == 0 ? null : skeletonData.bones[input.readInt(true)]; - let data = new BoneData(i, name, parent); - data.rotation = input.readFloat(); - data.x = input.readFloat() * scale; - data.y = input.readFloat() * scale; - data.scaleX = input.readFloat(); - data.scaleY = input.readFloat(); - data.shearX = input.readFloat(); - data.shearY = input.readFloat(); - data.length = input.readFloat() * scale; - data.inherit = input.readByte(); - data.skinRequired = input.readBoolean(); - if (nonessential) { - Color.rgba8888ToColor(data.color, input.readInt32()); - data.icon = input.readString() ?? void 0; - data.visible = input.readBoolean(); - } - skeletonData.bones.push(data); - } - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let slotName = input.readString(); - if (!slotName) - throw new Error("Slot name must not be null."); - let boneData = skeletonData.bones[input.readInt(true)]; - let data = new SlotData(i, slotName, boneData); - Color.rgba8888ToColor(data.color, input.readInt32()); - let darkColor = input.readInt32(); - if (darkColor != -1) - Color.rgb888ToColor(data.darkColor = new Color(), darkColor); - data.attachmentName = input.readStringRef(); - data.blendMode = input.readInt(true); - if (nonessential) - data.visible = input.readBoolean(); - skeletonData.slots.push(data); - } - n = input.readInt(true); - for (let i = 0, nn; i < n; i++) { - let name = input.readString(); - if (!name) - throw new Error("IK constraint data name must not be null."); - let data = new IkConstraintData(name); - data.order = input.readInt(true); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(skeletonData.bones[input.readInt(true)]); - data.target = skeletonData.bones[input.readInt(true)]; - let flags = input.readByte(); - data.skinRequired = (flags & 1) != 0; - data.bendDirection = (flags & 2) != 0 ? 1 : -1; - data.compress = (flags & 4) != 0; - data.stretch = (flags & 8) != 0; - data.uniform = (flags & 16) != 0; - if ((flags & 32) != 0) - data.mix = (flags & 64) != 0 ? input.readFloat() : 1; - if ((flags & 128) != 0) - data.softness = input.readFloat() * scale; - skeletonData.ikConstraints.push(data); - } - n = input.readInt(true); - for (let i = 0, nn; i < n; i++) { - let name = input.readString(); - if (!name) - throw new Error("Transform constraint data name must not be null."); - let data = new TransformConstraintData(name); - data.order = input.readInt(true); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(skeletonData.bones[input.readInt(true)]); - data.target = skeletonData.bones[input.readInt(true)]; - let flags = input.readByte(); - data.skinRequired = (flags & 1) != 0; - data.local = (flags & 2) != 0; - data.relative = (flags & 4) != 0; - if ((flags & 8) != 0) - data.offsetRotation = input.readFloat(); - if ((flags & 16) != 0) - data.offsetX = input.readFloat() * scale; - if ((flags & 32) != 0) - data.offsetY = input.readFloat() * scale; - if ((flags & 64) != 0) - data.offsetScaleX = input.readFloat(); - if ((flags & 128) != 0) - data.offsetScaleY = input.readFloat(); - flags = input.readByte(); - if ((flags & 1) != 0) - data.offsetShearY = input.readFloat(); - if ((flags & 2) != 0) - data.mixRotate = input.readFloat(); - if ((flags & 4) != 0) - data.mixX = input.readFloat(); - if ((flags & 8) != 0) - data.mixY = input.readFloat(); - if ((flags & 16) != 0) - data.mixScaleX = input.readFloat(); - if ((flags & 32) != 0) - data.mixScaleY = input.readFloat(); - if ((flags & 64) != 0) - data.mixShearY = input.readFloat(); - skeletonData.transformConstraints.push(data); - } - n = input.readInt(true); - for (let i = 0, nn; i < n; i++) { - let name = input.readString(); - if (!name) - throw new Error("Path constraint data name must not be null."); - let data = new PathConstraintData(name); - data.order = input.readInt(true); - data.skinRequired = input.readBoolean(); - nn = input.readInt(true); - for (let ii = 0; ii < nn; ii++) - data.bones.push(skeletonData.bones[input.readInt(true)]); - data.target = skeletonData.slots[input.readInt(true)]; - const flags = input.readByte(); - data.positionMode = flags & 1; - data.spacingMode = flags >> 1 & 3; - data.rotateMode = flags >> 3 & 3; - if ((flags & 128) != 0) - data.offsetRotation = input.readFloat(); - data.position = input.readFloat(); - if (data.positionMode == 0 /* Fixed */) - data.position *= scale; - data.spacing = input.readFloat(); - if (data.spacingMode == 0 /* Length */ || data.spacingMode == 1 /* Fixed */) - data.spacing *= scale; - data.mixRotate = input.readFloat(); - data.mixX = input.readFloat(); - data.mixY = input.readFloat(); - skeletonData.pathConstraints.push(data); - } - n = input.readInt(true); - for (let i = 0, nn; i < n; i++) { - const name = input.readString(); - if (!name) - throw new Error("Physics constraint data name must not be null."); - const data = new PhysicsConstraintData(name); - data.order = input.readInt(true); - data.bone = skeletonData.bones[input.readInt(true)]; - let flags = input.readByte(); - data.skinRequired = (flags & 1) != 0; - if ((flags & 2) != 0) - data.x = input.readFloat(); - if ((flags & 4) != 0) - data.y = input.readFloat(); - if ((flags & 8) != 0) - data.rotate = input.readFloat(); - if ((flags & 16) != 0) - data.scaleX = input.readFloat(); - if ((flags & 32) != 0) - data.shearX = input.readFloat(); - data.limit = ((flags & 64) != 0 ? input.readFloat() : 5e3) * scale; - data.step = 1 / input.readUnsignedByte(); - data.inertia = input.readFloat(); - data.strength = input.readFloat(); - data.damping = input.readFloat(); - data.massInverse = (flags & 128) != 0 ? input.readFloat() : 1; - data.wind = input.readFloat(); - data.gravity = input.readFloat(); - flags = input.readByte(); - if ((flags & 1) != 0) - data.inertiaGlobal = true; - if ((flags & 2) != 0) - data.strengthGlobal = true; - if ((flags & 4) != 0) - data.dampingGlobal = true; - if ((flags & 8) != 0) - data.massGlobal = true; - if ((flags & 16) != 0) - data.windGlobal = true; - if ((flags & 32) != 0) - data.gravityGlobal = true; - if ((flags & 64) != 0) - data.mixGlobal = true; - data.mix = (flags & 128) != 0 ? input.readFloat() : 1; - skeletonData.physicsConstraints.push(data); - } - let defaultSkin = this.readSkin(input, skeletonData, true, nonessential); - if (defaultSkin) { - skeletonData.defaultSkin = defaultSkin; - skeletonData.skins.push(defaultSkin); - } - { - let i = skeletonData.skins.length; - Utils.setArraySize(skeletonData.skins, n = i + input.readInt(true)); - for (; i < n; i++) { - let skin = this.readSkin(input, skeletonData, false, nonessential); - if (!skin) - throw new Error("readSkin() should not have returned null."); - skeletonData.skins[i] = skin; - } - } - n = this.linkedMeshes.length; - for (let i = 0; i < n; i++) { - let linkedMesh = this.linkedMeshes[i]; - const skin = skeletonData.skins[linkedMesh.skinIndex]; - if (!linkedMesh.parent) - throw new Error("Linked mesh parent must not be null"); - let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); - if (!parent) - throw new Error(`Parent mesh not found: ${linkedMesh.parent}`); - linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh; - linkedMesh.mesh.setParentMesh(parent); - if (linkedMesh.mesh.region != null) - linkedMesh.mesh.updateRegion(); - } - this.linkedMeshes.length = 0; - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let eventName = input.readString(); - if (!eventName) - throw new Error("Event data name must not be null"); - let data = new EventData(eventName); - data.intValue = input.readInt(false); - data.floatValue = input.readFloat(); - data.stringValue = input.readString(); - data.audioPath = input.readString(); - if (data.audioPath) { - data.volume = input.readFloat(); - data.balance = input.readFloat(); - } - skeletonData.events.push(data); - } - n = input.readInt(true); - for (let i = 0; i < n; i++) { - let animationName = input.readString(); - if (!animationName) - throw new Error("Animatio name must not be null."); - skeletonData.animations.push(this.readAnimation(input, animationName, skeletonData)); - } - return skeletonData; - } - readSkin(input, skeletonData, defaultSkin, nonessential) { - let skin = null; - let slotCount = 0; - if (defaultSkin) { - slotCount = input.readInt(true); - if (slotCount == 0) - return null; - skin = new Skin("default"); - } else { - let skinName = input.readString(); - if (!skinName) - throw new Error("Skin name must not be null."); - skin = new Skin(skinName); - if (nonessential) - Color.rgba8888ToColor(skin.color, input.readInt32()); - skin.bones.length = input.readInt(true); - for (let i = 0, n = skin.bones.length; i < n; i++) - skin.bones[i] = skeletonData.bones[input.readInt(true)]; - for (let i = 0, n = input.readInt(true); i < n; i++) - skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]); - for (let i = 0, n = input.readInt(true); i < n; i++) - skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]); - for (let i = 0, n = input.readInt(true); i < n; i++) - skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]); - for (let i = 0, n = input.readInt(true); i < n; i++) - skin.constraints.push(skeletonData.physicsConstraints[input.readInt(true)]); - slotCount = input.readInt(true); - } - for (let i = 0; i < slotCount; i++) { - let slotIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - let name = input.readStringRef(); - if (!name) - throw new Error("Attachment name must not be null"); - let attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name, nonessential); - if (attachment) - skin.setAttachment(slotIndex, name, attachment); - } - } - return skin; - } - readAttachment(input, skeletonData, skin, slotIndex, attachmentName, nonessential) { - let scale = this.scale; - let flags = input.readByte(); - const name = (flags & 8) != 0 ? input.readStringRef() : attachmentName; - if (!name) - throw new Error("Attachment name must not be null"); - switch (flags & 7) { - case AttachmentType.Region: { - let path = (flags & 16) != 0 ? input.readStringRef() : null; - const color = (flags & 32) != 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) != 0 ? this.readSequence(input) : null; - let rotation = (flags & 128) != 0 ? input.readFloat() : 0; - let x = input.readFloat(); - let y = input.readFloat(); - let scaleX = input.readFloat(); - let scaleY = input.readFloat(); - let width = input.readFloat(); - let height = input.readFloat(); - if (!path) - path = name; - let region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence); - if (!region) - return null; - region.path = path; - region.x = x * scale; - region.y = y * scale; - region.scaleX = scaleX; - region.scaleY = scaleY; - region.rotation = rotation; - region.width = width * scale; - region.height = height * scale; - Color.rgba8888ToColor(region.color, color); - region.sequence = sequence; - if (sequence == null) - region.updateRegion(); - return region; - } - case AttachmentType.BoundingBox: { - let vertices = this.readVertices(input, (flags & 16) != 0); - let color = nonessential ? input.readInt32() : 0; - let box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - if (!box) - return null; - box.worldVerticesLength = vertices.length; - box.vertices = vertices.vertices; - box.bones = vertices.bones; - if (nonessential) - Color.rgba8888ToColor(box.color, color); - return box; - } - case AttachmentType.Mesh: { - let path = (flags & 16) != 0 ? input.readStringRef() : name; - const color = (flags & 32) != 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) != 0 ? this.readSequence(input) : null; - const hullLength = input.readInt(true); - const vertices = this.readVertices(input, (flags & 128) != 0); - const uvs = this.readFloatArray(input, vertices.length, 1); - const triangles = this.readShortArray(input, (vertices.length - hullLength - 2) * 3); - let edges = []; - let width = 0, height = 0; - if (nonessential) { - edges = this.readShortArray(input, input.readInt(true)); - width = input.readFloat(); - height = input.readFloat(); - } - if (!path) - path = name; - let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) - return null; - mesh.path = path; - Color.rgba8888ToColor(mesh.color, color); - mesh.bones = vertices.bones; - mesh.vertices = vertices.vertices; - mesh.worldVerticesLength = vertices.length; - mesh.triangles = triangles; - mesh.regionUVs = uvs; - if (sequence == null) - mesh.updateRegion(); - mesh.hullLength = hullLength << 1; - mesh.sequence = sequence; - if (nonessential) { - mesh.edges = edges; - mesh.width = width * scale; - mesh.height = height * scale; - } - return mesh; - } - case AttachmentType.LinkedMesh: { - const path = (flags & 16) != 0 ? input.readStringRef() : name; - if (path == null) - throw new Error("Path of linked mesh must not be null"); - const color = (flags & 32) != 0 ? input.readInt32() : 4294967295; - const sequence = (flags & 64) != 0 ? this.readSequence(input) : null; - const inheritTimelines = (flags & 128) != 0; - const skinIndex = input.readInt(true); - const parent = input.readStringRef(); - let width = 0, height = 0; - if (nonessential) { - width = input.readFloat(); - height = input.readFloat(); - } - let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) - return null; - mesh.path = path; - Color.rgba8888ToColor(mesh.color, color); - mesh.sequence = sequence; - if (nonessential) { - mesh.width = width * scale; - mesh.height = height * scale; - } - this.linkedMeshes.push(new LinkedMesh(mesh, skinIndex, slotIndex, parent, inheritTimelines)); - return mesh; - } - case AttachmentType.Path: { - const closed2 = (flags & 16) != 0; - const constantSpeed = (flags & 32) != 0; - const vertices = this.readVertices(input, (flags & 64) != 0); - const lengths = Utils.newArray(vertices.length / 6, 0); - for (let i = 0, n = lengths.length; i < n; i++) - lengths[i] = input.readFloat() * scale; - const color = nonessential ? input.readInt32() : 0; - const path = this.attachmentLoader.newPathAttachment(skin, name); - if (!path) - return null; - path.closed = closed2; - path.constantSpeed = constantSpeed; - path.worldVerticesLength = vertices.length; - path.vertices = vertices.vertices; - path.bones = vertices.bones; - path.lengths = lengths; - if (nonessential) - Color.rgba8888ToColor(path.color, color); - return path; - } - case AttachmentType.Point: { - const rotation = input.readFloat(); - const x = input.readFloat(); - const y = input.readFloat(); - const color = nonessential ? input.readInt32() : 0; - const point = this.attachmentLoader.newPointAttachment(skin, name); - if (!point) - return null; - point.x = x * scale; - point.y = y * scale; - point.rotation = rotation; - if (nonessential) - Color.rgba8888ToColor(point.color, color); - return point; - } - case AttachmentType.Clipping: { - const endSlotIndex = input.readInt(true); - const vertices = this.readVertices(input, (flags & 16) != 0); - let color = nonessential ? input.readInt32() : 0; - let clip = this.attachmentLoader.newClippingAttachment(skin, name); - if (!clip) - return null; - clip.endSlot = skeletonData.slots[endSlotIndex]; - clip.worldVerticesLength = vertices.length; - clip.vertices = vertices.vertices; - clip.bones = vertices.bones; - if (nonessential) - Color.rgba8888ToColor(clip.color, color); - return clip; - } - } - return null; - } - readSequence(input) { - let sequence = new Sequence(input.readInt(true)); - sequence.start = input.readInt(true); - sequence.digits = input.readInt(true); - sequence.setupIndex = input.readInt(true); - return sequence; - } - readVertices(input, weighted) { - const scale = this.scale; - const vertexCount = input.readInt(true); - const vertices = new Vertices(); - vertices.length = vertexCount << 1; - if (!weighted) { - vertices.vertices = this.readFloatArray(input, vertices.length, scale); - return vertices; - } - let weights = new Array(); - let bonesArray = new Array(); - for (let i = 0; i < vertexCount; i++) { - let boneCount = input.readInt(true); - bonesArray.push(boneCount); - for (let ii = 0; ii < boneCount; ii++) { - bonesArray.push(input.readInt(true)); - weights.push(input.readFloat() * scale); - weights.push(input.readFloat() * scale); - weights.push(input.readFloat()); - } - } - vertices.vertices = Utils.toFloatArray(weights); - vertices.bones = bonesArray; - return vertices; - } - readFloatArray(input, n, scale) { - let array = new Array(n); - if (scale == 1) { - for (let i = 0; i < n; i++) - array[i] = input.readFloat(); - } else { - for (let i = 0; i < n; i++) - array[i] = input.readFloat() * scale; - } - return array; - } - readShortArray(input, n) { - let array = new Array(n); - for (let i = 0; i < n; i++) - array[i] = input.readInt(true); - return array; - } - readAnimation(input, name, skeletonData) { - input.readInt(true); - let timelines = new Array(); - let scale = this.scale; - for (let i = 0, n = input.readInt(true); i < n; i++) { - let slotIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - let timelineType = input.readByte(); - let frameCount = input.readInt(true); - let frameLast = frameCount - 1; - switch (timelineType) { - case SLOT_ATTACHMENT: { - let timeline = new AttachmentTimeline(frameCount, slotIndex); - for (let frame = 0; frame < frameCount; frame++) - timeline.setFrame(frame, input.readFloat(), input.readStringRef()); - timelines.push(timeline); - break; - } - case SLOT_RGBA: { - let bezierCount = input.readInt(true); - let timeline = new RGBATimeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let a = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, a); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - let a2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1); - } - time = time2; - r = r2; - g = g2; - b = b2; - a = a2; - } - timelines.push(timeline); - break; - } - case SLOT_RGB: { - let bezierCount = input.readInt(true); - let timeline = new RGBTimeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1); - } - time = time2; - r = r2; - g = g2; - b = b2; - } - timelines.push(timeline); - break; - } - case SLOT_RGBA2: { - let bezierCount = input.readInt(true); - let timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let a = input.readUnsignedByte() / 255; - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, a, r2, g2, b2); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let nr = input.readUnsignedByte() / 255; - let ng = input.readUnsignedByte() / 255; - let nb = input.readUnsignedByte() / 255; - let na = input.readUnsignedByte() / 255; - let nr2 = input.readUnsignedByte() / 255; - let ng2 = input.readUnsignedByte() / 255; - let nb2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1); - setBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1); - } - time = time2; - r = nr; - g = ng; - b = nb; - a = na; - r2 = nr2; - g2 = ng2; - b2 = nb2; - } - timelines.push(timeline); - break; - } - case SLOT_RGB2: { - let bezierCount = input.readInt(true); - let timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex); - let time = input.readFloat(); - let r = input.readUnsignedByte() / 255; - let g = input.readUnsignedByte() / 255; - let b = input.readUnsignedByte() / 255; - let r2 = input.readUnsignedByte() / 255; - let g2 = input.readUnsignedByte() / 255; - let b2 = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, r, g, b, r2, g2, b2); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let nr = input.readUnsignedByte() / 255; - let ng = input.readUnsignedByte() / 255; - let nb = input.readUnsignedByte() / 255; - let nr2 = input.readUnsignedByte() / 255; - let ng2 = input.readUnsignedByte() / 255; - let nb2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1); - } - time = time2; - r = nr; - g = ng; - b = nb; - r2 = nr2; - g2 = ng2; - b2 = nb2; - } - timelines.push(timeline); - break; - } - case SLOT_ALPHA: { - let timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex); - let time = input.readFloat(), a = input.readUnsignedByte() / 255; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, a); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - let a2 = input.readUnsignedByte() / 255; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1); - } - time = time2; - a = a2; - } - timelines.push(timeline); - } - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let boneIndex = input.readInt(true); - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - let type = input.readByte(), frameCount = input.readInt(true); - if (type == BONE_INHERIT) { - let timeline = new InheritTimeline(frameCount, boneIndex); - for (let frame = 0; frame < frameCount; frame++) { - timeline.setFrame(frame, input.readFloat(), input.readByte()); - } - timelines.push(timeline); - continue; - } - let bezierCount = input.readInt(true); - switch (type) { - case BONE_ROTATE: - timelines.push(readTimeline1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_TRANSLATE: - timelines.push(readTimeline2(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale)); - break; - case BONE_TRANSLATEX: - timelines.push(readTimeline1(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale)); - break; - case BONE_TRANSLATEY: - timelines.push(readTimeline1(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale)); - break; - case BONE_SCALE: - timelines.push(readTimeline2(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SCALEX: - timelines.push(readTimeline1(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SCALEY: - timelines.push(readTimeline1(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SHEAR: - timelines.push(readTimeline2(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SHEARX: - timelines.push(readTimeline1(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1)); - break; - case BONE_SHEARY: - timelines.push(readTimeline1(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1)); - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1; - let timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index); - let flags = input.readByte(); - let time = input.readFloat(), mix = (flags & 1) != 0 ? (flags & 2) != 0 ? input.readFloat() : 1 : 0; - let softness = (flags & 4) != 0 ? input.readFloat() * scale : 0; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mix, softness, (flags & 8) != 0 ? 1 : -1, (flags & 16) != 0, (flags & 32) != 0); - if (frame == frameLast) - break; - flags = input.readByte(); - const time2 = input.readFloat(), mix2 = (flags & 1) != 0 ? (flags & 2) != 0 ? input.readFloat() : 1 : 0; - const softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0; - if ((flags & 64) != 0) { - timeline.setStepped(frame); - } else if ((flags & 128) != 0) { - setBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale); - } - time = time2; - mix = mix2; - softness = softness2; - } - timelines.push(timeline); - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1; - let timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index); - let time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(), mixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat(); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY); - if (frame == frameLast) - break; - let time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(), mixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1); - setBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1); - setBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1); - setBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - mixScaleX = mixScaleX2; - mixScaleY = mixScaleY2; - mixShearY = mixShearY2; - } - timelines.push(timeline); - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let index = input.readInt(true); - let data = skeletonData.pathConstraints[index]; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true); - switch (type) { - case PATH_POSITION: - timelines.push(readTimeline1( - input, - new PathConstraintPositionTimeline(frameCount, bezierCount, index), - data.positionMode == 0 /* Fixed */ ? scale : 1 - )); - break; - case PATH_SPACING: - timelines.push(readTimeline1( - input, - new PathConstraintSpacingTimeline(frameCount, bezierCount, index), - data.spacingMode == 0 /* Length */ || data.spacingMode == 1 /* Fixed */ ? scale : 1 - )); - break; - case PATH_MIX: - let timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index); - let time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(); - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY); - if (frame == frameLast) - break; - let time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1); - setBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1); - setBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - } - timelines.push(timeline); - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - const index = input.readInt(true) - 1; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - const type = input.readByte(), frameCount = input.readInt(true); - if (type == PHYSICS_RESET) { - const timeline = new PhysicsConstraintResetTimeline(frameCount, index); - for (let frame = 0; frame < frameCount; frame++) - timeline.setFrame(frame, input.readFloat()); - timelines.push(timeline); - continue; - } - const bezierCount = input.readInt(true); - switch (type) { - case PHYSICS_INERTIA: - timelines.push(readTimeline1(input, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_STRENGTH: - timelines.push(readTimeline1(input, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_DAMPING: - timelines.push(readTimeline1(input, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_MASS: - timelines.push(readTimeline1(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_WIND: - timelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_GRAVITY: - timelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1)); - break; - case PHYSICS_MIX: - timelines.push(readTimeline1(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1)); - } - } - } - for (let i = 0, n = input.readInt(true); i < n; i++) { - let skin = skeletonData.skins[input.readInt(true)]; - for (let ii = 0, nn = input.readInt(true); ii < nn; ii++) { - let slotIndex = input.readInt(true); - for (let iii = 0, nnn = input.readInt(true); iii < nnn; iii++) { - let attachmentName = input.readStringRef(); - if (!attachmentName) - throw new Error("attachmentName must not be null."); - let attachment = skin.getAttachment(slotIndex, attachmentName); - let timelineType = input.readByte(); - let frameCount = input.readInt(true); - let frameLast = frameCount - 1; - switch (timelineType) { - case ATTACHMENT_DEFORM: { - let vertexAttachment = attachment; - let weighted = vertexAttachment.bones; - let vertices = vertexAttachment.vertices; - let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; - let bezierCount = input.readInt(true); - let timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment); - let time = input.readFloat(); - for (let frame = 0, bezier = 0; ; frame++) { - let deform; - let end = input.readInt(true); - if (end == 0) - deform = weighted ? Utils.newFloatArray(deformLength) : vertices; - else { - deform = Utils.newFloatArray(deformLength); - let start = input.readInt(true); - end += start; - if (scale == 1) { - for (let v = start; v < end; v++) - deform[v] = input.readFloat(); - } else { - for (let v = start; v < end; v++) - deform[v] = input.readFloat() * scale; - } - if (!weighted) { - for (let v = 0, vn = deform.length; v < vn; v++) - deform[v] += vertices[v]; - } - } - timeline.setFrame(frame, time, deform); - if (frame == frameLast) - break; - let time2 = input.readFloat(); - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1); - } - time = time2; - } - timelines.push(timeline); - break; - } - case ATTACHMENT_SEQUENCE: { - let timeline = new SequenceTimeline(frameCount, slotIndex, attachment); - for (let frame = 0; frame < frameCount; frame++) { - let time = input.readFloat(); - let modeAndIndex = input.readInt32(); - timeline.setFrame( - frame, - time, - SequenceModeValues[modeAndIndex & 15], - modeAndIndex >> 4, - input.readFloat() - ); - } - timelines.push(timeline); - break; - } - } - } - } - } - let drawOrderCount = input.readInt(true); - if (drawOrderCount > 0) { - let timeline = new DrawOrderTimeline(drawOrderCount); - let slotCount = skeletonData.slots.length; - for (let i = 0; i < drawOrderCount; i++) { - let time = input.readFloat(); - let offsetCount = input.readInt(true); - let drawOrder = Utils.newArray(slotCount, 0); - for (let ii = slotCount - 1; ii >= 0; ii--) - drawOrder[ii] = -1; - let unchanged = Utils.newArray(slotCount - offsetCount, 0); - let originalIndex = 0, unchangedIndex = 0; - for (let ii = 0; ii < offsetCount; ii++) { - let slotIndex = input.readInt(true); - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - drawOrder[originalIndex + input.readInt(true)] = originalIndex++; - } - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - for (let ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) - drawOrder[ii] = unchanged[--unchangedIndex]; - timeline.setFrame(i, time, drawOrder); - } - timelines.push(timeline); - } - let eventCount = input.readInt(true); - if (eventCount > 0) { - let timeline = new EventTimeline(eventCount); - for (let i = 0; i < eventCount; i++) { - let time = input.readFloat(); - let eventData = skeletonData.events[input.readInt(true)]; - let event = new Event(time, eventData); - event.intValue = input.readInt(false); - event.floatValue = input.readFloat(); - event.stringValue = input.readString(); - if (event.stringValue == null) - event.stringValue = eventData.stringValue; - if (event.data.audioPath) { - event.volume = input.readFloat(); - event.balance = input.readFloat(); - } - timeline.setFrame(i, event); - } - timelines.push(timeline); - } - let duration = 0; - for (let i = 0, n = timelines.length; i < n; i++) - duration = Math.max(duration, timelines[i].getDuration()); - return new Animation(name, timelines, duration); - } - }; - var BinaryInput = class { - constructor(data, strings = new Array(), index = 0, buffer = new DataView(data instanceof ArrayBuffer ? data : data.buffer)) { - this.strings = strings; - this.index = index; - this.buffer = buffer; - } - readByte() { - return this.buffer.getInt8(this.index++); - } - readUnsignedByte() { - return this.buffer.getUint8(this.index++); - } - readShort() { - let value = this.buffer.getInt16(this.index); - this.index += 2; - return value; - } - readInt32() { - let value = this.buffer.getInt32(this.index); - this.index += 4; - return value; - } - readInt(optimizePositive) { - let b = this.readByte(); - let result = b & 127; - if ((b & 128) != 0) { - b = this.readByte(); - result |= (b & 127) << 7; - if ((b & 128) != 0) { - b = this.readByte(); - result |= (b & 127) << 14; - if ((b & 128) != 0) { - b = this.readByte(); - result |= (b & 127) << 21; - if ((b & 128) != 0) { - b = this.readByte(); - result |= (b & 127) << 28; - } - } - } - } - return optimizePositive ? result : result >>> 1 ^ -(result & 1); - } - readStringRef() { - let index = this.readInt(true); - return index == 0 ? null : this.strings[index - 1]; - } - readString() { - let byteCount = this.readInt(true); - switch (byteCount) { - case 0: - return null; - case 1: - return ""; - } - byteCount--; - let chars = ""; - let charCount = 0; - for (let i = 0; i < byteCount; ) { - let b = this.readUnsignedByte(); - switch (b >> 4) { - case 12: - case 13: - chars += String.fromCharCode((b & 31) << 6 | this.readByte() & 63); - i += 2; - break; - case 14: - chars += String.fromCharCode((b & 15) << 12 | (this.readByte() & 63) << 6 | this.readByte() & 63); - i += 3; - break; - default: - chars += String.fromCharCode(b); - i++; - } - } - return chars; - } - readFloat() { - let value = this.buffer.getFloat32(this.index); - this.index += 4; - return value; - } - readBoolean() { - return this.readByte() != 0; - } - }; - var LinkedMesh = class { - parent; - skinIndex; - slotIndex; - mesh; - inheritTimeline; - constructor(mesh, skinIndex, slotIndex, parent, inheritDeform) { - this.mesh = mesh; - this.skinIndex = skinIndex; - this.slotIndex = slotIndex; - this.parent = parent; - this.inheritTimeline = inheritDeform; - } - }; - var Vertices = class { - constructor(bones = null, vertices = null, length = 0) { - this.bones = bones; - this.vertices = vertices; - this.length = length; - } - }; - var AttachmentType = /* @__PURE__ */ ((AttachmentType2) => { - AttachmentType2[AttachmentType2["Region"] = 0] = "Region"; - AttachmentType2[AttachmentType2["BoundingBox"] = 1] = "BoundingBox"; - AttachmentType2[AttachmentType2["Mesh"] = 2] = "Mesh"; - AttachmentType2[AttachmentType2["LinkedMesh"] = 3] = "LinkedMesh"; - AttachmentType2[AttachmentType2["Path"] = 4] = "Path"; - AttachmentType2[AttachmentType2["Point"] = 5] = "Point"; - AttachmentType2[AttachmentType2["Clipping"] = 6] = "Clipping"; - return AttachmentType2; - })(AttachmentType || {}); - function readTimeline1(input, timeline, scale) { - let time = input.readFloat(), value = input.readFloat() * scale; - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, value); - if (frame == frameLast) - break; - let time2 = input.readFloat(), value2 = input.readFloat() * scale; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale); - } - time = time2; - value = value2; - } - return timeline; - } - function readTimeline2(input, timeline, scale) { - let time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale; - for (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) { - timeline.setFrame(frame, time, value1, value2); - if (frame == frameLast) - break; - let time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale; - switch (input.readByte()) { - case CURVE_STEPPED: - timeline.setStepped(frame); - break; - case CURVE_BEZIER: - setBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale); - setBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale); - } - time = time2; - value1 = nvalue1; - value2 = nvalue2; - } - return timeline; - } - function setBezier(input, timeline, bezier, frame, value, time1, time2, value1, value2, scale) { - timeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2); - } - var BONE_ROTATE = 0; - var BONE_TRANSLATE = 1; - var BONE_TRANSLATEX = 2; - var BONE_TRANSLATEY = 3; - var BONE_SCALE = 4; - var BONE_SCALEX = 5; - var BONE_SCALEY = 6; - var BONE_SHEAR = 7; - var BONE_SHEARX = 8; - var BONE_SHEARY = 9; - var BONE_INHERIT = 10; - var SLOT_ATTACHMENT = 0; - var SLOT_RGBA = 1; - var SLOT_RGB = 2; - var SLOT_RGBA2 = 3; - var SLOT_RGB2 = 4; - var SLOT_ALPHA = 5; - var ATTACHMENT_DEFORM = 0; - var ATTACHMENT_SEQUENCE = 1; - var PATH_POSITION = 0; - var PATH_SPACING = 1; - var PATH_MIX = 2; - var PHYSICS_INERTIA = 0; - var PHYSICS_STRENGTH = 1; - var PHYSICS_DAMPING = 2; - var PHYSICS_MASS = 4; - var PHYSICS_WIND = 5; - var PHYSICS_GRAVITY = 6; - var PHYSICS_MIX = 7; - var PHYSICS_RESET = 8; - var CURVE_STEPPED = 1; - var CURVE_BEZIER = 2; - - // spine-core/src/SkeletonBounds.ts - var SkeletonBounds = class { - /** The left edge of the axis aligned bounding box. */ - minX = 0; - /** The bottom edge of the axis aligned bounding box. */ - minY = 0; - /** The right edge of the axis aligned bounding box. */ - maxX = 0; - /** The top edge of the axis aligned bounding box. */ - maxY = 0; - /** The visible bounding boxes. */ - boundingBoxes = new Array(); - /** The world vertices for the bounding box polygons. */ - polygons = new Array(); - polygonPool = new Pool(() => { - return Utils.newFloatArray(16); - }); - /** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding - * box's polygon. - * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the - * SkeletonBounds AABB methods will always return true. */ - update(skeleton, updateAabb) { - if (!skeleton) - throw new Error("skeleton cannot be null."); - let boundingBoxes = this.boundingBoxes; - let polygons = this.polygons; - let polygonPool = this.polygonPool; - let slots = skeleton.slots; - let slotCount = slots.length; - boundingBoxes.length = 0; - polygonPool.freeAll(polygons); - polygons.length = 0; - for (let i = 0; i < slotCount; i++) { - let slot = slots[i]; - if (!slot.bone.active) - continue; - let attachment = slot.getAttachment(); - if (attachment instanceof BoundingBoxAttachment) { - let boundingBox = attachment; - boundingBoxes.push(boundingBox); - let polygon = polygonPool.obtain(); - if (polygon.length != boundingBox.worldVerticesLength) { - polygon = Utils.newFloatArray(boundingBox.worldVerticesLength); - } - polygons.push(polygon); - boundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2); - } - } - if (updateAabb) { - this.aabbCompute(); - } else { - this.minX = Number.POSITIVE_INFINITY; - this.minY = Number.POSITIVE_INFINITY; - this.maxX = Number.NEGATIVE_INFINITY; - this.maxY = Number.NEGATIVE_INFINITY; - } - } - aabbCompute() { - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - let polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) { - let polygon = polygons[i]; - let vertices = polygon; - for (let ii = 0, nn = polygon.length; ii < nn; ii += 2) { - let x = vertices[ii]; - let y = vertices[ii + 1]; - minX = Math.min(minX, x); - minY = Math.min(minY, y); - maxX = Math.max(maxX, x); - maxY = Math.max(maxY, y); - } - } - this.minX = minX; - this.minY = minY; - this.maxX = maxX; - this.maxY = maxY; - } - /** Returns true if the axis aligned bounding box contains the point. */ - aabbContainsPoint(x, y) { - return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY; - } - /** Returns true if the axis aligned bounding box intersects the line segment. */ - aabbIntersectsSegment(x1, y1, x2, y2) { - let minX = this.minX; - let minY = this.minY; - let maxX = this.maxX; - let maxY = this.maxY; - if (x1 <= minX && x2 <= minX || y1 <= minY && y2 <= minY || x1 >= maxX && x2 >= maxX || y1 >= maxY && y2 >= maxY) - return false; - let m = (y2 - y1) / (x2 - x1); - let y = m * (minX - x1) + y1; - if (y > minY && y < maxY) - return true; - y = m * (maxX - x1) + y1; - if (y > minY && y < maxY) - return true; - let x = (minY - y1) / m + x1; - if (x > minX && x < maxX) - return true; - x = (maxY - y1) / m + x1; - if (x > minX && x < maxX) - return true; - return false; - } - /** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */ - aabbIntersectsSkeleton(bounds) { - return this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY; - } - /** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more - * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */ - containsPoint(x, y) { - let polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) - if (this.containsPointPolygon(polygons[i], x, y)) - return this.boundingBoxes[i]; - return null; - } - /** Returns true if the polygon contains the point. */ - containsPointPolygon(polygon, x, y) { - let vertices = polygon; - let nn = polygon.length; - let prevIndex = nn - 2; - let inside = false; - for (let ii = 0; ii < nn; ii += 2) { - let vertexY = vertices[ii + 1]; - let prevY = vertices[prevIndex + 1]; - if (vertexY < y && prevY >= y || prevY < y && vertexY >= y) { - let vertexX = vertices[ii]; - if (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) - inside = !inside; - } - prevIndex = ii; - } - return inside; - } - /** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it - * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns - * true. */ - intersectsSegment(x1, y1, x2, y2) { - let polygons = this.polygons; - for (let i = 0, n = polygons.length; i < n; i++) - if (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) - return this.boundingBoxes[i]; - return null; - } - /** Returns true if the polygon contains any part of the line segment. */ - intersectsSegmentPolygon(polygon, x1, y1, x2, y2) { - let vertices = polygon; - let nn = polygon.length; - let width12 = x1 - x2, height12 = y1 - y2; - let det1 = x1 * y2 - y1 * x2; - let x3 = vertices[nn - 2], y3 = vertices[nn - 1]; - for (let ii = 0; ii < nn; ii += 2) { - let x4 = vertices[ii], y4 = vertices[ii + 1]; - let det2 = x3 * y4 - y3 * x4; - let width34 = x3 - x4, height34 = y3 - y4; - let det3 = width12 * height34 - height12 * width34; - let x = (det1 * width34 - width12 * det2) / det3; - if ((x >= x3 && x <= x4 || x >= x4 && x <= x3) && (x >= x1 && x <= x2 || x >= x2 && x <= x1)) { - let y = (det1 * height34 - height12 * det2) / det3; - if ((y >= y3 && y <= y4 || y >= y4 && y <= y3) && (y >= y1 && y <= y2 || y >= y2 && y <= y1)) - return true; - } - x3 = x4; - y3 = y4; - } - return false; - } - /** Returns the polygon for the specified bounding box, or null. */ - getPolygon(boundingBox) { - if (!boundingBox) - throw new Error("boundingBox cannot be null."); - let index = this.boundingBoxes.indexOf(boundingBox); - return index == -1 ? null : this.polygons[index]; - } - /** The width of the axis aligned bounding box. */ - getWidth() { - return this.maxX - this.minX; - } - /** The height of the axis aligned bounding box. */ - getHeight() { - return this.maxY - this.minY; - } - }; - - // spine-core/src/Triangulator.ts - var Triangulator = class { - convexPolygons = new Array(); - convexPolygonsIndices = new Array(); - indicesArray = new Array(); - isConcaveArray = new Array(); - triangles = new Array(); - polygonPool = new Pool(() => { - return new Array(); - }); - polygonIndicesPool = new Pool(() => { - return new Array(); - }); - triangulate(verticesArray) { - let vertices = verticesArray; - let vertexCount = verticesArray.length >> 1; - let indices = this.indicesArray; - indices.length = 0; - for (let i = 0; i < vertexCount; i++) - indices[i] = i; - let isConcave = this.isConcaveArray; - isConcave.length = 0; - for (let i = 0, n = vertexCount; i < n; ++i) - isConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices); - let triangles = this.triangles; - triangles.length = 0; - while (vertexCount > 3) { - let previous = vertexCount - 1, i = 0, next = 1; - while (true) { - outer: - if (!isConcave[i]) { - let p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1; - let p1x = vertices[p1], p1y = vertices[p1 + 1]; - let p2x = vertices[p2], p2y = vertices[p2 + 1]; - let p3x = vertices[p3], p3y = vertices[p3 + 1]; - for (let ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) { - if (!isConcave[ii]) - continue; - let v = indices[ii] << 1; - let vx = vertices[v], vy = vertices[v + 1]; - if (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) { - if (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) { - if (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) - break outer; - } - } - } - break; - } - if (next == 0) { - do { - if (!isConcave[i]) - break; - i--; - } while (i > 0); - break; - } - previous = i; - i = next; - next = (next + 1) % vertexCount; - } - triangles.push(indices[(vertexCount + i - 1) % vertexCount]); - triangles.push(indices[i]); - triangles.push(indices[(i + 1) % vertexCount]); - indices.splice(i, 1); - isConcave.splice(i, 1); - vertexCount--; - let previousIndex = (vertexCount + i - 1) % vertexCount; - let nextIndex = i == vertexCount ? 0 : i; - isConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices); - isConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices); - } - if (vertexCount == 3) { - triangles.push(indices[2]); - triangles.push(indices[0]); - triangles.push(indices[1]); - } - return triangles; - } - decompose(verticesArray, triangles) { - let vertices = verticesArray; - let convexPolygons = this.convexPolygons; - this.polygonPool.freeAll(convexPolygons); - convexPolygons.length = 0; - let convexPolygonsIndices = this.convexPolygonsIndices; - this.polygonIndicesPool.freeAll(convexPolygonsIndices); - convexPolygonsIndices.length = 0; - let polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - let polygon = this.polygonPool.obtain(); - polygon.length = 0; - let fanBaseIndex = -1, lastWinding = 0; - for (let i = 0, n = triangles.length; i < n; i += 3) { - let t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1; - let x1 = vertices[t1], y1 = vertices[t1 + 1]; - let x2 = vertices[t2], y2 = vertices[t2 + 1]; - let x3 = vertices[t3], y3 = vertices[t3 + 1]; - let merged = false; - if (fanBaseIndex == t1) { - let o = polygon.length - 4; - let winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3); - let winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]); - if (winding1 == lastWinding && winding2 == lastWinding) { - polygon.push(x3); - polygon.push(y3); - polygonIndices.push(t3); - merged = true; - } - } - if (!merged) { - if (polygon.length > 0) { - convexPolygons.push(polygon); - convexPolygonsIndices.push(polygonIndices); - } else { - this.polygonPool.free(polygon); - this.polygonIndicesPool.free(polygonIndices); - } - polygon = this.polygonPool.obtain(); - polygon.length = 0; - polygon.push(x1); - polygon.push(y1); - polygon.push(x2); - polygon.push(y2); - polygon.push(x3); - polygon.push(y3); - polygonIndices = this.polygonIndicesPool.obtain(); - polygonIndices.length = 0; - polygonIndices.push(t1); - polygonIndices.push(t2); - polygonIndices.push(t3); - lastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3); - fanBaseIndex = t1; - } - } - if (polygon.length > 0) { - convexPolygons.push(polygon); - convexPolygonsIndices.push(polygonIndices); - } - for (let i = 0, n = convexPolygons.length; i < n; i++) { - polygonIndices = convexPolygonsIndices[i]; - if (polygonIndices.length == 0) - continue; - let firstIndex = polygonIndices[0]; - let lastIndex = polygonIndices[polygonIndices.length - 1]; - polygon = convexPolygons[i]; - let o = polygon.length - 4; - let prevPrevX = polygon[o], prevPrevY = polygon[o + 1]; - let prevX = polygon[o + 2], prevY = polygon[o + 3]; - let firstX = polygon[0], firstY = polygon[1]; - let secondX = polygon[2], secondY = polygon[3]; - let winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY); - for (let ii = 0; ii < n; ii++) { - if (ii == i) - continue; - let otherIndices = convexPolygonsIndices[ii]; - if (otherIndices.length != 3) - continue; - let otherFirstIndex = otherIndices[0]; - let otherSecondIndex = otherIndices[1]; - let otherLastIndex = otherIndices[2]; - let otherPoly = convexPolygons[ii]; - let x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1]; - if (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) - continue; - let winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3); - let winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY); - if (winding1 == winding && winding2 == winding) { - otherPoly.length = 0; - otherIndices.length = 0; - polygon.push(x3); - polygon.push(y3); - polygonIndices.push(otherLastIndex); - prevPrevX = prevX; - prevPrevY = prevY; - prevX = x3; - prevY = y3; - ii = 0; - } - } - } - for (let i = convexPolygons.length - 1; i >= 0; i--) { - polygon = convexPolygons[i]; - if (polygon.length == 0) { - convexPolygons.splice(i, 1); - this.polygonPool.free(polygon); - polygonIndices = convexPolygonsIndices[i]; - convexPolygonsIndices.splice(i, 1); - this.polygonIndicesPool.free(polygonIndices); - } - } - return convexPolygons; - } - static isConcave(index, vertexCount, vertices, indices) { - let previous = indices[(vertexCount + index - 1) % vertexCount] << 1; - let current = indices[index] << 1; - let next = indices[(index + 1) % vertexCount] << 1; - return !this.positiveArea( - vertices[previous], - vertices[previous + 1], - vertices[current], - vertices[current + 1], - vertices[next], - vertices[next + 1] - ); - } - static positiveArea(p1x, p1y, p2x, p2y, p3x, p3y) { - return p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0; - } - static winding(p1x, p1y, p2x, p2y, p3x, p3y) { - let px = p2x - p1x, py = p2y - p1y; - return p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1; - } - }; - - // spine-core/src/SkeletonClipping.ts - var SkeletonClipping = class { - triangulator = new Triangulator(); - clippingPolygon = new Array(); - clipOutput = new Array(); - clippedVertices = new Array(); - clippedUVs = new Array(); - clippedTriangles = new Array(); - scratch = new Array(); - clipAttachment = null; - clippingPolygons = null; - clipStart(slot, clip) { - if (this.clipAttachment) - return 0; - this.clipAttachment = clip; - let n = clip.worldVerticesLength; - let vertices = Utils.setArraySize(this.clippingPolygon, n); - clip.computeWorldVertices(slot, 0, n, vertices, 0, 2); - let clippingPolygon = this.clippingPolygon; - SkeletonClipping.makeClockwise(clippingPolygon); - let clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon)); - for (let i = 0, n2 = clippingPolygons.length; i < n2; i++) { - let polygon = clippingPolygons[i]; - SkeletonClipping.makeClockwise(polygon); - polygon.push(polygon[0]); - polygon.push(polygon[1]); - } - return clippingPolygons.length; - } - clipEndWithSlot(slot) { - if (this.clipAttachment && this.clipAttachment.endSlot == slot.data) - this.clipEnd(); - } - clipEnd() { - if (!this.clipAttachment) - return; - this.clipAttachment = null; - this.clippingPolygons = null; - this.clippedVertices.length = 0; - this.clippedTriangles.length = 0; - this.clippingPolygon.length = 0; - } - isClipping() { - return this.clipAttachment != null; - } - clipTriangles(vertices, verticesLengthOrTriangles, trianglesOrTrianglesLength, trianglesLengthOrUvs, uvsOrLight, lightOrDark, darkOrTwoColor, twoColorParam) { - let triangles; - let trianglesLength; - let uvs; - let light; - let dark; - let twoColor; - if (typeof verticesLengthOrTriangles === "number") { - triangles = trianglesOrTrianglesLength; - trianglesLength = trianglesLengthOrUvs; - uvs = uvsOrLight; - light = lightOrDark; - dark = darkOrTwoColor; - twoColor = twoColorParam; - } else { - triangles = verticesLengthOrTriangles; - trianglesLength = trianglesOrTrianglesLength; - uvs = trianglesLengthOrUvs; - light = uvsOrLight; - dark = lightOrDark; - twoColor = darkOrTwoColor; - } - if (uvs && light && dark && typeof twoColor === "boolean") - this.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor); - else - this.clipTrianglesNoRender(vertices, triangles, trianglesLength); - } - clipTrianglesNoRender(vertices, triangles, trianglesLength) { - let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; - let clippedTriangles = this.clippedTriangles; - let polygons = this.clippingPolygons; - let polygonsCount = polygons.length; - let index = 0; - clippedVertices.length = 0; - clippedTriangles.length = 0; - for (let i = 0; i < trianglesLength; i += 3) { - let vertexOffset = triangles[i] << 1; - let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - vertexOffset = triangles[i + 1] << 1; - let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - vertexOffset = triangles[i + 2] << 1; - let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - let clipOutputLength = clipOutput.length; - if (clipOutputLength == 0) - continue; - let clipOutputCount = clipOutputLength >> 1; - let clipOutputItems = this.clipOutput; - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2); - for (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) { - let x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - } - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = x2; - clippedVerticesItems[s + 3] = y2; - clippedVerticesItems[s + 4] = x3; - clippedVerticesItems[s + 5] = y3; - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + 1; - clippedTrianglesItems[s + 2] = index + 2; - index += 3; - break; - } - } - } - } - clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor) { - let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices; - let clippedTriangles = this.clippedTriangles; - let polygons = this.clippingPolygons; - let polygonsCount = polygons.length; - let vertexSize = twoColor ? 12 : 8; - let index = 0; - clippedVertices.length = 0; - clippedTriangles.length = 0; - for (let i = 0; i < trianglesLength; i += 3) { - let vertexOffset = triangles[i] << 1; - let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - let u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 1] << 1; - let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - let u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 2] << 1; - let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - let u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - let clipOutputLength = clipOutput.length; - if (clipOutputLength == 0) - continue; - let d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - let d = 1 / (d0 * d2 + d1 * (y1 - y3)); - let clipOutputCount = clipOutputLength >> 1; - let clipOutputItems = this.clipOutput; - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize); - for (let ii = 0; ii < clipOutputLength; ii += 2, s += vertexSize) { - let x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - clippedVerticesItems[s + 2] = light.r; - clippedVerticesItems[s + 3] = light.g; - clippedVerticesItems[s + 4] = light.b; - clippedVerticesItems[s + 5] = light.a; - let c0 = x - x3, c1 = y - y3; - let a = (d0 * c0 + d1 * c1) * d; - let b = (d4 * c0 + d2 * c1) * d; - let c = 1 - a - b; - clippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c; - clippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c; - if (twoColor) { - clippedVerticesItems[s + 8] = dark.r; - clippedVerticesItems[s + 9] = dark.g; - clippedVerticesItems[s + 10] = dark.b; - clippedVerticesItems[s + 11] = dark.a; - } - } - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = light.r; - clippedVerticesItems[s + 3] = light.g; - clippedVerticesItems[s + 4] = light.b; - clippedVerticesItems[s + 5] = light.a; - if (!twoColor) { - clippedVerticesItems[s + 6] = u1; - clippedVerticesItems[s + 7] = v1; - clippedVerticesItems[s + 8] = x2; - clippedVerticesItems[s + 9] = y2; - clippedVerticesItems[s + 10] = light.r; - clippedVerticesItems[s + 11] = light.g; - clippedVerticesItems[s + 12] = light.b; - clippedVerticesItems[s + 13] = light.a; - clippedVerticesItems[s + 14] = u2; - clippedVerticesItems[s + 15] = v2; - clippedVerticesItems[s + 16] = x3; - clippedVerticesItems[s + 17] = y3; - clippedVerticesItems[s + 18] = light.r; - clippedVerticesItems[s + 19] = light.g; - clippedVerticesItems[s + 20] = light.b; - clippedVerticesItems[s + 21] = light.a; - clippedVerticesItems[s + 22] = u3; - clippedVerticesItems[s + 23] = v3; - } else { - clippedVerticesItems[s + 6] = u1; - clippedVerticesItems[s + 7] = v1; - clippedVerticesItems[s + 8] = dark.r; - clippedVerticesItems[s + 9] = dark.g; - clippedVerticesItems[s + 10] = dark.b; - clippedVerticesItems[s + 11] = dark.a; - clippedVerticesItems[s + 12] = x2; - clippedVerticesItems[s + 13] = y2; - clippedVerticesItems[s + 14] = light.r; - clippedVerticesItems[s + 15] = light.g; - clippedVerticesItems[s + 16] = light.b; - clippedVerticesItems[s + 17] = light.a; - clippedVerticesItems[s + 18] = u2; - clippedVerticesItems[s + 19] = v2; - clippedVerticesItems[s + 20] = dark.r; - clippedVerticesItems[s + 21] = dark.g; - clippedVerticesItems[s + 22] = dark.b; - clippedVerticesItems[s + 23] = dark.a; - clippedVerticesItems[s + 24] = x3; - clippedVerticesItems[s + 25] = y3; - clippedVerticesItems[s + 26] = light.r; - clippedVerticesItems[s + 27] = light.g; - clippedVerticesItems[s + 28] = light.b; - clippedVerticesItems[s + 29] = light.a; - clippedVerticesItems[s + 30] = u3; - clippedVerticesItems[s + 31] = v3; - clippedVerticesItems[s + 32] = dark.r; - clippedVerticesItems[s + 33] = dark.g; - clippedVerticesItems[s + 34] = dark.b; - clippedVerticesItems[s + 35] = dark.a; - } - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + 1; - clippedTrianglesItems[s + 2] = index + 2; - index += 3; - break; - } - } - } - } - clipTrianglesUnpacked(vertices, triangles, trianglesLength, uvs) { - let clipOutput = this.clipOutput, clippedVertices = this.clippedVertices, clippedUVs = this.clippedUVs; - let clippedTriangles = this.clippedTriangles; - let polygons = this.clippingPolygons; - let polygonsCount = polygons.length; - let index = 0; - clippedVertices.length = 0; - clippedUVs.length = 0; - clippedTriangles.length = 0; - for (let i = 0; i < trianglesLength; i += 3) { - let vertexOffset = triangles[i] << 1; - let x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1]; - let u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 1] << 1; - let x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1]; - let u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1]; - vertexOffset = triangles[i + 2] << 1; - let x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1]; - let u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1]; - for (let p = 0; p < polygonsCount; p++) { - let s = clippedVertices.length; - if (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) { - let clipOutputLength = clipOutput.length; - if (clipOutputLength == 0) - continue; - let d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1; - let d = 1 / (d0 * d2 + d1 * (y1 - y3)); - let clipOutputCount = clipOutputLength >> 1; - let clipOutputItems = this.clipOutput; - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2); - let clippedUVsItems = Utils.setArraySize(clippedUVs, s + clipOutputCount * 2); - for (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) { - let x = clipOutputItems[ii], y = clipOutputItems[ii + 1]; - clippedVerticesItems[s] = x; - clippedVerticesItems[s + 1] = y; - let c0 = x - x3, c1 = y - y3; - let a = (d0 * c0 + d1 * c1) * d; - let b = (d4 * c0 + d2 * c1) * d; - let c = 1 - a - b; - clippedUVsItems[s] = u1 * a + u2 * b + u3 * c; - clippedUVsItems[s + 1] = v1 * a + v2 * b + v3 * c; - } - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2)); - clipOutputCount--; - for (let ii = 1; ii < clipOutputCount; ii++, s += 3) { - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + ii; - clippedTrianglesItems[s + 2] = index + ii + 1; - } - index += clipOutputCount + 1; - } else { - let clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2); - clippedVerticesItems[s] = x1; - clippedVerticesItems[s + 1] = y1; - clippedVerticesItems[s + 2] = x2; - clippedVerticesItems[s + 3] = y2; - clippedVerticesItems[s + 4] = x3; - clippedVerticesItems[s + 5] = y3; - let clippedUVSItems = Utils.setArraySize(clippedUVs, s + 3 * 2); - clippedUVSItems[s] = u1; - clippedUVSItems[s + 1] = v1; - clippedUVSItems[s + 2] = u2; - clippedUVSItems[s + 3] = v2; - clippedUVSItems[s + 4] = u3; - clippedUVSItems[s + 5] = v3; - s = clippedTriangles.length; - let clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3); - clippedTrianglesItems[s] = index; - clippedTrianglesItems[s + 1] = index + 1; - clippedTrianglesItems[s + 2] = index + 2; - index += 3; - break; - } - } - } - } - /** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping - * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */ - clip(x1, y1, x2, y2, x3, y3, clippingArea, output) { - let originalOutput = output; - let clipped = false; - let input; - if (clippingArea.length % 4 >= 2) { - input = output; - output = this.scratch; - } else - input = this.scratch; - input.length = 0; - input.push(x1); - input.push(y1); - input.push(x2); - input.push(y2); - input.push(x3); - input.push(y3); - input.push(x1); - input.push(y1); - output.length = 0; - let clippingVerticesLast = clippingArea.length - 4; - let clippingVertices = clippingArea; - for (let i = 0; ; i += 2) { - let edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1]; - let ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3]; - let outputStart = output.length; - let inputVertices = input; - for (let ii = 0, nn = input.length - 2; ii < nn; ) { - let inputX = inputVertices[ii], inputY = inputVertices[ii + 1]; - ii += 2; - let inputX2 = inputVertices[ii], inputY2 = inputVertices[ii + 1]; - let s2 = ey * (edgeX - inputX2) > ex * (edgeY - inputY2); - let s1 = ey * (edgeX - inputX) - ex * (edgeY - inputY); - if (s1 > 0) { - if (s2) { - output.push(inputX2); - output.push(inputY2); - continue; - } - let ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex); - if (t >= 0 && t <= 1) { - output.push(inputX + ix * t); - output.push(inputY + iy * t); - } else { - output.push(inputX2); - output.push(inputY2); - continue; - } - } else if (s2) { - let ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex); - if (t >= 0 && t <= 1) { - output.push(inputX + ix * t); - output.push(inputY + iy * t); - output.push(inputX2); - output.push(inputY2); - } else { - output.push(inputX2); - output.push(inputY2); - continue; - } - } - clipped = true; - } - if (outputStart == output.length) { - originalOutput.length = 0; - return true; - } - output.push(output[0]); - output.push(output[1]); - if (i == clippingVerticesLast) - break; - let temp = output; - output = input; - output.length = 0; - input = temp; - } - if (originalOutput != output) { - originalOutput.length = 0; - for (let i = 0, n = output.length - 2; i < n; i++) - originalOutput[i] = output[i]; - } else - originalOutput.length = originalOutput.length - 2; - return clipped; - } - static makeClockwise(polygon) { - let vertices = polygon; - let verticeslength = polygon.length; - let area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0; - for (let i = 0, n = verticeslength - 3; i < n; i += 2) { - p1x = vertices[i]; - p1y = vertices[i + 1]; - p2x = vertices[i + 2]; - p2y = vertices[i + 3]; - area += p1x * p2y - p2x * p1y; - } - if (area < 0) - return; - for (let i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) { - let x = vertices[i], y = vertices[i + 1]; - let other = lastX - i; - vertices[i] = vertices[other]; - vertices[i + 1] = vertices[other + 1]; - vertices[other] = x; - vertices[other + 1] = y; - } - } - }; - - // spine-core/src/SkeletonJson.ts - var SkeletonJson = class { - attachmentLoader; - /** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at - * runtime than were used in Spine. - * - * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */ - scale = 1; - linkedMeshes = new Array(); - constructor(attachmentLoader) { - this.attachmentLoader = attachmentLoader; - } - readSkeletonData(json) { - let scale = this.scale; - let skeletonData = new SkeletonData(); - let root = typeof json === "string" ? JSON.parse(json) : json; - let skeletonMap = root.skeleton; - if (skeletonMap) { - skeletonData.hash = skeletonMap.hash; - skeletonData.version = skeletonMap.spine; - skeletonData.x = skeletonMap.x; - skeletonData.y = skeletonMap.y; - skeletonData.width = skeletonMap.width; - skeletonData.height = skeletonMap.height; - skeletonData.referenceScale = getValue(skeletonMap, "referenceScale", 100) * scale; - skeletonData.fps = skeletonMap.fps; - skeletonData.imagesPath = skeletonMap.images ?? null; - skeletonData.audioPath = skeletonMap.audio ?? null; - } - if (root.bones) { - for (let i = 0; i < root.bones.length; i++) { - let boneMap = root.bones[i]; - let parent = null; - let parentName = getValue(boneMap, "parent", null); - if (parentName) - parent = skeletonData.findBone(parentName); - let data = new BoneData(skeletonData.bones.length, boneMap.name, parent); - data.length = getValue(boneMap, "length", 0) * scale; - data.x = getValue(boneMap, "x", 0) * scale; - data.y = getValue(boneMap, "y", 0) * scale; - data.rotation = getValue(boneMap, "rotation", 0); - data.scaleX = getValue(boneMap, "scaleX", 1); - data.scaleY = getValue(boneMap, "scaleY", 1); - data.shearX = getValue(boneMap, "shearX", 0); - data.shearY = getValue(boneMap, "shearY", 0); - data.inherit = Utils.enumValue(Inherit, getValue(boneMap, "inherit", "Normal")); - data.skinRequired = getValue(boneMap, "skin", false); - let color = getValue(boneMap, "color", null); - if (color) - data.color.setFromString(color); - skeletonData.bones.push(data); - } - } - if (root.slots) { - for (let i = 0; i < root.slots.length; i++) { - let slotMap = root.slots[i]; - let slotName = slotMap.name; - let boneData = skeletonData.findBone(slotMap.bone); - if (!boneData) - throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`); - let data = new SlotData(skeletonData.slots.length, slotName, boneData); - let color = getValue(slotMap, "color", null); - if (color) - data.color.setFromString(color); - let dark = getValue(slotMap, "dark", null); - if (dark) - data.darkColor = Color.fromString(dark); - data.attachmentName = getValue(slotMap, "attachment", null); - data.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, "blend", "normal")); - data.visible = getValue(slotMap, "visible", true); - skeletonData.slots.push(data); - } - } - if (root.ik) { - for (let i = 0; i < root.ik.length; i++) { - let constraintMap = root.ik[i]; - let data = new IkConstraintData(constraintMap.name); - data.order = getValue(constraintMap, "order", 0); - data.skinRequired = getValue(constraintMap, "skin", false); - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - let bone = skeletonData.findBone(constraintMap.bones[ii]); - if (!bone) - throw new Error(`Couldn't find bone ${constraintMap.bones[ii]} for IK constraint ${constraintMap.name}.`); - data.bones.push(bone); - } - let target = skeletonData.findBone(constraintMap.target); - ; - if (!target) - throw new Error(`Couldn't find target bone ${constraintMap.target} for IK constraint ${constraintMap.name}.`); - data.target = target; - data.mix = getValue(constraintMap, "mix", 1); - data.softness = getValue(constraintMap, "softness", 0) * scale; - data.bendDirection = getValue(constraintMap, "bendPositive", true) ? 1 : -1; - data.compress = getValue(constraintMap, "compress", false); - data.stretch = getValue(constraintMap, "stretch", false); - data.uniform = getValue(constraintMap, "uniform", false); - skeletonData.ikConstraints.push(data); - } - } - if (root.transform) { - for (let i = 0; i < root.transform.length; i++) { - let constraintMap = root.transform[i]; - let data = new TransformConstraintData(constraintMap.name); - data.order = getValue(constraintMap, "order", 0); - data.skinRequired = getValue(constraintMap, "skin", false); - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - let boneName = constraintMap.bones[ii]; - let bone = skeletonData.findBone(boneName); - if (!bone) - throw new Error(`Couldn't find bone ${boneName} for transform constraint ${constraintMap.name}.`); - data.bones.push(bone); - } - let targetName = constraintMap.target; - let target = skeletonData.findBone(targetName); - if (!target) - throw new Error(`Couldn't find target bone ${targetName} for transform constraint ${constraintMap.name}.`); - data.target = target; - data.local = getValue(constraintMap, "local", false); - data.relative = getValue(constraintMap, "relative", false); - data.offsetRotation = getValue(constraintMap, "rotation", 0); - data.offsetX = getValue(constraintMap, "x", 0) * scale; - data.offsetY = getValue(constraintMap, "y", 0) * scale; - data.offsetScaleX = getValue(constraintMap, "scaleX", 0); - data.offsetScaleY = getValue(constraintMap, "scaleY", 0); - data.offsetShearY = getValue(constraintMap, "shearY", 0); - data.mixRotate = getValue(constraintMap, "mixRotate", 1); - data.mixX = getValue(constraintMap, "mixX", 1); - data.mixY = getValue(constraintMap, "mixY", data.mixX); - data.mixScaleX = getValue(constraintMap, "mixScaleX", 1); - data.mixScaleY = getValue(constraintMap, "mixScaleY", data.mixScaleX); - data.mixShearY = getValue(constraintMap, "mixShearY", 1); - skeletonData.transformConstraints.push(data); - } - } - if (root.path) { - for (let i = 0; i < root.path.length; i++) { - let constraintMap = root.path[i]; - let data = new PathConstraintData(constraintMap.name); - data.order = getValue(constraintMap, "order", 0); - data.skinRequired = getValue(constraintMap, "skin", false); - for (let ii = 0; ii < constraintMap.bones.length; ii++) { - let boneName = constraintMap.bones[ii]; - let bone = skeletonData.findBone(boneName); - if (!bone) - throw new Error(`Couldn't find bone ${boneName} for path constraint ${constraintMap.name}.`); - data.bones.push(bone); - } - let targetName = constraintMap.target; - let target = skeletonData.findSlot(targetName); - if (!target) - throw new Error(`Couldn't find target slot ${targetName} for path constraint ${constraintMap.name}.`); - data.target = target; - data.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, "positionMode", "Percent")); - data.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, "spacingMode", "Length")); - data.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, "rotateMode", "Tangent")); - data.offsetRotation = getValue(constraintMap, "rotation", 0); - data.position = getValue(constraintMap, "position", 0); - if (data.positionMode == 0 /* Fixed */) - data.position *= scale; - data.spacing = getValue(constraintMap, "spacing", 0); - if (data.spacingMode == 0 /* Length */ || data.spacingMode == 1 /* Fixed */) - data.spacing *= scale; - data.mixRotate = getValue(constraintMap, "mixRotate", 1); - data.mixX = getValue(constraintMap, "mixX", 1); - data.mixY = getValue(constraintMap, "mixY", data.mixX); - skeletonData.pathConstraints.push(data); - } - } - if (root.physics) { - for (let i = 0; i < root.physics.length; i++) { - const constraintMap = root.physics[i]; - const data = new PhysicsConstraintData(constraintMap.name); - data.order = getValue(constraintMap, "order", 0); - data.skinRequired = getValue(constraintMap, "skin", false); - const boneName = constraintMap.bone; - const bone = skeletonData.findBone(boneName); - if (bone == null) - throw new Error("Physics bone not found: " + boneName); - data.bone = bone; - data.x = getValue(constraintMap, "x", 0); - data.y = getValue(constraintMap, "y", 0); - data.rotate = getValue(constraintMap, "rotate", 0); - data.scaleX = getValue(constraintMap, "scaleX", 0); - data.shearX = getValue(constraintMap, "shearX", 0); - data.limit = getValue(constraintMap, "limit", 5e3) * scale; - data.step = 1 / getValue(constraintMap, "fps", 60); - data.inertia = getValue(constraintMap, "inertia", 1); - data.strength = getValue(constraintMap, "strength", 100); - data.damping = getValue(constraintMap, "damping", 1); - data.massInverse = 1 / getValue(constraintMap, "mass", 1); - data.wind = getValue(constraintMap, "wind", 0); - data.gravity = getValue(constraintMap, "gravity", 0); - data.mix = getValue(constraintMap, "mix", 1); - data.inertiaGlobal = getValue(constraintMap, "inertiaGlobal", false); - data.strengthGlobal = getValue(constraintMap, "strengthGlobal", false); - data.dampingGlobal = getValue(constraintMap, "dampingGlobal", false); - data.massGlobal = getValue(constraintMap, "massGlobal", false); - data.windGlobal = getValue(constraintMap, "windGlobal", false); - data.gravityGlobal = getValue(constraintMap, "gravityGlobal", false); - data.mixGlobal = getValue(constraintMap, "mixGlobal", false); - skeletonData.physicsConstraints.push(data); - } - } - if (root.skins) { - for (let i = 0; i < root.skins.length; i++) { - let skinMap = root.skins[i]; - let skin = new Skin(skinMap.name); - if (skinMap.bones) { - for (let ii = 0; ii < skinMap.bones.length; ii++) { - let boneName = skinMap.bones[ii]; - let bone = skeletonData.findBone(boneName); - if (!bone) - throw new Error(`Couldn't find bone ${boneName} for skin ${skinMap.name}.`); - skin.bones.push(bone); - } - } - if (skinMap.ik) { - for (let ii = 0; ii < skinMap.ik.length; ii++) { - let constraintName = skinMap.ik[ii]; - let constraint = skeletonData.findIkConstraint(constraintName); - if (!constraint) - throw new Error(`Couldn't find IK constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.transform) { - for (let ii = 0; ii < skinMap.transform.length; ii++) { - let constraintName = skinMap.transform[ii]; - let constraint = skeletonData.findTransformConstraint(constraintName); - if (!constraint) - throw new Error(`Couldn't find transform constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.path) { - for (let ii = 0; ii < skinMap.path.length; ii++) { - let constraintName = skinMap.path[ii]; - let constraint = skeletonData.findPathConstraint(constraintName); - if (!constraint) - throw new Error(`Couldn't find path constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - if (skinMap.physics) { - for (let ii = 0; ii < skinMap.physics.length; ii++) { - let constraintName = skinMap.physics[ii]; - let constraint = skeletonData.findPhysicsConstraint(constraintName); - if (!constraint) - throw new Error(`Couldn't find physics constraint ${constraintName} for skin ${skinMap.name}.`); - skin.constraints.push(constraint); - } - } - for (let slotName in skinMap.attachments) { - let slot = skeletonData.findSlot(slotName); - if (!slot) - throw new Error(`Couldn't find slot ${slotName} for skin ${skinMap.name}.`); - let slotMap = skinMap.attachments[slotName]; - for (let entryName in slotMap) { - let attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData); - if (attachment) - skin.setAttachment(slot.index, entryName, attachment); - } - } - skeletonData.skins.push(skin); - if (skin.name == "default") - skeletonData.defaultSkin = skin; - } - } - for (let i = 0, n = this.linkedMeshes.length; i < n; i++) { - let linkedMesh = this.linkedMeshes[i]; - let skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin); - if (!skin) - throw new Error(`Skin not found: ${linkedMesh.skin}`); - let parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent); - if (!parent) - throw new Error(`Parent mesh not found: ${linkedMesh.parent}`); - linkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh; - linkedMesh.mesh.setParentMesh(parent); - if (linkedMesh.mesh.region != null) - linkedMesh.mesh.updateRegion(); - } - this.linkedMeshes.length = 0; - if (root.events) { - for (let eventName in root.events) { - let eventMap = root.events[eventName]; - let data = new EventData(eventName); - data.intValue = getValue(eventMap, "int", 0); - data.floatValue = getValue(eventMap, "float", 0); - data.stringValue = getValue(eventMap, "string", ""); - data.audioPath = getValue(eventMap, "audio", null); - if (data.audioPath) { - data.volume = getValue(eventMap, "volume", 1); - data.balance = getValue(eventMap, "balance", 0); - } - skeletonData.events.push(data); - } - } - if (root.animations) { - for (let animationName in root.animations) { - let animationMap = root.animations[animationName]; - this.readAnimation(animationMap, animationName, skeletonData); - } - } - return skeletonData; - } - readAttachment(map, skin, slotIndex, name, skeletonData) { - let scale = this.scale; - name = getValue(map, "name", name); - switch (getValue(map, "type", "region")) { - case "region": { - let path = getValue(map, "path", name); - let sequence = this.readSequence(getValue(map, "sequence", null)); - let region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence); - if (!region) - return null; - region.path = path; - region.x = getValue(map, "x", 0) * scale; - region.y = getValue(map, "y", 0) * scale; - region.scaleX = getValue(map, "scaleX", 1); - region.scaleY = getValue(map, "scaleY", 1); - region.rotation = getValue(map, "rotation", 0); - region.width = map.width * scale; - region.height = map.height * scale; - region.sequence = sequence; - let color = getValue(map, "color", null); - if (color) - region.color.setFromString(color); - if (region.region != null) - region.updateRegion(); - return region; - } - case "boundingbox": { - let box = this.attachmentLoader.newBoundingBoxAttachment(skin, name); - if (!box) - return null; - this.readVertices(map, box, map.vertexCount << 1); - let color = getValue(map, "color", null); - if (color) - box.color.setFromString(color); - return box; - } - case "mesh": - case "linkedmesh": { - let path = getValue(map, "path", name); - let sequence = this.readSequence(getValue(map, "sequence", null)); - let mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence); - if (!mesh) - return null; - mesh.path = path; - let color = getValue(map, "color", null); - if (color) - mesh.color.setFromString(color); - mesh.width = getValue(map, "width", 0) * scale; - mesh.height = getValue(map, "height", 0) * scale; - mesh.sequence = sequence; - let parent = getValue(map, "parent", null); - if (parent) { - this.linkedMeshes.push(new LinkedMesh2(mesh, getValue(map, "skin", null), slotIndex, parent, getValue(map, "timelines", true))); - return mesh; - } - let uvs = map.uvs; - this.readVertices(map, mesh, uvs.length); - mesh.triangles = map.triangles; - mesh.regionUVs = uvs; - if (mesh.region != null) - mesh.updateRegion(); - mesh.edges = getValue(map, "edges", null); - mesh.hullLength = getValue(map, "hull", 0) * 2; - return mesh; - } - case "path": { - let path = this.attachmentLoader.newPathAttachment(skin, name); - if (!path) - return null; - path.closed = getValue(map, "closed", false); - path.constantSpeed = getValue(map, "constantSpeed", true); - let vertexCount = map.vertexCount; - this.readVertices(map, path, vertexCount << 1); - let lengths = Utils.newArray(vertexCount / 3, 0); - for (let i = 0; i < map.lengths.length; i++) - lengths[i] = map.lengths[i] * scale; - path.lengths = lengths; - let color = getValue(map, "color", null); - if (color) - path.color.setFromString(color); - return path; - } - case "point": { - let point = this.attachmentLoader.newPointAttachment(skin, name); - if (!point) - return null; - point.x = getValue(map, "x", 0) * scale; - point.y = getValue(map, "y", 0) * scale; - point.rotation = getValue(map, "rotation", 0); - let color = getValue(map, "color", null); - if (color) - point.color.setFromString(color); - return point; - } - case "clipping": { - let clip = this.attachmentLoader.newClippingAttachment(skin, name); - if (!clip) - return null; - let end = getValue(map, "end", null); - if (end) - clip.endSlot = skeletonData.findSlot(end); - let vertexCount = map.vertexCount; - this.readVertices(map, clip, vertexCount << 1); - let color = getValue(map, "color", null); - if (color) - clip.color.setFromString(color); - return clip; - } - } - return null; - } - readSequence(map) { - if (map == null) - return null; - let sequence = new Sequence(getValue(map, "count", 0)); - sequence.start = getValue(map, "start", 1); - sequence.digits = getValue(map, "digits", 0); - sequence.setupIndex = getValue(map, "setup", 0); - return sequence; - } - readVertices(map, attachment, verticesLength) { - let scale = this.scale; - attachment.worldVerticesLength = verticesLength; - let vertices = map.vertices; - if (verticesLength == vertices.length) { - let scaledVertices = Utils.toFloatArray(vertices); - if (scale != 1) { - for (let i = 0, n = vertices.length; i < n; i++) - scaledVertices[i] *= scale; - } - attachment.vertices = scaledVertices; - return; - } - let weights = new Array(); - let bones = new Array(); - for (let i = 0, n = vertices.length; i < n; ) { - let boneCount = vertices[i++]; - bones.push(boneCount); - for (let nn = i + boneCount * 4; i < nn; i += 4) { - bones.push(vertices[i]); - weights.push(vertices[i + 1] * scale); - weights.push(vertices[i + 2] * scale); - weights.push(vertices[i + 3]); - } - } - attachment.bones = bones; - attachment.vertices = Utils.toFloatArray(weights); - } - readAnimation(map, name, skeletonData) { - let scale = this.scale; - let timelines = new Array(); - if (map.slots) { - for (let slotName in map.slots) { - let slotMap = map.slots[slotName]; - let slot = skeletonData.findSlot(slotName); - if (!slot) - throw new Error("Slot not found: " + slotName); - let slotIndex = slot.index; - for (let timelineName in slotMap) { - let timelineMap = slotMap[timelineName]; - if (!timelineMap) - continue; - let frames = timelineMap.length; - if (timelineName == "attachment") { - let timeline = new AttachmentTimeline(frames, slotIndex); - for (let frame = 0; frame < frames; frame++) { - let keyMap = timelineMap[frame]; - timeline.setFrame(frame, getValue(keyMap, "time", 0), getValue(keyMap, "name", null)); - } - timelines.push(timeline); - } else if (timelineName == "rgba") { - let timeline = new RGBATimeline(frames, frames << 2, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.color); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color.a); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let newColor = Color.fromString(nextMap.color); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1); - } - time = time2; - color = newColor; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineName == "rgb") { - let timeline = new RGBTimeline(frames, frames * 3, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.color); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let newColor = Color.fromString(nextMap.color); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - } - time = time2; - color = newColor; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineName == "alpha") { - timelines.push(readTimeline12(timelineMap, new AlphaTimeline(frames, frames, slotIndex), 0, 1)); - } else if (timelineName == "rgba2") { - let timeline = new RGBA2Timeline(frames, frames * 7, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.light); - let color2 = Color.fromString(keyMap.dark); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let newColor = Color.fromString(nextMap.light); - let newColor2 = Color.fromString(nextMap.dark); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1); - } - time = time2; - color = newColor; - color2 = newColor2; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineName == "rgb2") { - let timeline = new RGB2Timeline(frames, frames * 6, slotIndex); - let keyMap = timelineMap[0]; - let time = getValue(keyMap, "time", 0); - let color = Color.fromString(keyMap.light); - let color2 = Color.fromString(keyMap.dark); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let newColor = Color.fromString(nextMap.light); - let newColor2 = Color.fromString(nextMap.dark); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1); - } - time = time2; - color = newColor; - color2 = newColor2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - } - } - if (map.bones) { - for (let boneName in map.bones) { - let boneMap = map.bones[boneName]; - let bone = skeletonData.findBone(boneName); - if (!bone) - throw new Error("Bone not found: " + boneName); - let boneIndex = bone.index; - for (let timelineName in boneMap) { - let timelineMap = boneMap[timelineName]; - let frames = timelineMap.length; - if (frames == 0) - continue; - if (timelineName === "rotate") { - timelines.push(readTimeline12(timelineMap, new RotateTimeline(frames, frames, boneIndex), 0, 1)); - } else if (timelineName === "translate") { - let timeline = new TranslateTimeline(frames, frames << 1, boneIndex); - timelines.push(readTimeline22(timelineMap, timeline, "x", "y", 0, scale)); - } else if (timelineName === "translatex") { - let timeline = new TranslateXTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, scale)); - } else if (timelineName === "translatey") { - let timeline = new TranslateYTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, scale)); - } else if (timelineName === "scale") { - let timeline = new ScaleTimeline(frames, frames << 1, boneIndex); - timelines.push(readTimeline22(timelineMap, timeline, "x", "y", 1, 1)); - } else if (timelineName === "scalex") { - let timeline = new ScaleXTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 1, 1)); - } else if (timelineName === "scaley") { - let timeline = new ScaleYTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 1, 1)); - } else if (timelineName === "shear") { - let timeline = new ShearTimeline(frames, frames << 1, boneIndex); - timelines.push(readTimeline22(timelineMap, timeline, "x", "y", 0, 1)); - } else if (timelineName === "shearx") { - let timeline = new ShearXTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, 1)); - } else if (timelineName === "sheary") { - let timeline = new ShearYTimeline(frames, frames, boneIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, 1)); - } else if (timelineName === "inherit") { - let timeline = new InheritTimeline(frames, bone.index); - for (let frame = 0; frame < timelineMap.length; frame++) { - let aFrame = timelineMap[frame]; - timeline.setFrame(frame, getValue(aFrame, "time", 0), Utils.enumValue(Inherit, getValue(aFrame, "inherit", "Normal"))); - } - timelines.push(timeline); - } - } - } - } - if (map.ik) { - for (let constraintName in map.ik) { - let constraintMap = map.ik[constraintName]; - let keyMap = constraintMap[0]; - if (!keyMap) - continue; - let constraint = skeletonData.findIkConstraint(constraintName); - if (!constraint) - throw new Error("IK Constraint not found: " + constraintName); - let constraintIndex = skeletonData.ikConstraints.indexOf(constraint); - let timeline = new IkConstraintTimeline(constraintMap.length, constraintMap.length << 1, constraintIndex); - let time = getValue(keyMap, "time", 0); - let mix = getValue(keyMap, "mix", 1); - let softness = getValue(keyMap, "softness", 0) * scale; - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mix, softness, getValue(keyMap, "bendPositive", true) ? 1 : -1, getValue(keyMap, "compress", false), getValue(keyMap, "stretch", false)); - let nextMap = constraintMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let mix2 = getValue(nextMap, "mix", 1); - let softness2 = getValue(nextMap, "softness", 0) * scale; - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale); - } - time = time2; - mix = mix2; - softness = softness2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - if (map.transform) { - for (let constraintName in map.transform) { - let timelineMap = map.transform[constraintName]; - let keyMap = timelineMap[0]; - if (!keyMap) - continue; - let constraint = skeletonData.findTransformConstraint(constraintName); - if (!constraint) - throw new Error("Transform constraint not found: " + constraintName); - let constraintIndex = skeletonData.transformConstraints.indexOf(constraint); - let timeline = new TransformConstraintTimeline(timelineMap.length, timelineMap.length * 6, constraintIndex); - let time = getValue(keyMap, "time", 0); - let mixRotate = getValue(keyMap, "mixRotate", 1); - let mixX = getValue(keyMap, "mixX", 1); - let mixY = getValue(keyMap, "mixY", mixX); - let mixScaleX = getValue(keyMap, "mixScaleX", 1); - let mixScaleY = getValue(keyMap, "mixScaleY", mixScaleX); - let mixShearY = getValue(keyMap, "mixShearY", 1); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let mixRotate2 = getValue(nextMap, "mixRotate", 1); - let mixX2 = getValue(nextMap, "mixX", 1); - let mixY2 = getValue(nextMap, "mixY", mixX2); - let mixScaleX2 = getValue(nextMap, "mixScaleX", 1); - let mixScaleY2 = getValue(nextMap, "mixScaleY", mixScaleX2); - let mixShearY2 = getValue(nextMap, "mixShearY", 1); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - mixScaleX = mixScaleX2; - mixScaleY = mixScaleY2; - mixScaleX = mixScaleX2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - if (map.path) { - for (let constraintName in map.path) { - let constraintMap = map.path[constraintName]; - let constraint = skeletonData.findPathConstraint(constraintName); - if (!constraint) - throw new Error("Path constraint not found: " + constraintName); - let constraintIndex = skeletonData.pathConstraints.indexOf(constraint); - for (let timelineName in constraintMap) { - let timelineMap = constraintMap[timelineName]; - let keyMap = timelineMap[0]; - if (!keyMap) - continue; - let frames = timelineMap.length; - if (timelineName === "position") { - let timeline = new PathConstraintPositionTimeline(frames, frames, constraintIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, constraint.positionMode == 0 /* Fixed */ ? scale : 1)); - } else if (timelineName === "spacing") { - let timeline = new PathConstraintSpacingTimeline(frames, frames, constraintIndex); - timelines.push(readTimeline12(timelineMap, timeline, 0, constraint.spacingMode == 0 /* Length */ || constraint.spacingMode == 1 /* Fixed */ ? scale : 1)); - } else if (timelineName === "mix") { - let timeline = new PathConstraintMixTimeline(frames, frames * 3, constraintIndex); - let time = getValue(keyMap, "time", 0); - let mixRotate = getValue(keyMap, "mixRotate", 1); - let mixX = getValue(keyMap, "mixX", 1); - let mixY = getValue(keyMap, "mixY", mixX); - for (let frame = 0, bezier = 0; ; frame++) { - timeline.setFrame(frame, time, mixRotate, mixX, mixY); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let mixRotate2 = getValue(nextMap, "mixRotate", 1); - let mixX2 = getValue(nextMap, "mixX", 1); - let mixY2 = getValue(nextMap, "mixY", mixX2); - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1); - bezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1); - } - time = time2; - mixRotate = mixRotate2; - mixX = mixX2; - mixY = mixY2; - keyMap = nextMap; - } - timelines.push(timeline); - } - } - } - } - if (map.physics) { - for (let constraintName in map.physics) { - let constraintMap = map.physics[constraintName]; - let constraintIndex = -1; - if (constraintName.length > 0) { - let constraint = skeletonData.findPhysicsConstraint(constraintName); - if (!constraint) - throw new Error("Physics constraint not found: " + constraintName); - constraintIndex = skeletonData.physicsConstraints.indexOf(constraint); - } - for (let timelineName in constraintMap) { - let timelineMap = constraintMap[timelineName]; - let keyMap = timelineMap[0]; - if (!keyMap) - continue; - let frames = timelineMap.length; - if (timelineName == "reset") { - const timeline2 = new PhysicsConstraintResetTimeline(frames, constraintIndex); - for (let frame = 0; keyMap != null; keyMap = timelineMap[frame + 1], frame++) - timeline2.setFrame(frame, getValue(keyMap, "time", 0)); - timelines.push(timeline2); - continue; - } - let timeline; - if (timelineName == "inertia") - timeline = new PhysicsConstraintInertiaTimeline(frames, frames, constraintIndex); - else if (timelineName == "strength") - timeline = new PhysicsConstraintStrengthTimeline(frames, frames, constraintIndex); - else if (timelineName == "damping") - timeline = new PhysicsConstraintDampingTimeline(frames, frames, constraintIndex); - else if (timelineName == "mass") - timeline = new PhysicsConstraintMassTimeline(frames, frames, constraintIndex); - else if (timelineName == "wind") - timeline = new PhysicsConstraintWindTimeline(frames, frames, constraintIndex); - else if (timelineName == "gravity") - timeline = new PhysicsConstraintGravityTimeline(frames, frames, constraintIndex); - else if (timelineName == "mix") - timeline = new PhysicsConstraintMixTimeline(frames, frames, constraintIndex); - else - continue; - timelines.push(readTimeline12(timelineMap, timeline, 0, 1)); - } - } - } - if (map.attachments) { - for (let attachmentsName in map.attachments) { - let attachmentsMap = map.attachments[attachmentsName]; - let skin = skeletonData.findSkin(attachmentsName); - if (!skin) - throw new Error("Skin not found: " + attachmentsName); - for (let slotMapName in attachmentsMap) { - let slotMap = attachmentsMap[slotMapName]; - let slot = skeletonData.findSlot(slotMapName); - if (!slot) - throw new Error("Slot not found: " + slotMapName); - let slotIndex = slot.index; - for (let attachmentMapName in slotMap) { - let attachmentMap = slotMap[attachmentMapName]; - let attachment = skin.getAttachment(slotIndex, attachmentMapName); - for (let timelineMapName in attachmentMap) { - let timelineMap = attachmentMap[timelineMapName]; - let keyMap = timelineMap[0]; - if (!keyMap) - continue; - if (timelineMapName == "deform") { - let weighted = attachment.bones; - let vertices = attachment.vertices; - let deformLength = weighted ? vertices.length / 3 * 2 : vertices.length; - let timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment); - let time = getValue(keyMap, "time", 0); - for (let frame = 0, bezier = 0; ; frame++) { - let deform; - let verticesValue = getValue(keyMap, "vertices", null); - if (!verticesValue) - deform = weighted ? Utils.newFloatArray(deformLength) : vertices; - else { - deform = Utils.newFloatArray(deformLength); - let start = getValue(keyMap, "offset", 0); - Utils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length); - if (scale != 1) { - for (let i = start, n = i + verticesValue.length; i < n; i++) - deform[i] *= scale; - } - if (!weighted) { - for (let i = 0; i < deformLength; i++) - deform[i] += vertices[i]; - } - } - timeline.setFrame(frame, time, deform); - let nextMap = timelineMap[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - break; - } - let time2 = getValue(nextMap, "time", 0); - let curve = keyMap.curve; - if (curve) - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1); - time = time2; - keyMap = nextMap; - } - timelines.push(timeline); - } else if (timelineMapName == "sequence") { - let timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment); - let lastDelay = 0; - for (let frame = 0; frame < timelineMap.length; frame++) { - let delay = getValue(keyMap, "delay", lastDelay); - let time = getValue(keyMap, "time", 0); - let mode = SequenceMode[getValue(keyMap, "mode", "hold")]; - let index = getValue(keyMap, "index", 0); - timeline.setFrame(frame, time, mode, index, delay); - lastDelay = delay; - keyMap = timelineMap[frame + 1]; - } - timelines.push(timeline); - } - } - } - } - } - } - if (map.drawOrder) { - let timeline = new DrawOrderTimeline(map.drawOrder.length); - let slotCount = skeletonData.slots.length; - let frame = 0; - for (let i = 0; i < map.drawOrder.length; i++, frame++) { - let drawOrderMap = map.drawOrder[i]; - let drawOrder = null; - let offsets = getValue(drawOrderMap, "offsets", null); - if (offsets) { - drawOrder = Utils.newArray(slotCount, -1); - let unchanged = Utils.newArray(slotCount - offsets.length, 0); - let originalIndex = 0, unchangedIndex = 0; - for (let ii = 0; ii < offsets.length; ii++) { - let offsetMap = offsets[ii]; - let slot = skeletonData.findSlot(offsetMap.slot); - if (!slot) - throw new Error("Slot not found: " + slot); - let slotIndex = slot.index; - while (originalIndex != slotIndex) - unchanged[unchangedIndex++] = originalIndex++; - drawOrder[originalIndex + offsetMap.offset] = originalIndex++; - } - while (originalIndex < slotCount) - unchanged[unchangedIndex++] = originalIndex++; - for (let ii = slotCount - 1; ii >= 0; ii--) - if (drawOrder[ii] == -1) - drawOrder[ii] = unchanged[--unchangedIndex]; - } - timeline.setFrame(frame, getValue(drawOrderMap, "time", 0), drawOrder); - } - timelines.push(timeline); - } - if (map.events) { - let timeline = new EventTimeline(map.events.length); - let frame = 0; - for (let i = 0; i < map.events.length; i++, frame++) { - let eventMap = map.events[i]; - let eventData = skeletonData.findEvent(eventMap.name); - if (!eventData) - throw new Error("Event not found: " + eventMap.name); - let event = new Event(Utils.toSinglePrecision(getValue(eventMap, "time", 0)), eventData); - event.intValue = getValue(eventMap, "int", eventData.intValue); - event.floatValue = getValue(eventMap, "float", eventData.floatValue); - event.stringValue = getValue(eventMap, "string", eventData.stringValue); - if (event.data.audioPath) { - event.volume = getValue(eventMap, "volume", 1); - event.balance = getValue(eventMap, "balance", 0); - } - timeline.setFrame(frame, event); - } - timelines.push(timeline); - } - let duration = 0; - for (let i = 0, n = timelines.length; i < n; i++) - duration = Math.max(duration, timelines[i].getDuration()); - skeletonData.animations.push(new Animation(name, timelines, duration)); - } - }; - var LinkedMesh2 = class { - parent; - skin; - slotIndex; - mesh; - inheritTimeline; - constructor(mesh, skin, slotIndex, parent, inheritDeform) { - this.mesh = mesh; - this.skin = skin; - this.slotIndex = slotIndex; - this.parent = parent; - this.inheritTimeline = inheritDeform; - } - }; - function readTimeline12(keys, timeline, defaultValue, scale) { - let keyMap = keys[0]; - let time = getValue(keyMap, "time", 0); - let value = getValue(keyMap, "value", defaultValue) * scale; - let bezier = 0; - for (let frame = 0; ; frame++) { - timeline.setFrame(frame, time, value); - let nextMap = keys[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - return timeline; - } - let time2 = getValue(nextMap, "time", 0); - let value2 = getValue(nextMap, "value", defaultValue) * scale; - if (keyMap.curve) - bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale); - time = time2; - value = value2; - keyMap = nextMap; - } - } - function readTimeline22(keys, timeline, name1, name2, defaultValue, scale) { - let keyMap = keys[0]; - let time = getValue(keyMap, "time", 0); - let value1 = getValue(keyMap, name1, defaultValue) * scale; - let value2 = getValue(keyMap, name2, defaultValue) * scale; - let bezier = 0; - for (let frame = 0; ; frame++) { - timeline.setFrame(frame, time, value1, value2); - let nextMap = keys[frame + 1]; - if (!nextMap) { - timeline.shrink(bezier); - return timeline; - } - let time2 = getValue(nextMap, "time", 0); - let nvalue1 = getValue(nextMap, name1, defaultValue) * scale; - let nvalue2 = getValue(nextMap, name2, defaultValue) * scale; - let curve = keyMap.curve; - if (curve) { - bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale); - bezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale); - } - time = time2; - value1 = nvalue1; - value2 = nvalue2; - keyMap = nextMap; - } - } - function readCurve(curve, timeline, bezier, frame, value, time1, time2, value1, value2, scale) { - if (curve == "stepped") { - timeline.setStepped(frame); - return bezier; - } - let i = value << 2; - let cx1 = curve[i]; - let cy1 = curve[i + 1] * scale; - let cx2 = curve[i + 2]; - let cy2 = curve[i + 3] * scale; - timeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2); - return bezier + 1; - } - function getValue(map, property, defaultValue) { - return map[property] !== void 0 ? map[property] : defaultValue; - } - - // spine-core/src/polyfills.ts - (() => { - if (typeof Math.fround === "undefined") { - Math.fround = function(array) { - return function(x) { - return array[0] = x, array[0]; - }; - }(new Float32Array(1)); - } - })(); - - // spine-webgl/src/WebGL.ts - var ManagedWebGLRenderingContext = class { - canvas; - gl; - restorables = new Array(); - constructor(canvasOrContext, contextConfig = { alpha: "true" }) { - if (!(canvasOrContext instanceof WebGLRenderingContext || typeof WebGL2RenderingContext !== "undefined" && canvasOrContext instanceof WebGL2RenderingContext)) { - let canvas = canvasOrContext; - this.gl = canvas.getContext("webgl2", contextConfig) || canvas.getContext("webgl", contextConfig); - this.canvas = canvas; - canvas.addEventListener("webglcontextlost", (e) => { - let event = e; - if (e) - e.preventDefault(); - }); - canvas.addEventListener("webglcontextrestored", (e) => { - for (let i = 0, n = this.restorables.length; i < n; i++) - this.restorables[i].restore(); - }); - } else { - this.gl = canvasOrContext; - this.canvas = this.gl.canvas; - } - } - addRestorable(restorable) { - this.restorables.push(restorable); - } - removeRestorable(restorable) { - let index = this.restorables.indexOf(restorable); - if (index > -1) - this.restorables.splice(index, 1); - } - }; - - // spine-webgl/src/GLTexture.ts - var _GLTexture = class extends Texture { - context; - texture = null; - boundUnit = 0; - useMipMaps = false; - constructor(context, image, useMipMaps = false) { - super(image); - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.useMipMaps = useMipMaps; - this.restore(); - this.context.addRestorable(this); - } - setFilters(minFilter, magFilter) { - let gl = this.context.gl; - this.bind(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, _GLTexture.validateMagFilter(magFilter)); - this.useMipMaps = _GLTexture.usesMipMaps(minFilter); - if (this.useMipMaps) - gl.generateMipmap(gl.TEXTURE_2D); - } - static validateMagFilter(magFilter) { - switch (magFilter) { - case 9987 /* MipMapLinearLinear */: - case 9985 /* MipMapLinearNearest */: - case 9986 /* MipMapNearestLinear */: - case 9984 /* MipMapNearestNearest */: - return 9729 /* Linear */; - default: - return magFilter; - } - } - static usesMipMaps(filter) { - switch (filter) { - case 9987 /* MipMapLinearLinear */: - case 9985 /* MipMapLinearNearest */: - case 9986 /* MipMapNearestLinear */: - case 9984 /* MipMapNearestNearest */: - return true; - default: - return false; - } - } - setWraps(uWrap, vWrap) { - let gl = this.context.gl; - this.bind(); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap); - } - update(useMipMaps) { - let gl = this.context.gl; - if (!this.texture) - this.texture = this.context.gl.createTexture(); - this.bind(); - if (_GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL) - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); - gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); - if (useMipMaps) - gl.generateMipmap(gl.TEXTURE_2D); - } - restore() { - this.texture = null; - this.update(this.useMipMaps); - } - bind(unit = 0) { - let gl = this.context.gl; - this.boundUnit = unit; - gl.activeTexture(gl.TEXTURE0 + unit); - gl.bindTexture(gl.TEXTURE_2D, this.texture); - } - unbind() { - let gl = this.context.gl; - gl.activeTexture(gl.TEXTURE0 + this.boundUnit); - gl.bindTexture(gl.TEXTURE_2D, null); - } - dispose() { - this.context.removeRestorable(this); - let gl = this.context.gl; - gl.deleteTexture(this.texture); - } - }; - var GLTexture = _GLTexture; - __publicField(GLTexture, "DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL", false); - - // spine-webgl/src/AssetManager.ts - var AssetManager = class extends AssetManagerBase { - constructor(context, pathPrefix = "", downloader = new Downloader()) { - super((image) => { - return new GLTexture(context, image); - }, pathPrefix, downloader); - } - }; - - // spine-webgl/src/Vector3.ts - var Vector3 = class { - x = 0; - y = 0; - z = 0; - constructor(x = 0, y = 0, z = 0) { - this.x = x; - this.y = y; - this.z = z; - } - setFrom(v) { - this.x = v.x; - this.y = v.y; - this.z = v.z; - return this; - } - set(x, y, z) { - this.x = x; - this.y = y; - this.z = z; - return this; - } - add(v) { - this.x += v.x; - this.y += v.y; - this.z += v.z; - return this; - } - sub(v) { - this.x -= v.x; - this.y -= v.y; - this.z -= v.z; - return this; - } - scale(s) { - this.x *= s; - this.y *= s; - this.z *= s; - return this; - } - normalize() { - let len = this.length(); - if (len == 0) - return this; - len = 1 / len; - this.x *= len; - this.y *= len; - this.z *= len; - return this; - } - cross(v) { - return this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x); - } - multiply(matrix) { - let l_mat = matrix.values; - return this.set( - this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03], - this.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13], - this.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23] - ); - } - project(matrix) { - let l_mat = matrix.values; - let l_w = 1 / (this.x * l_mat[M30] + this.y * l_mat[M31] + this.z * l_mat[M32] + l_mat[M33]); - return this.set( - (this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03]) * l_w, - (this.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13]) * l_w, - (this.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23]) * l_w - ); - } - dot(v) { - return this.x * v.x + this.y * v.y + this.z * v.z; - } - length() { - return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z); - } - distance(v) { - let a = v.x - this.x; - let b = v.y - this.y; - let c = v.z - this.z; - return Math.sqrt(a * a + b * b + c * c); - } - }; - - // spine-webgl/src/Matrix4.ts - var M00 = 0; - var M01 = 4; - var M02 = 8; - var M03 = 12; - var M10 = 1; - var M11 = 5; - var M12 = 9; - var M13 = 13; - var M20 = 2; - var M21 = 6; - var M22 = 10; - var M23 = 14; - var M30 = 3; - var M31 = 7; - var M32 = 11; - var M33 = 15; - var _Matrix4 = class { - temp = new Float32Array(16); - values = new Float32Array(16); - constructor() { - let v = this.values; - v[M00] = 1; - v[M11] = 1; - v[M22] = 1; - v[M33] = 1; - } - set(values) { - this.values.set(values); - return this; - } - transpose() { - let t = this.temp; - let v = this.values; - t[M00] = v[M00]; - t[M01] = v[M10]; - t[M02] = v[M20]; - t[M03] = v[M30]; - t[M10] = v[M01]; - t[M11] = v[M11]; - t[M12] = v[M21]; - t[M13] = v[M31]; - t[M20] = v[M02]; - t[M21] = v[M12]; - t[M22] = v[M22]; - t[M23] = v[M32]; - t[M30] = v[M03]; - t[M31] = v[M13]; - t[M32] = v[M23]; - t[M33] = v[M33]; - return this.set(t); - } - identity() { - let v = this.values; - v[M00] = 1; - v[M01] = 0; - v[M02] = 0; - v[M03] = 0; - v[M10] = 0; - v[M11] = 1; - v[M12] = 0; - v[M13] = 0; - v[M20] = 0; - v[M21] = 0; - v[M22] = 1; - v[M23] = 0; - v[M30] = 0; - v[M31] = 0; - v[M32] = 0; - v[M33] = 1; - return this; - } - invert() { - let v = this.values; - let t = this.temp; - let l_det = v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03] + v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03] - v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13] - v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13] + v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23] + v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23] - v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33] - v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33]; - if (l_det == 0) - throw new Error("non-invertible matrix"); - let inv_det = 1 / l_det; - t[M00] = v[M12] * v[M23] * v[M31] - v[M13] * v[M22] * v[M31] + v[M13] * v[M21] * v[M32] - v[M11] * v[M23] * v[M32] - v[M12] * v[M21] * v[M33] + v[M11] * v[M22] * v[M33]; - t[M01] = v[M03] * v[M22] * v[M31] - v[M02] * v[M23] * v[M31] - v[M03] * v[M21] * v[M32] + v[M01] * v[M23] * v[M32] + v[M02] * v[M21] * v[M33] - v[M01] * v[M22] * v[M33]; - t[M02] = v[M02] * v[M13] * v[M31] - v[M03] * v[M12] * v[M31] + v[M03] * v[M11] * v[M32] - v[M01] * v[M13] * v[M32] - v[M02] * v[M11] * v[M33] + v[M01] * v[M12] * v[M33]; - t[M03] = v[M03] * v[M12] * v[M21] - v[M02] * v[M13] * v[M21] - v[M03] * v[M11] * v[M22] + v[M01] * v[M13] * v[M22] + v[M02] * v[M11] * v[M23] - v[M01] * v[M12] * v[M23]; - t[M10] = v[M13] * v[M22] * v[M30] - v[M12] * v[M23] * v[M30] - v[M13] * v[M20] * v[M32] + v[M10] * v[M23] * v[M32] + v[M12] * v[M20] * v[M33] - v[M10] * v[M22] * v[M33]; - t[M11] = v[M02] * v[M23] * v[M30] - v[M03] * v[M22] * v[M30] + v[M03] * v[M20] * v[M32] - v[M00] * v[M23] * v[M32] - v[M02] * v[M20] * v[M33] + v[M00] * v[M22] * v[M33]; - t[M12] = v[M03] * v[M12] * v[M30] - v[M02] * v[M13] * v[M30] - v[M03] * v[M10] * v[M32] + v[M00] * v[M13] * v[M32] + v[M02] * v[M10] * v[M33] - v[M00] * v[M12] * v[M33]; - t[M13] = v[M02] * v[M13] * v[M20] - v[M03] * v[M12] * v[M20] + v[M03] * v[M10] * v[M22] - v[M00] * v[M13] * v[M22] - v[M02] * v[M10] * v[M23] + v[M00] * v[M12] * v[M23]; - t[M20] = v[M11] * v[M23] * v[M30] - v[M13] * v[M21] * v[M30] + v[M13] * v[M20] * v[M31] - v[M10] * v[M23] * v[M31] - v[M11] * v[M20] * v[M33] + v[M10] * v[M21] * v[M33]; - t[M21] = v[M03] * v[M21] * v[M30] - v[M01] * v[M23] * v[M30] - v[M03] * v[M20] * v[M31] + v[M00] * v[M23] * v[M31] + v[M01] * v[M20] * v[M33] - v[M00] * v[M21] * v[M33]; - t[M22] = v[M01] * v[M13] * v[M30] - v[M03] * v[M11] * v[M30] + v[M03] * v[M10] * v[M31] - v[M00] * v[M13] * v[M31] - v[M01] * v[M10] * v[M33] + v[M00] * v[M11] * v[M33]; - t[M23] = v[M03] * v[M11] * v[M20] - v[M01] * v[M13] * v[M20] - v[M03] * v[M10] * v[M21] + v[M00] * v[M13] * v[M21] + v[M01] * v[M10] * v[M23] - v[M00] * v[M11] * v[M23]; - t[M30] = v[M12] * v[M21] * v[M30] - v[M11] * v[M22] * v[M30] - v[M12] * v[M20] * v[M31] + v[M10] * v[M22] * v[M31] + v[M11] * v[M20] * v[M32] - v[M10] * v[M21] * v[M32]; - t[M31] = v[M01] * v[M22] * v[M30] - v[M02] * v[M21] * v[M30] + v[M02] * v[M20] * v[M31] - v[M00] * v[M22] * v[M31] - v[M01] * v[M20] * v[M32] + v[M00] * v[M21] * v[M32]; - t[M32] = v[M02] * v[M11] * v[M30] - v[M01] * v[M12] * v[M30] - v[M02] * v[M10] * v[M31] + v[M00] * v[M12] * v[M31] + v[M01] * v[M10] * v[M32] - v[M00] * v[M11] * v[M32]; - t[M33] = v[M01] * v[M12] * v[M20] - v[M02] * v[M11] * v[M20] + v[M02] * v[M10] * v[M21] - v[M00] * v[M12] * v[M21] - v[M01] * v[M10] * v[M22] + v[M00] * v[M11] * v[M22]; - v[M00] = t[M00] * inv_det; - v[M01] = t[M01] * inv_det; - v[M02] = t[M02] * inv_det; - v[M03] = t[M03] * inv_det; - v[M10] = t[M10] * inv_det; - v[M11] = t[M11] * inv_det; - v[M12] = t[M12] * inv_det; - v[M13] = t[M13] * inv_det; - v[M20] = t[M20] * inv_det; - v[M21] = t[M21] * inv_det; - v[M22] = t[M22] * inv_det; - v[M23] = t[M23] * inv_det; - v[M30] = t[M30] * inv_det; - v[M31] = t[M31] * inv_det; - v[M32] = t[M32] * inv_det; - v[M33] = t[M33] * inv_det; - return this; - } - determinant() { - let v = this.values; - return v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03] + v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03] - v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13] - v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13] + v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23] + v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23] - v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33] - v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33]; - } - translate(x, y, z) { - let v = this.values; - v[M03] += x; - v[M13] += y; - v[M23] += z; - return this; - } - copy() { - return new _Matrix4().set(this.values); - } - projection(near, far, fovy, aspectRatio) { - this.identity(); - let l_fd = 1 / Math.tan(fovy * (Math.PI / 180) / 2); - let l_a1 = (far + near) / (near - far); - let l_a2 = 2 * far * near / (near - far); - let v = this.values; - v[M00] = l_fd / aspectRatio; - v[M10] = 0; - v[M20] = 0; - v[M30] = 0; - v[M01] = 0; - v[M11] = l_fd; - v[M21] = 0; - v[M31] = 0; - v[M02] = 0; - v[M12] = 0; - v[M22] = l_a1; - v[M32] = -1; - v[M03] = 0; - v[M13] = 0; - v[M23] = l_a2; - v[M33] = 0; - return this; - } - ortho2d(x, y, width, height) { - return this.ortho(x, x + width, y, y + height, 0, 1); - } - ortho(left, right, bottom, top, near, far) { - this.identity(); - let x_orth = 2 / (right - left); - let y_orth = 2 / (top - bottom); - let z_orth = -2 / (far - near); - let tx = -(right + left) / (right - left); - let ty = -(top + bottom) / (top - bottom); - let tz = -(far + near) / (far - near); - let v = this.values; - v[M00] = x_orth; - v[M10] = 0; - v[M20] = 0; - v[M30] = 0; - v[M01] = 0; - v[M11] = y_orth; - v[M21] = 0; - v[M31] = 0; - v[M02] = 0; - v[M12] = 0; - v[M22] = z_orth; - v[M32] = 0; - v[M03] = tx; - v[M13] = ty; - v[M23] = tz; - v[M33] = 1; - return this; - } - multiply(matrix) { - let t = this.temp; - let v = this.values; - let m = matrix.values; - t[M00] = v[M00] * m[M00] + v[M01] * m[M10] + v[M02] * m[M20] + v[M03] * m[M30]; - t[M01] = v[M00] * m[M01] + v[M01] * m[M11] + v[M02] * m[M21] + v[M03] * m[M31]; - t[M02] = v[M00] * m[M02] + v[M01] * m[M12] + v[M02] * m[M22] + v[M03] * m[M32]; - t[M03] = v[M00] * m[M03] + v[M01] * m[M13] + v[M02] * m[M23] + v[M03] * m[M33]; - t[M10] = v[M10] * m[M00] + v[M11] * m[M10] + v[M12] * m[M20] + v[M13] * m[M30]; - t[M11] = v[M10] * m[M01] + v[M11] * m[M11] + v[M12] * m[M21] + v[M13] * m[M31]; - t[M12] = v[M10] * m[M02] + v[M11] * m[M12] + v[M12] * m[M22] + v[M13] * m[M32]; - t[M13] = v[M10] * m[M03] + v[M11] * m[M13] + v[M12] * m[M23] + v[M13] * m[M33]; - t[M20] = v[M20] * m[M00] + v[M21] * m[M10] + v[M22] * m[M20] + v[M23] * m[M30]; - t[M21] = v[M20] * m[M01] + v[M21] * m[M11] + v[M22] * m[M21] + v[M23] * m[M31]; - t[M22] = v[M20] * m[M02] + v[M21] * m[M12] + v[M22] * m[M22] + v[M23] * m[M32]; - t[M23] = v[M20] * m[M03] + v[M21] * m[M13] + v[M22] * m[M23] + v[M23] * m[M33]; - t[M30] = v[M30] * m[M00] + v[M31] * m[M10] + v[M32] * m[M20] + v[M33] * m[M30]; - t[M31] = v[M30] * m[M01] + v[M31] * m[M11] + v[M32] * m[M21] + v[M33] * m[M31]; - t[M32] = v[M30] * m[M02] + v[M31] * m[M12] + v[M32] * m[M22] + v[M33] * m[M32]; - t[M33] = v[M30] * m[M03] + v[M31] * m[M13] + v[M32] * m[M23] + v[M33] * m[M33]; - return this.set(this.temp); - } - multiplyLeft(matrix) { - let t = this.temp; - let v = this.values; - let m = matrix.values; - t[M00] = m[M00] * v[M00] + m[M01] * v[M10] + m[M02] * v[M20] + m[M03] * v[M30]; - t[M01] = m[M00] * v[M01] + m[M01] * v[M11] + m[M02] * v[M21] + m[M03] * v[M31]; - t[M02] = m[M00] * v[M02] + m[M01] * v[M12] + m[M02] * v[M22] + m[M03] * v[M32]; - t[M03] = m[M00] * v[M03] + m[M01] * v[M13] + m[M02] * v[M23] + m[M03] * v[M33]; - t[M10] = m[M10] * v[M00] + m[M11] * v[M10] + m[M12] * v[M20] + m[M13] * v[M30]; - t[M11] = m[M10] * v[M01] + m[M11] * v[M11] + m[M12] * v[M21] + m[M13] * v[M31]; - t[M12] = m[M10] * v[M02] + m[M11] * v[M12] + m[M12] * v[M22] + m[M13] * v[M32]; - t[M13] = m[M10] * v[M03] + m[M11] * v[M13] + m[M12] * v[M23] + m[M13] * v[M33]; - t[M20] = m[M20] * v[M00] + m[M21] * v[M10] + m[M22] * v[M20] + m[M23] * v[M30]; - t[M21] = m[M20] * v[M01] + m[M21] * v[M11] + m[M22] * v[M21] + m[M23] * v[M31]; - t[M22] = m[M20] * v[M02] + m[M21] * v[M12] + m[M22] * v[M22] + m[M23] * v[M32]; - t[M23] = m[M20] * v[M03] + m[M21] * v[M13] + m[M22] * v[M23] + m[M23] * v[M33]; - t[M30] = m[M30] * v[M00] + m[M31] * v[M10] + m[M32] * v[M20] + m[M33] * v[M30]; - t[M31] = m[M30] * v[M01] + m[M31] * v[M11] + m[M32] * v[M21] + m[M33] * v[M31]; - t[M32] = m[M30] * v[M02] + m[M31] * v[M12] + m[M32] * v[M22] + m[M33] * v[M32]; - t[M33] = m[M30] * v[M03] + m[M31] * v[M13] + m[M32] * v[M23] + m[M33] * v[M33]; - return this.set(this.temp); - } - lookAt(position, direction, up) { - let xAxis = _Matrix4.xAxis, yAxis = _Matrix4.yAxis, zAxis = _Matrix4.zAxis; - zAxis.setFrom(direction).normalize(); - xAxis.setFrom(direction).normalize(); - xAxis.cross(up).normalize(); - yAxis.setFrom(xAxis).cross(zAxis).normalize(); - this.identity(); - let val = this.values; - val[M00] = xAxis.x; - val[M01] = xAxis.y; - val[M02] = xAxis.z; - val[M10] = yAxis.x; - val[M11] = yAxis.y; - val[M12] = yAxis.z; - val[M20] = -zAxis.x; - val[M21] = -zAxis.y; - val[M22] = -zAxis.z; - _Matrix4.tmpMatrix.identity(); - _Matrix4.tmpMatrix.values[M03] = -position.x; - _Matrix4.tmpMatrix.values[M13] = -position.y; - _Matrix4.tmpMatrix.values[M23] = -position.z; - this.multiply(_Matrix4.tmpMatrix); - return this; - } - }; - var Matrix42 = _Matrix4; - __publicField(Matrix42, "xAxis", new Vector3()); - __publicField(Matrix42, "yAxis", new Vector3()); - __publicField(Matrix42, "zAxis", new Vector3()); - __publicField(Matrix42, "tmpMatrix", new _Matrix4()); - - // spine-webgl/src/Camera.ts - var OrthoCamera = class { - position = new Vector3(0, 0, 0); - direction = new Vector3(0, 0, -1); - up = new Vector3(0, 1, 0); - near = 0; - far = 100; - zoom = 1; - viewportWidth = 0; - viewportHeight = 0; - projectionView = new Matrix42(); - inverseProjectionView = new Matrix42(); - projection = new Matrix42(); - view = new Matrix42(); - constructor(viewportWidth, viewportHeight) { - this.viewportWidth = viewportWidth; - this.viewportHeight = viewportHeight; - this.update(); - } - update() { - let projection = this.projection; - let view = this.view; - let projectionView = this.projectionView; - let inverseProjectionView = this.inverseProjectionView; - let zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight; - projection.ortho( - zoom * (-viewportWidth / 2), - zoom * (viewportWidth / 2), - zoom * (-viewportHeight / 2), - zoom * (viewportHeight / 2), - this.near, - this.far - ); - view.lookAt(this.position, this.direction, this.up); - projectionView.set(projection.values); - projectionView.multiply(view); - inverseProjectionView.set(projectionView.values).invert(); - } - screenToWorld(screenCoords, screenWidth, screenHeight) { - let x = screenCoords.x, y = screenHeight - screenCoords.y - 1; - screenCoords.x = 2 * x / screenWidth - 1; - screenCoords.y = 2 * y / screenHeight - 1; - screenCoords.z = 2 * screenCoords.z - 1; - screenCoords.project(this.inverseProjectionView); - return screenCoords; - } - worldToScreen(worldCoords, screenWidth, screenHeight) { - worldCoords.project(this.projectionView); - worldCoords.x = screenWidth * (worldCoords.x + 1) / 2; - worldCoords.y = screenHeight * (worldCoords.y + 1) / 2; - worldCoords.z = (worldCoords.z + 1) / 2; - return worldCoords; - } - setViewport(viewportWidth, viewportHeight) { - this.viewportWidth = viewportWidth; - this.viewportHeight = viewportHeight; - } - }; - - // spine-webgl/src/Input.ts - var Input = class { - element; - mouseX = 0; - mouseY = 0; - buttonDown = false; - touch0 = null; - touch1 = null; - initialPinchDistance = 0; - listeners = new Array(); - eventListeners = []; - constructor(element) { - this.element = element; - this.setupCallbacks(element); - } - setupCallbacks(element) { - let mouseDown = (ev) => { - if (ev instanceof MouseEvent) { - let rect = element.getBoundingClientRect(); - this.mouseX = ev.clientX - rect.left; - ; - this.mouseY = ev.clientY - rect.top; - this.buttonDown = true; - this.listeners.map((listener) => { - if (listener.down) - listener.down(this.mouseX, this.mouseY); - }); - document.addEventListener("mousemove", mouseMove); - document.addEventListener("mouseup", mouseUp); - } - }; - let mouseMove = (ev) => { - if (ev instanceof MouseEvent) { - let rect = element.getBoundingClientRect(); - this.mouseX = ev.clientX - rect.left; - ; - this.mouseY = ev.clientY - rect.top; - this.listeners.map((listener) => { - if (this.buttonDown) { - if (listener.dragged) - listener.dragged(this.mouseX, this.mouseY); - } else { - if (listener.moved) - listener.moved(this.mouseX, this.mouseY); - } - }); - } - }; - let mouseUp = (ev) => { - if (ev instanceof MouseEvent) { - let rect = element.getBoundingClientRect(); - this.mouseX = ev.clientX - rect.left; - ; - this.mouseY = ev.clientY - rect.top; - this.buttonDown = false; - this.listeners.map((listener) => { - if (listener.up) - listener.up(this.mouseX, this.mouseY); - }); - document.removeEventListener("mousemove", mouseMove); - document.removeEventListener("mouseup", mouseUp); - } - }; - let mouseWheel = (e) => { - e.preventDefault(); - let deltaY = e.deltaY; - if (e.deltaMode == WheelEvent.DOM_DELTA_LINE) - deltaY *= 8; - if (e.deltaMode == WheelEvent.DOM_DELTA_PAGE) - deltaY *= 24; - this.listeners.map((listener) => { - if (listener.wheel) - listener.wheel(e.deltaY); - }); - }; - element.addEventListener("mousedown", mouseDown, true); - element.addEventListener("mousemove", mouseMove, true); - element.addEventListener("mouseup", mouseUp, true); - element.addEventListener("wheel", mouseWheel, true); - element.addEventListener("touchstart", (ev) => { - if (!this.touch0 || !this.touch1) { - var touches = ev.changedTouches; - let nativeTouch = touches.item(0); - if (!nativeTouch) - return; - let rect = element.getBoundingClientRect(); - let x = nativeTouch.clientX - rect.left; - let y = nativeTouch.clientY - rect.top; - let touch = new Touch(nativeTouch.identifier, x, y); - this.mouseX = x; - this.mouseY = y; - this.buttonDown = true; - if (!this.touch0) { - this.touch0 = touch; - this.listeners.map((listener) => { - if (listener.down) - listener.down(touch.x, touch.y); - }); - } else if (!this.touch1) { - this.touch1 = touch; - let dx = this.touch1.x - this.touch0.x; - let dy = this.touch1.x - this.touch0.x; - this.initialPinchDistance = Math.sqrt(dx * dx + dy * dy); - this.listeners.map((listener) => { - if (listener.zoom) - listener.zoom(this.initialPinchDistance, this.initialPinchDistance); - }); - } - } - ev.preventDefault(); - }, false); - element.addEventListener("touchmove", (ev) => { - if (this.touch0) { - var touches = ev.changedTouches; - let rect = element.getBoundingClientRect(); - for (var i = 0; i < touches.length; i++) { - var nativeTouch = touches[i]; - let x = nativeTouch.clientX - rect.left; - let y = nativeTouch.clientY - rect.top; - if (this.touch0.identifier === nativeTouch.identifier) { - this.touch0.x = this.mouseX = x; - this.touch0.y = this.mouseY = y; - this.listeners.map((listener) => { - if (listener.dragged) - listener.dragged(x, y); - }); - } - if (this.touch1 && this.touch1.identifier === nativeTouch.identifier) { - this.touch1.x = this.mouseX = x; - this.touch1.y = this.mouseY = y; - } - } - if (this.touch0 && this.touch1) { - let dx = this.touch1.x - this.touch0.x; - let dy = this.touch1.x - this.touch0.x; - let distance = Math.sqrt(dx * dx + dy * dy); - this.listeners.map((listener) => { - if (listener.zoom) - listener.zoom(this.initialPinchDistance, distance); - }); - } - } - ev.preventDefault(); - }, false); - let touchEnd = (ev) => { - if (this.touch0) { - var touches = ev.changedTouches; - let rect = element.getBoundingClientRect(); - for (var i = 0; i < touches.length; i++) { - var nativeTouch = touches[i]; - let x = nativeTouch.clientX - rect.left; - let y = nativeTouch.clientY - rect.top; - if (this.touch0.identifier === nativeTouch.identifier) { - this.touch0 = null; - this.mouseX = x; - this.mouseY = y; - this.listeners.map((listener) => { - if (listener.up) - listener.up(x, y); - }); - if (!this.touch1) { - this.buttonDown = false; - break; - } else { - this.touch0 = this.touch1; - this.touch1 = null; - this.mouseX = this.touch0.x; - this.mouseX = this.touch0.x; - this.buttonDown = true; - this.listeners.map((listener) => { - if (listener.down) - listener.down(this.touch0.x, this.touch0.y); - }); - } - } - if (this.touch1 && this.touch1.identifier) { - this.touch1 = null; - } - } - } - ev.preventDefault(); - }; - element.addEventListener("touchend", touchEnd, false); - element.addEventListener("touchcancel", touchEnd); - } - addListener(listener) { - this.listeners.push(listener); - } - removeListener(listener) { - let idx = this.listeners.indexOf(listener); - if (idx > -1) { - this.listeners.splice(idx, 1); - } - } - }; - var Touch = class { - constructor(identifier, x, y) { - this.identifier = identifier; - this.x = x; - this.y = y; - } - }; - - // spine-webgl/src/CameraController.ts - var CameraController = class { - constructor(canvas, camera) { - this.canvas = canvas; - this.camera = camera; - let cameraX = 0, cameraY = 0, cameraZoom = 0; - let mouseX = 0, mouseY = 0; - let lastX = 0, lastY = 0; - let initialZoom = 0; - new Input(canvas).addListener({ - down: (x, y) => { - cameraX = camera.position.x; - cameraY = camera.position.y; - mouseX = lastX = x; - mouseY = lastY = y; - initialZoom = camera.zoom; - }, - dragged: (x, y) => { - let deltaX = x - mouseX; - let deltaY = y - mouseY; - let originWorld = camera.screenToWorld(new Vector3(0, 0), canvas.clientWidth, canvas.clientHeight); - let deltaWorld = camera.screenToWorld(new Vector3(deltaX, deltaY), canvas.clientWidth, canvas.clientHeight).sub(originWorld); - camera.position.set(cameraX - deltaWorld.x, cameraY - deltaWorld.y, 0); - camera.update(); - lastX = x; - lastY = y; - }, - wheel: (delta) => { - let zoomAmount = delta / 200 * camera.zoom; - let newZoom = camera.zoom + zoomAmount; - if (newZoom > 0) { - let x = 0, y = 0; - if (delta < 0) { - x = lastX; - y = lastY; - } else { - let viewCenter = new Vector3(canvas.clientWidth / 2 + 15, canvas.clientHeight / 2); - let mouseToCenterX = lastX - viewCenter.x; - let mouseToCenterY = canvas.clientHeight - 1 - lastY - viewCenter.y; - x = viewCenter.x - mouseToCenterX; - y = canvas.clientHeight - 1 - viewCenter.y + mouseToCenterY; - } - let oldDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight); - camera.zoom = newZoom; - camera.update(); - let newDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight); - camera.position.add(oldDistance.sub(newDistance)); - camera.update(); - } - }, - zoom: (initialDistance, distance) => { - let newZoom = initialDistance / distance; - camera.zoom = initialZoom * newZoom; - }, - up: (x, y) => { - lastX = x; - lastY = y; - }, - moved: (x, y) => { - lastX = x; - lastY = y; - } - }); - } - }; - - // spine-webgl/src/Shader.ts - var _Shader = class { - constructor(context, vertexShader, fragmentShader) { - this.vertexShader = vertexShader; - this.fragmentShader = fragmentShader; - this.vsSource = vertexShader; - this.fsSource = fragmentShader; - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.context.addRestorable(this); - this.compile(); - } - context; - vs = null; - vsSource; - fs = null; - fsSource; - program = null; - tmp2x2 = new Float32Array(2 * 2); - tmp3x3 = new Float32Array(3 * 3); - tmp4x4 = new Float32Array(4 * 4); - getProgram() { - return this.program; - } - getVertexShader() { - return this.vertexShader; - } - getFragmentShader() { - return this.fragmentShader; - } - getVertexShaderSource() { - return this.vsSource; - } - getFragmentSource() { - return this.fsSource; - } - compile() { - let gl = this.context.gl; - try { - this.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader); - if (!this.vs) - throw new Error("Couldn't compile vertex shader."); - this.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader); - if (!this.fs) - throw new Error("Couldn#t compile fragment shader."); - this.program = this.compileProgram(this.vs, this.fs); - } catch (e) { - this.dispose(); - throw e; - } - } - compileShader(type, source) { - let gl = this.context.gl; - let shader = gl.createShader(type); - if (!shader) - throw new Error("Couldn't create shader."); - gl.shaderSource(shader, source); - gl.compileShader(shader); - if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) { - let error = "Couldn't compile shader: " + gl.getShaderInfoLog(shader); - gl.deleteShader(shader); - if (!gl.isContextLost()) - throw new Error(error); - } - return shader; - } - compileProgram(vs, fs) { - let gl = this.context.gl; - let program = gl.createProgram(); - if (!program) - throw new Error("Couldn't compile program."); - gl.attachShader(program, vs); - gl.attachShader(program, fs); - gl.linkProgram(program); - if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { - let error = "Couldn't compile shader program: " + gl.getProgramInfoLog(program); - gl.deleteProgram(program); - if (!gl.isContextLost()) - throw new Error(error); - } - return program; - } - restore() { - this.compile(); - } - bind() { - this.context.gl.useProgram(this.program); - } - unbind() { - this.context.gl.useProgram(null); - } - setUniformi(uniform, value) { - this.context.gl.uniform1i(this.getUniformLocation(uniform), value); - } - setUniformf(uniform, value) { - this.context.gl.uniform1f(this.getUniformLocation(uniform), value); - } - setUniform2f(uniform, value, value2) { - this.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2); - } - setUniform3f(uniform, value, value2, value3) { - this.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3); - } - setUniform4f(uniform, value, value2, value3, value4) { - this.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4); - } - setUniform2x2f(uniform, value) { - let gl = this.context.gl; - this.tmp2x2.set(value); - gl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2); - } - setUniform3x3f(uniform, value) { - let gl = this.context.gl; - this.tmp3x3.set(value); - gl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3); - } - setUniform4x4f(uniform, value) { - let gl = this.context.gl; - this.tmp4x4.set(value); - gl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4); - } - getUniformLocation(uniform) { - let gl = this.context.gl; - if (!this.program) - throw new Error("Shader not compiled."); - let location = gl.getUniformLocation(this.program, uniform); - if (!location && !gl.isContextLost()) - throw new Error(`Couldn't find location for uniform ${uniform}`); - return location; - } - getAttributeLocation(attribute) { - let gl = this.context.gl; - if (!this.program) - throw new Error("Shader not compiled."); - let location = gl.getAttribLocation(this.program, attribute); - if (location == -1 && !gl.isContextLost()) - throw new Error(`Couldn't find location for attribute ${attribute}`); - return location; - } - dispose() { - this.context.removeRestorable(this); - let gl = this.context.gl; - if (this.vs) { - gl.deleteShader(this.vs); - this.vs = null; - } - if (this.fs) { - gl.deleteShader(this.fs); - this.fs = null; - } - if (this.program) { - gl.deleteProgram(this.program); - this.program = null; - } - } - static newColoredTextured(context) { - let vs = ` -attribute vec4 ${_Shader.POSITION}; -attribute vec4 ${_Shader.COLOR}; -attribute vec2 ${_Shader.TEXCOORDS}; -uniform mat4 ${_Shader.MVP_MATRIX}; -varying vec4 v_color; -varying vec2 v_texCoords; - -void main () { - v_color = ${_Shader.COLOR}; - v_texCoords = ${_Shader.TEXCOORDS}; - gl_Position = ${_Shader.MVP_MATRIX} * ${_Shader.POSITION}; -} -`; - let fs = ` -#ifdef GL_ES - #define LOWP lowp - precision mediump float; -#else - #define LOWP -#endif -varying LOWP vec4 v_color; -varying vec2 v_texCoords; -uniform sampler2D u_texture; - -void main () { - gl_FragColor = v_color * texture2D(u_texture, v_texCoords); -} -`; - return new _Shader(context, vs, fs); - } - static newTwoColoredTextured(context) { - let vs = ` -attribute vec4 ${_Shader.POSITION}; -attribute vec4 ${_Shader.COLOR}; -attribute vec4 ${_Shader.COLOR2}; -attribute vec2 ${_Shader.TEXCOORDS}; -uniform mat4 ${_Shader.MVP_MATRIX}; -varying vec4 v_light; -varying vec4 v_dark; -varying vec2 v_texCoords; - -void main () { - v_light = ${_Shader.COLOR}; - v_dark = ${_Shader.COLOR2}; - v_texCoords = ${_Shader.TEXCOORDS}; - gl_Position = ${_Shader.MVP_MATRIX} * ${_Shader.POSITION}; -} -`; - let fs = ` -#ifdef GL_ES - #define LOWP lowp - precision mediump float; -#else - #define LOWP -#endif -varying LOWP vec4 v_light; -varying LOWP vec4 v_dark; -varying vec2 v_texCoords; -uniform sampler2D u_texture; - -void main () { - vec4 texColor = texture2D(u_texture, v_texCoords); - gl_FragColor.a = texColor.a * v_light.a; - gl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb; -} -`; - return new _Shader(context, vs, fs); - } - static newColored(context) { - let vs = ` -attribute vec4 ${_Shader.POSITION}; -attribute vec4 ${_Shader.COLOR}; -uniform mat4 ${_Shader.MVP_MATRIX}; -varying vec4 v_color; - -void main () { - v_color = ${_Shader.COLOR}; - gl_Position = ${_Shader.MVP_MATRIX} * ${_Shader.POSITION}; -} -`; - let fs = ` -#ifdef GL_ES - #define LOWP lowp - precision mediump float; -#else - #define LOWP -#endif -varying LOWP vec4 v_color; - -void main () { - gl_FragColor = v_color; -} -`; - return new _Shader(context, vs, fs); - } - }; - var Shader = _Shader; - __publicField(Shader, "MVP_MATRIX", "u_projTrans"); - __publicField(Shader, "POSITION", "a_position"); - __publicField(Shader, "COLOR", "a_color"); - __publicField(Shader, "COLOR2", "a_color2"); - __publicField(Shader, "TEXCOORDS", "a_texCoords"); - __publicField(Shader, "SAMPLER", "u_texture"); - - // spine-webgl/src/Mesh.ts - var Mesh = class { - constructor(context, attributes, maxVertices, maxIndices) { - this.attributes = attributes; - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.elementsPerVertex = 0; - for (let i = 0; i < attributes.length; i++) { - this.elementsPerVertex += attributes[i].numElements; - } - this.vertices = new Float32Array(maxVertices * this.elementsPerVertex); - this.indices = new Uint16Array(maxIndices); - this.context.addRestorable(this); - } - context; - vertices; - verticesBuffer = null; - verticesLength = 0; - dirtyVertices = false; - indices; - indicesBuffer = null; - indicesLength = 0; - dirtyIndices = false; - elementsPerVertex = 0; - getAttributes() { - return this.attributes; - } - maxVertices() { - return this.vertices.length / this.elementsPerVertex; - } - numVertices() { - return this.verticesLength / this.elementsPerVertex; - } - setVerticesLength(length) { - this.dirtyVertices = true; - this.verticesLength = length; - } - getVertices() { - return this.vertices; - } - maxIndices() { - return this.indices.length; - } - numIndices() { - return this.indicesLength; - } - setIndicesLength(length) { - this.dirtyIndices = true; - this.indicesLength = length; - } - getIndices() { - return this.indices; - } - getVertexSizeInFloats() { - let size = 0; - for (var i = 0; i < this.attributes.length; i++) { - let attribute = this.attributes[i]; - size += attribute.numElements; - } - return size; - } - setVertices(vertices) { - this.dirtyVertices = true; - if (vertices.length > this.vertices.length) - throw Error("Mesh can't store more than " + this.maxVertices() + " vertices"); - this.vertices.set(vertices, 0); - this.verticesLength = vertices.length; - } - setIndices(indices) { - this.dirtyIndices = true; - if (indices.length > this.indices.length) - throw Error("Mesh can't store more than " + this.maxIndices() + " indices"); - this.indices.set(indices, 0); - this.indicesLength = indices.length; - } - draw(shader, primitiveType) { - this.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex); - } - drawWithOffset(shader, primitiveType, offset, count) { - let gl = this.context.gl; - if (this.dirtyVertices || this.dirtyIndices) - this.update(); - this.bind(shader); - if (this.indicesLength > 0) { - gl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2); - } else { - gl.drawArrays(primitiveType, offset, count); - } - this.unbind(shader); - } - bind(shader) { - let gl = this.context.gl; - gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); - let offset = 0; - for (let i = 0; i < this.attributes.length; i++) { - let attrib = this.attributes[i]; - let location = shader.getAttributeLocation(attrib.name); - gl.enableVertexAttribArray(location); - gl.vertexAttribPointer(location, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4); - offset += attrib.numElements; - } - if (this.indicesLength > 0) - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); - } - unbind(shader) { - let gl = this.context.gl; - for (let i = 0; i < this.attributes.length; i++) { - let attrib = this.attributes[i]; - let location = shader.getAttributeLocation(attrib.name); - gl.disableVertexAttribArray(location); - } - gl.bindBuffer(gl.ARRAY_BUFFER, null); - if (this.indicesLength > 0) - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null); - } - update() { - let gl = this.context.gl; - if (this.dirtyVertices) { - if (!this.verticesBuffer) { - this.verticesBuffer = gl.createBuffer(); - } - gl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer); - gl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW); - this.dirtyVertices = false; - } - if (this.dirtyIndices) { - if (!this.indicesBuffer) { - this.indicesBuffer = gl.createBuffer(); - } - gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer); - gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW); - this.dirtyIndices = false; - } - } - restore() { - this.verticesBuffer = null; - this.indicesBuffer = null; - this.update(); - } - dispose() { - this.context.removeRestorable(this); - let gl = this.context.gl; - gl.deleteBuffer(this.verticesBuffer); - gl.deleteBuffer(this.indicesBuffer); - } - }; - var VertexAttribute = class { - constructor(name, type, numElements) { - this.name = name; - this.type = type; - this.numElements = numElements; - } - }; - var Position2Attribute = class extends VertexAttribute { - constructor() { - super(Shader.POSITION, VertexAttributeType.Float, 2); - } - }; - var Position3Attribute = class extends VertexAttribute { - constructor() { - super(Shader.POSITION, VertexAttributeType.Float, 3); - } - }; - var TexCoordAttribute = class extends VertexAttribute { - constructor(unit = 0) { - super(Shader.TEXCOORDS + (unit == 0 ? "" : unit), VertexAttributeType.Float, 2); - } - }; - var ColorAttribute = class extends VertexAttribute { - constructor() { - super(Shader.COLOR, VertexAttributeType.Float, 4); - } - }; - var Color2Attribute = class extends VertexAttribute { - constructor() { - super(Shader.COLOR2, VertexAttributeType.Float, 4); - } - }; - var VertexAttributeType = /* @__PURE__ */ ((VertexAttributeType2) => { - VertexAttributeType2[VertexAttributeType2["Float"] = 0] = "Float"; - return VertexAttributeType2; - })(VertexAttributeType || {}); - - // spine-webgl/src/PolygonBatcher.ts - var GL_ONE = 1; - var GL_ONE_MINUS_SRC_COLOR = 769; - var GL_SRC_ALPHA = 770; - var GL_ONE_MINUS_SRC_ALPHA = 771; - var GL_DST_COLOR = 774; - var _PolygonBatcher = class { - context; - drawCalls = 0; - isDrawing = false; - mesh; - shader = null; - lastTexture = null; - verticesLength = 0; - indicesLength = 0; - srcColorBlend; - srcAlphaBlend; - dstBlend; - cullWasEnabled = false; - constructor(context, twoColorTint = true, maxVertices = 10920) { - if (maxVertices > 10920) - throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - let attributes = twoColorTint ? [new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute(), new Color2Attribute()] : [new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute()]; - this.mesh = new Mesh(context, attributes, maxVertices, maxVertices * 3); - let gl = this.context.gl; - this.srcColorBlend = gl.SRC_ALPHA; - this.srcAlphaBlend = gl.ONE; - this.dstBlend = gl.ONE_MINUS_SRC_ALPHA; - } - begin(shader) { - if (this.isDrawing) - throw new Error("PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()"); - this.drawCalls = 0; - this.shader = shader; - this.lastTexture = null; - this.isDrawing = true; - let gl = this.context.gl; - gl.enable(gl.BLEND); - gl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend); - if (_PolygonBatcher.disableCulling) { - this.cullWasEnabled = gl.isEnabled(gl.CULL_FACE); - if (this.cullWasEnabled) - gl.disable(gl.CULL_FACE); - } - } - setBlendMode(blendMode, premultipliedAlpha) { - const blendModeGL = _PolygonBatcher.blendModesGL[blendMode]; - const srcColorBlend = premultipliedAlpha ? blendModeGL.srcRgbPma : blendModeGL.srcRgb; - const srcAlphaBlend = blendModeGL.srcAlpha; - const dstBlend = blendModeGL.dstRgb; - if (this.srcColorBlend == srcColorBlend && this.srcAlphaBlend == srcAlphaBlend && this.dstBlend == dstBlend) - return; - this.srcColorBlend = srcColorBlend; - this.srcAlphaBlend = srcAlphaBlend; - this.dstBlend = dstBlend; - if (this.isDrawing) { - this.flush(); - } - let gl = this.context.gl; - gl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend); - } - draw(texture, vertices, indices) { - if (texture != this.lastTexture) { - this.flush(); - this.lastTexture = texture; - } else if (this.verticesLength + vertices.length > this.mesh.getVertices().length || this.indicesLength + indices.length > this.mesh.getIndices().length) { - this.flush(); - } - let indexStart = this.mesh.numVertices(); - this.mesh.getVertices().set(vertices, this.verticesLength); - this.verticesLength += vertices.length; - this.mesh.setVerticesLength(this.verticesLength); - let indicesArray = this.mesh.getIndices(); - for (let i = this.indicesLength, j = 0; j < indices.length; i++, j++) - indicesArray[i] = indices[j] + indexStart; - this.indicesLength += indices.length; - this.mesh.setIndicesLength(this.indicesLength); - } - flush() { - if (this.verticesLength == 0) - return; - if (!this.lastTexture) - throw new Error("No texture set."); - if (!this.shader) - throw new Error("No shader set."); - this.lastTexture.bind(); - this.mesh.draw(this.shader, this.context.gl.TRIANGLES); - this.verticesLength = 0; - this.indicesLength = 0; - this.mesh.setVerticesLength(0); - this.mesh.setIndicesLength(0); - this.drawCalls++; - _PolygonBatcher.globalDrawCalls++; - } - end() { - if (!this.isDrawing) - throw new Error("PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()"); - if (this.verticesLength > 0 || this.indicesLength > 0) - this.flush(); - this.shader = null; - this.lastTexture = null; - this.isDrawing = false; - let gl = this.context.gl; - gl.disable(gl.BLEND); - if (_PolygonBatcher.disableCulling) { - if (this.cullWasEnabled) - gl.enable(gl.CULL_FACE); - } - } - getDrawCalls() { - return this.drawCalls; - } - static getAndResetGlobalDrawCalls() { - let result = _PolygonBatcher.globalDrawCalls; - _PolygonBatcher.globalDrawCalls = 0; - return result; - } - dispose() { - this.mesh.dispose(); - } - }; - var PolygonBatcher = _PolygonBatcher; - __publicField(PolygonBatcher, "disableCulling", false); - __publicField(PolygonBatcher, "globalDrawCalls", 0); - __publicField(PolygonBatcher, "blendModesGL", [ - { srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE }, - { srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE, srcAlpha: GL_ONE }, - { srcRgb: GL_DST_COLOR, srcRgbPma: GL_DST_COLOR, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE }, - { srcRgb: GL_ONE, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_COLOR, srcAlpha: GL_ONE } - ]); - - // spine-webgl/src/ShapeRenderer.ts - var ShapeRenderer = class { - context; - isDrawing = false; - mesh; - shapeType = ShapeType.Filled; - color = new Color(1, 1, 1, 1); - shader = null; - vertexIndex = 0; - tmp = new Vector2(); - srcColorBlend; - srcAlphaBlend; - dstBlend; - constructor(context, maxVertices = 10920) { - if (maxVertices > 10920) - throw new Error("Can't have more than 10920 triangles per batch: " + maxVertices); - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.mesh = new Mesh(context, [new Position2Attribute(), new ColorAttribute()], maxVertices, 0); - let gl = this.context.gl; - this.srcColorBlend = gl.SRC_ALPHA; - this.srcAlphaBlend = gl.ONE; - this.dstBlend = gl.ONE_MINUS_SRC_ALPHA; - } - begin(shader) { - if (this.isDrawing) - throw new Error("ShapeRenderer.begin() has already been called"); - this.shader = shader; - this.vertexIndex = 0; - this.isDrawing = true; - let gl = this.context.gl; - gl.enable(gl.BLEND); - gl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend); - } - setBlendMode(srcColorBlend, srcAlphaBlend, dstBlend) { - this.srcColorBlend = srcColorBlend; - this.srcAlphaBlend = srcAlphaBlend; - this.dstBlend = dstBlend; - if (this.isDrawing) { - this.flush(); - let gl = this.context.gl; - gl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend); - } - } - setColor(color) { - this.color.setFromColor(color); - } - setColorWith(r, g, b, a) { - this.color.set(r, g, b, a); - } - point(x, y, color) { - this.check(ShapeType.Point, 1); - if (!color) - color = this.color; - this.vertex(x, y, color); - } - line(x, y, x2, y2, color) { - this.check(ShapeType.Line, 2); - let vertices = this.mesh.getVertices(); - let idx = this.vertexIndex; - if (!color) - color = this.color; - this.vertex(x, y, color); - this.vertex(x2, y2, color); - } - triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3) { - this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); - let vertices = this.mesh.getVertices(); - let idx = this.vertexIndex; - if (!color) - color = this.color; - if (!color2) - color2 = this.color; - if (!color3) - color3 = this.color; - if (filled) { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - } else { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x2, y2, color); - this.vertex(x3, y3, color2); - this.vertex(x3, y3, color); - this.vertex(x, y, color2); - } - } - quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { - this.check(filled ? ShapeType.Filled : ShapeType.Line, 3); - let vertices = this.mesh.getVertices(); - let idx = this.vertexIndex; - if (!color) - color = this.color; - if (!color2) - color2 = this.color; - if (!color3) - color3 = this.color; - if (!color4) - color4 = this.color; - if (filled) { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - this.vertex(x3, y3, color3); - this.vertex(x4, y4, color4); - this.vertex(x, y, color); - } else { - this.vertex(x, y, color); - this.vertex(x2, y2, color2); - this.vertex(x2, y2, color2); - this.vertex(x3, y3, color3); - this.vertex(x3, y3, color3); - this.vertex(x4, y4, color4); - this.vertex(x4, y4, color4); - this.vertex(x, y, color); - } - } - rect(filled, x, y, width, height, color) { - this.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color); - } - rectLine(filled, x1, y1, x2, y2, width, color) { - this.check(filled ? ShapeType.Filled : ShapeType.Line, 8); - if (!color) - color = this.color; - let t = this.tmp.set(y2 - y1, x1 - x2); - t.normalize(); - width *= 0.5; - let tx = t.x * width; - let ty = t.y * width; - if (!filled) { - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x1 - tx, y1 - ty, color); - } else { - this.vertex(x1 + tx, y1 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x2 - tx, y2 - ty, color); - this.vertex(x2 + tx, y2 + ty, color); - this.vertex(x1 - tx, y1 - ty, color); - } - } - x(x, y, size) { - this.line(x - size, y - size, x + size, y + size); - this.line(x - size, y + size, x + size, y - size); - } - polygon(polygonVertices, offset, count, color) { - if (count < 3) - throw new Error("Polygon must contain at least 3 vertices"); - this.check(ShapeType.Line, count * 2); - if (!color) - color = this.color; - let vertices = this.mesh.getVertices(); - let idx = this.vertexIndex; - offset <<= 1; - count <<= 1; - let firstX = polygonVertices[offset]; - let firstY = polygonVertices[offset + 1]; - let last = offset + count; - for (let i = offset, n = offset + count - 2; i < n; i += 2) { - let x1 = polygonVertices[i]; - let y1 = polygonVertices[i + 1]; - let x2 = 0; - let y2 = 0; - if (i + 2 >= last) { - x2 = firstX; - y2 = firstY; - } else { - x2 = polygonVertices[i + 2]; - y2 = polygonVertices[i + 3]; - } - this.vertex(x1, y1, color); - this.vertex(x2, y2, color); - } - } - circle(filled, x, y, radius, color, segments = 0) { - if (segments == 0) - segments = Math.max(1, 6 * MathUtils.cbrt(radius) | 0); - if (segments <= 0) - throw new Error("segments must be > 0."); - if (!color) - color = this.color; - let angle = 2 * MathUtils.PI / segments; - let cos = Math.cos(angle); - let sin = Math.sin(angle); - let cx = radius, cy = 0; - if (!filled) { - this.check(ShapeType.Line, segments * 2 + 2); - for (let i = 0; i < segments; i++) { - this.vertex(x + cx, y + cy, color); - let temp2 = cx; - cx = cos * cx - sin * cy; - cy = sin * temp2 + cos * cy; - this.vertex(x + cx, y + cy, color); - } - this.vertex(x + cx, y + cy, color); - } else { - this.check(ShapeType.Filled, segments * 3 + 3); - segments--; - for (let i = 0; i < segments; i++) { - this.vertex(x, y, color); - this.vertex(x + cx, y + cy, color); - let temp2 = cx; - cx = cos * cx - sin * cy; - cy = sin * temp2 + cos * cy; - this.vertex(x + cx, y + cy, color); - } - this.vertex(x, y, color); - this.vertex(x + cx, y + cy, color); - } - let temp = cx; - cx = radius; - cy = 0; - this.vertex(x + cx, y + cy, color); - } - curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { - this.check(ShapeType.Line, segments * 2 + 2); - if (!color) - color = this.color; - let subdiv_step = 1 / segments; - let subdiv_step2 = subdiv_step * subdiv_step; - let subdiv_step3 = subdiv_step * subdiv_step * subdiv_step; - let pre1 = 3 * subdiv_step; - let pre2 = 3 * subdiv_step2; - let pre4 = 6 * subdiv_step2; - let pre5 = 6 * subdiv_step3; - let tmp1x = x1 - cx1 * 2 + cx2; - let tmp1y = y1 - cy1 * 2 + cy2; - let tmp2x = (cx1 - cx2) * 3 - x1 + x2; - let tmp2y = (cy1 - cy2) * 3 - y1 + y2; - let fx = x1; - let fy = y1; - let dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3; - let dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3; - let ddfx = tmp1x * pre4 + tmp2x * pre5; - let ddfy = tmp1y * pre4 + tmp2y * pre5; - let dddfx = tmp2x * pre5; - let dddfy = tmp2y * pre5; - while (segments-- > 0) { - this.vertex(fx, fy, color); - fx += dfx; - fy += dfy; - dfx += ddfx; - dfy += ddfy; - ddfx += dddfx; - ddfy += dddfy; - this.vertex(fx, fy, color); - } - this.vertex(fx, fy, color); - this.vertex(x2, y2, color); - } - vertex(x, y, color) { - let idx = this.vertexIndex; - let vertices = this.mesh.getVertices(); - vertices[idx++] = x; - vertices[idx++] = y; - vertices[idx++] = color.r; - vertices[idx++] = color.g; - vertices[idx++] = color.b; - vertices[idx++] = color.a; - this.vertexIndex = idx; - } - end() { - if (!this.isDrawing) - throw new Error("ShapeRenderer.begin() has not been called"); - this.flush(); - let gl = this.context.gl; - gl.disable(gl.BLEND); - this.isDrawing = false; - } - flush() { - if (this.vertexIndex == 0) - return; - if (!this.shader) - throw new Error("No shader set."); - this.mesh.setVerticesLength(this.vertexIndex); - this.mesh.draw(this.shader, this.shapeType); - this.vertexIndex = 0; - } - check(shapeType, numVertices) { - if (!this.isDrawing) - throw new Error("ShapeRenderer.begin() has not been called"); - if (this.shapeType == shapeType) { - if (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) - this.flush(); - else - return; - } else { - this.flush(); - this.shapeType = shapeType; - } - } - dispose() { - this.mesh.dispose(); - } - }; - var ShapeType = /* @__PURE__ */ ((ShapeType2) => { - ShapeType2[ShapeType2["Point"] = 0] = "Point"; - ShapeType2[ShapeType2["Line"] = 1] = "Line"; - ShapeType2[ShapeType2["Filled"] = 4] = "Filled"; - return ShapeType2; - })(ShapeType || {}); - - // spine-webgl/src/SkeletonDebugRenderer.ts - var _SkeletonDebugRenderer = class { - boneLineColor = new Color(1, 0, 0, 1); - boneOriginColor = new Color(0, 1, 0, 1); - attachmentLineColor = new Color(0, 0, 1, 0.5); - triangleLineColor = new Color(1, 0.64, 0, 0.5); - pathColor = new Color().setFromString("FF7F00"); - clipColor = new Color(0.8, 0, 0, 2); - aabbColor = new Color(0, 1, 0, 0.5); - drawBones = true; - drawRegionAttachments = true; - drawBoundingBoxes = true; - drawMeshHull = true; - drawMeshTriangles = true; - drawPaths = true; - drawSkeletonXY = false; - drawClipping = true; - premultipliedAlpha = false; - scale = 1; - boneWidth = 2; - context; - bounds = new SkeletonBounds(); - temp = new Array(); - vertices = Utils.newFloatArray(2 * 1024); - constructor(context) { - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - } - draw(shapes, skeleton, ignoredBones) { - let skeletonX = skeleton.x; - let skeletonY = skeleton.y; - let gl = this.context.gl; - let srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA; - shapes.setBlendMode(srcFunc, gl.ONE, gl.ONE_MINUS_SRC_ALPHA); - let bones = skeleton.bones; - if (this.drawBones) { - shapes.setColor(this.boneLineColor); - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) - continue; - if (!bone.parent) - continue; - let x = bone.data.length * bone.a + bone.worldX; - let y = bone.data.length * bone.c + bone.worldY; - shapes.rectLine(true, bone.worldX, bone.worldY, x, y, this.boneWidth * this.scale); - } - if (this.drawSkeletonXY) - shapes.x(skeletonX, skeletonY, 4 * this.scale); - } - if (this.drawRegionAttachments) { - shapes.setColor(this.attachmentLineColor); - let slots = skeleton.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - let attachment = slot.getAttachment(); - if (attachment instanceof RegionAttachment) { - let regionAttachment = attachment; - let vertices = this.vertices; - regionAttachment.computeWorldVertices(slot, vertices, 0, 2); - shapes.line(vertices[0], vertices[1], vertices[2], vertices[3]); - shapes.line(vertices[2], vertices[3], vertices[4], vertices[5]); - shapes.line(vertices[4], vertices[5], vertices[6], vertices[7]); - shapes.line(vertices[6], vertices[7], vertices[0], vertices[1]); - } - } - } - if (this.drawMeshHull || this.drawMeshTriangles) { - let slots = skeleton.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (!slot.bone.active) - continue; - let attachment = slot.getAttachment(); - if (!(attachment instanceof MeshAttachment)) - continue; - let mesh = attachment; - let vertices = this.vertices; - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2); - let triangles = mesh.triangles; - let hullLength = mesh.hullLength; - if (this.drawMeshTriangles) { - shapes.setColor(this.triangleLineColor); - for (let ii = 0, nn = triangles.length; ii < nn; ii += 3) { - let v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2; - shapes.triangle( - false, - vertices[v1], - vertices[v1 + 1], - // - vertices[v2], - vertices[v2 + 1], - // - vertices[v3], - vertices[v3 + 1] - // - ); - } - } - if (this.drawMeshHull && hullLength > 0) { - shapes.setColor(this.attachmentLineColor); - hullLength = (hullLength >> 1) * 2; - let lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1]; - for (let ii = 0, nn = hullLength; ii < nn; ii += 2) { - let x = vertices[ii], y = vertices[ii + 1]; - shapes.line(x, y, lastX, lastY); - lastX = x; - lastY = y; - } - } - } - } - if (this.drawBoundingBoxes) { - let bounds = this.bounds; - bounds.update(skeleton, true); - shapes.setColor(this.aabbColor); - shapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight()); - let polygons = bounds.polygons; - let boxes = bounds.boundingBoxes; - for (let i = 0, n = polygons.length; i < n; i++) { - let polygon = polygons[i]; - shapes.setColor(boxes[i].color); - shapes.polygon(polygon, 0, polygon.length); - } - } - if (this.drawPaths) { - let slots = skeleton.slots; - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (!slot.bone.active) - continue; - let attachment = slot.getAttachment(); - if (!(attachment instanceof PathAttachment)) - continue; - let path = attachment; - let nn = path.worldVerticesLength; - let world = this.temp = Utils.setArraySize(this.temp, nn, 0); - path.computeWorldVertices(slot, 0, nn, world, 0, 2); - let color = this.pathColor; - let x1 = world[2], y1 = world[3], x2 = 0, y2 = 0; - if (path.closed) { - shapes.setColor(color); - let cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1]; - x2 = world[nn - 4]; - y2 = world[nn - 3]; - shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); - shapes.setColor(_SkeletonDebugRenderer.LIGHT_GRAY); - shapes.line(x1, y1, cx1, cy1); - shapes.line(x2, y2, cx2, cy2); - } - nn -= 4; - for (let ii = 4; ii < nn; ii += 6) { - let cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3]; - x2 = world[ii + 4]; - y2 = world[ii + 5]; - shapes.setColor(color); - shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32); - shapes.setColor(_SkeletonDebugRenderer.LIGHT_GRAY); - shapes.line(x1, y1, cx1, cy1); - shapes.line(x2, y2, cx2, cy2); - x1 = x2; - y1 = y2; - } - } - } - if (this.drawBones) { - shapes.setColor(this.boneOriginColor); - for (let i = 0, n = bones.length; i < n; i++) { - let bone = bones[i]; - if (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) - continue; - shapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, this.boneOriginColor, 8); - } - } - if (this.drawClipping) { - let slots = skeleton.slots; - shapes.setColor(this.clipColor); - for (let i = 0, n = slots.length; i < n; i++) { - let slot = slots[i]; - if (!slot.bone.active) - continue; - let attachment = slot.getAttachment(); - if (!(attachment instanceof ClippingAttachment)) - continue; - let clip = attachment; - let nn = clip.worldVerticesLength; - let world = this.temp = Utils.setArraySize(this.temp, nn, 0); - clip.computeWorldVertices(slot, 0, nn, world, 0, 2); - for (let i2 = 0, n2 = world.length; i2 < n2; i2 += 2) { - let x = world[i2]; - let y = world[i2 + 1]; - let x2 = world[(i2 + 2) % world.length]; - let y2 = world[(i2 + 3) % world.length]; - shapes.line(x, y, x2, y2); - } - } - } - } - dispose() { - } - }; - var SkeletonDebugRenderer = _SkeletonDebugRenderer; - __publicField(SkeletonDebugRenderer, "LIGHT_GRAY", new Color(192 / 255, 192 / 255, 192 / 255, 1)); - __publicField(SkeletonDebugRenderer, "GREEN", new Color(0, 1, 0, 1)); - - // spine-webgl/src/SkeletonRenderer.ts - var Renderable = class { - constructor(vertices, numVertices, numFloats) { - this.vertices = vertices; - this.numVertices = numVertices; - this.numFloats = numFloats; - } - }; - var _SkeletonRenderer = class { - premultipliedAlpha = false; - tempColor = new Color(); - tempColor2 = new Color(); - vertices; - vertexSize = 2 + 2 + 4; - twoColorTint = false; - renderable = new Renderable([], 0, 0); - clipper = new SkeletonClipping(); - temp = new Vector2(); - temp2 = new Vector2(); - temp3 = new Color(); - temp4 = new Color(); - constructor(context, twoColorTint = true) { - this.twoColorTint = twoColorTint; - if (twoColorTint) - this.vertexSize += 4; - this.vertices = Utils.newFloatArray(this.vertexSize * 1024); - } - draw(batcher, skeleton, slotRangeStart = -1, slotRangeEnd = -1, transformer = null) { - let clipper = this.clipper; - let premultipliedAlpha = this.premultipliedAlpha; - let twoColorTint = this.twoColorTint; - let blendMode = null; - let renderable = this.renderable; - let uvs; - let triangles; - let drawOrder = skeleton.drawOrder; - let attachmentColor; - let skeletonColor = skeleton.color; - let vertexSize = twoColorTint ? 12 : 8; - let inRange = false; - if (slotRangeStart == -1) - inRange = true; - for (let i = 0, n = drawOrder.length; i < n; i++) { - let clippedVertexSize = clipper.isClipping() ? 2 : vertexSize; - let slot = drawOrder[i]; - if (!slot.bone.active) { - clipper.clipEndWithSlot(slot); - continue; - } - if (slotRangeStart >= 0 && slotRangeStart == slot.data.index) { - inRange = true; - } - if (!inRange) { - clipper.clipEndWithSlot(slot); - continue; - } - if (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) { - inRange = false; - } - let attachment = slot.getAttachment(); - let texture; - if (attachment instanceof RegionAttachment) { - let region = attachment; - renderable.vertices = this.vertices; - renderable.numVertices = 4; - renderable.numFloats = clippedVertexSize << 2; - region.computeWorldVertices(slot, renderable.vertices, 0, clippedVertexSize); - triangles = _SkeletonRenderer.QUAD_TRIANGLES; - uvs = region.uvs; - texture = region.region.texture; - attachmentColor = region.color; - } else if (attachment instanceof MeshAttachment) { - let mesh = attachment; - renderable.vertices = this.vertices; - renderable.numVertices = mesh.worldVerticesLength >> 1; - renderable.numFloats = renderable.numVertices * clippedVertexSize; - if (renderable.numFloats > renderable.vertices.length) { - renderable.vertices = this.vertices = Utils.newFloatArray(renderable.numFloats); - } - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize); - triangles = mesh.triangles; - texture = mesh.region.texture; - uvs = mesh.uvs; - attachmentColor = mesh.color; - } else if (attachment instanceof ClippingAttachment) { - let clip = attachment; - clipper.clipStart(slot, clip); - continue; - } else { - clipper.clipEndWithSlot(slot); - continue; - } - if (texture) { - let slotColor = slot.color; - let finalColor = this.tempColor; - finalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r; - finalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g; - finalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b; - finalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a; - if (premultipliedAlpha) { - finalColor.r *= finalColor.a; - finalColor.g *= finalColor.a; - finalColor.b *= finalColor.a; - } - let darkColor = this.tempColor2; - if (!slot.darkColor) - darkColor.set(0, 0, 0, 1); - else { - if (premultipliedAlpha) { - darkColor.r = slot.darkColor.r * finalColor.a; - darkColor.g = slot.darkColor.g * finalColor.a; - darkColor.b = slot.darkColor.b * finalColor.a; - } else { - darkColor.setFromColor(slot.darkColor); - } - darkColor.a = premultipliedAlpha ? 1 : 0; - } - let slotBlendMode = slot.data.blendMode; - if (slotBlendMode != blendMode) { - blendMode = slotBlendMode; - batcher.setBlendMode(blendMode, premultipliedAlpha); - } - if (clipper.isClipping()) { - clipper.clipTriangles(renderable.vertices, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint); - let clippedVertices = new Float32Array(clipper.clippedVertices); - let clippedTriangles = clipper.clippedTriangles; - if (transformer) - transformer(clippedVertices, clippedVertices.length, vertexSize); - batcher.draw(texture, clippedVertices, clippedTriangles); - } else { - let verts = renderable.vertices; - if (!twoColorTint) { - for (let v = 2, u = 0, n2 = renderable.numFloats; v < n2; v += vertexSize, u += 2) { - verts[v] = finalColor.r; - verts[v + 1] = finalColor.g; - verts[v + 2] = finalColor.b; - verts[v + 3] = finalColor.a; - verts[v + 4] = uvs[u]; - verts[v + 5] = uvs[u + 1]; - } - } else { - for (let v = 2, u = 0, n2 = renderable.numFloats; v < n2; v += vertexSize, u += 2) { - verts[v] = finalColor.r; - verts[v + 1] = finalColor.g; - verts[v + 2] = finalColor.b; - verts[v + 3] = finalColor.a; - verts[v + 4] = uvs[u]; - verts[v + 5] = uvs[u + 1]; - verts[v + 6] = darkColor.r; - verts[v + 7] = darkColor.g; - verts[v + 8] = darkColor.b; - verts[v + 9] = darkColor.a; - } - } - let view = renderable.vertices.subarray(0, renderable.numFloats); - if (transformer) - transformer(renderable.vertices, renderable.numFloats, vertexSize); - batcher.draw(texture, view, triangles); - } - } - clipper.clipEndWithSlot(slot); - } - clipper.clipEnd(); - } - /** Returns the {@link SkeletonClipping} used by this renderer for use with e.g. {@link Skeleton.getBounds} **/ - getSkeletonClipping() { - return this.clipper; - } - }; - var SkeletonRenderer = _SkeletonRenderer; - __publicField(SkeletonRenderer, "QUAD_TRIANGLES", [0, 1, 2, 2, 3, 0]); - - // spine-webgl/src/SceneRenderer.ts - var quad = [ - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1, - 0, - 0 - ]; - var QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0]; - var WHITE = new Color(1, 1, 1, 1); - var SceneRenderer = class { - context; - canvas; - camera; - batcher; - twoColorTint = false; - batcherShader; - shapes; - shapesShader; - activeRenderer = null; - skeletonRenderer; - skeletonDebugRenderer; - constructor(canvas, context, twoColorTint = true) { - this.canvas = canvas; - this.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context); - this.twoColorTint = twoColorTint; - this.camera = new OrthoCamera(canvas.width, canvas.height); - this.batcherShader = twoColorTint ? Shader.newTwoColoredTextured(this.context) : Shader.newColoredTextured(this.context); - this.batcher = new PolygonBatcher(this.context, twoColorTint); - this.shapesShader = Shader.newColored(this.context); - this.shapes = new ShapeRenderer(this.context); - this.skeletonRenderer = new SkeletonRenderer(this.context, twoColorTint); - this.skeletonDebugRenderer = new SkeletonDebugRenderer(this.context); - } - dispose() { - this.batcher.dispose(); - this.batcherShader.dispose(); - this.shapes.dispose(); - this.shapesShader.dispose(); - this.skeletonDebugRenderer.dispose(); - } - begin() { - this.camera.update(); - this.enableRenderer(this.batcher); - } - drawSkeleton(skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform = null) { - this.enableRenderer(this.batcher); - this.skeletonRenderer.premultipliedAlpha = premultipliedAlpha; - this.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd, transform); - } - drawSkeletonDebug(skeleton, premultipliedAlpha = false, ignoredBones) { - this.enableRenderer(this.shapes); - this.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha; - this.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones); - } - drawTexture(texture, x, y, width, height, color) { - this.enableRenderer(this.batcher); - if (!color) - color = WHITE; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i] = 0; - } - this.batcher.draw(texture, quad, QUAD_TRIANGLES); - } - drawTextureUV(texture, x, y, width, height, u, v, u2, v2, color) { - this.enableRenderer(this.batcher); - if (!color) - color = WHITE; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u; - quad[i++] = v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u2; - quad[i++] = v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u2; - quad[i++] = v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = u; - quad[i++] = v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i] = 0; - } - this.batcher.draw(texture, quad, QUAD_TRIANGLES); - } - drawTextureRotated(texture, x, y, width, height, pivotX, pivotY, angle, color) { - this.enableRenderer(this.batcher); - if (!color) - color = WHITE; - let worldOriginX = x + pivotX; - let worldOriginY = y + pivotY; - let fx = -pivotX; - let fy = -pivotY; - let fx2 = width - pivotX; - let fy2 = height - pivotY; - let p1x = fx; - let p1y = fy; - let p2x = fx; - let p2y = fy2; - let p3x = fx2; - let p3y = fy2; - let p4x = fx2; - let p4y = fy; - let x1 = 0; - let y1 = 0; - let x2 = 0; - let y2 = 0; - let x3 = 0; - let y3 = 0; - let x4 = 0; - let y4 = 0; - if (angle != 0) { - let cos = MathUtils.cosDeg(angle); - let sin = MathUtils.sinDeg(angle); - x1 = cos * p1x - sin * p1y; - y1 = sin * p1x + cos * p1y; - x4 = cos * p2x - sin * p2y; - y4 = sin * p2x + cos * p2y; - x3 = cos * p3x - sin * p3y; - y3 = sin * p3x + cos * p3y; - x2 = x3 + (x1 - x4); - y2 = y3 + (y1 - y4); - } else { - x1 = p1x; - y1 = p1y; - x4 = p2x; - y4 = p2y; - x3 = p3x; - y3 = p3y; - x2 = p4x; - y2 = p4y; - } - x1 += worldOriginX; - y1 += worldOriginY; - x2 += worldOriginX; - y2 += worldOriginY; - x3 += worldOriginX; - y3 += worldOriginY; - x4 += worldOriginX; - y4 += worldOriginY; - var i = 0; - quad[i++] = x1; - quad[i++] = y1; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x2; - quad[i++] = y2; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 1; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x3; - quad[i++] = y3; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 1; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x4; - quad[i++] = y4; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = 0; - quad[i++] = 0; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i] = 0; - } - this.batcher.draw(texture, quad, QUAD_TRIANGLES); - } - drawRegion(region, x, y, width, height, color) { - this.enableRenderer(this.batcher); - if (!color) - color = WHITE; - var i = 0; - quad[i++] = x; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u; - quad[i++] = region.v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u2; - quad[i++] = region.v2; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x + width; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u2; - quad[i++] = region.v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - } - quad[i++] = x; - quad[i++] = y + height; - quad[i++] = color.r; - quad[i++] = color.g; - quad[i++] = color.b; - quad[i++] = color.a; - quad[i++] = region.u; - quad[i++] = region.v; - if (this.twoColorTint) { - quad[i++] = 0; - quad[i++] = 0; - quad[i++] = 0; - quad[i] = 0; - } - this.batcher.draw(region.page.texture, quad, QUAD_TRIANGLES); - } - line(x, y, x2, y2, color, color2) { - this.enableRenderer(this.shapes); - this.shapes.line(x, y, x2, y2, color); - } - triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3) { - this.enableRenderer(this.shapes); - this.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3); - } - quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4) { - this.enableRenderer(this.shapes); - this.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4); - } - rect(filled, x, y, width, height, color) { - this.enableRenderer(this.shapes); - this.shapes.rect(filled, x, y, width, height, color); - } - rectLine(filled, x1, y1, x2, y2, width, color) { - this.enableRenderer(this.shapes); - this.shapes.rectLine(filled, x1, y1, x2, y2, width, color); - } - polygon(polygonVertices, offset, count, color) { - this.enableRenderer(this.shapes); - this.shapes.polygon(polygonVertices, offset, count, color); - } - circle(filled, x, y, radius, color, segments = 0) { - this.enableRenderer(this.shapes); - this.shapes.circle(filled, x, y, radius, color, segments); - } - curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color) { - this.enableRenderer(this.shapes); - this.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color); - } - end() { - if (this.activeRenderer === this.batcher) - this.batcher.end(); - else if (this.activeRenderer === this.shapes) - this.shapes.end(); - this.activeRenderer = null; - } - resize(resizeMode) { - let canvas = this.canvas; - var dpr = window.devicePixelRatio || 1; - var w = Math.round(canvas.clientWidth * dpr); - var h = Math.round(canvas.clientHeight * dpr); - if (canvas.width != w || canvas.height != h) { - canvas.width = w; - canvas.height = h; - } - this.context.gl.viewport(0, 0, canvas.width, canvas.height); - if (resizeMode === ResizeMode.Expand) - this.camera.setViewport(w, h); - else if (resizeMode === ResizeMode.Fit) { - let sourceWidth = canvas.width, sourceHeight = canvas.height; - let targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight; - let targetRatio = targetHeight / targetWidth; - let sourceRatio = sourceHeight / sourceWidth; - let scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight; - this.camera.setViewport(sourceWidth * scale, sourceHeight * scale); - } - this.camera.update(); - } - enableRenderer(renderer) { - if (this.activeRenderer === renderer) - return; - this.end(); - if (renderer instanceof PolygonBatcher) { - this.batcherShader.bind(); - this.batcherShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values); - this.batcherShader.setUniformi("u_texture", 0); - this.batcher.begin(this.batcherShader); - this.activeRenderer = this.batcher; - } else if (renderer instanceof ShapeRenderer) { - this.shapesShader.bind(); - this.shapesShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values); - this.shapes.begin(this.shapesShader); - this.activeRenderer = this.shapes; - } else - this.activeRenderer = this.skeletonDebugRenderer; - } - }; - var ResizeMode = /* @__PURE__ */ ((ResizeMode2) => { - ResizeMode2[ResizeMode2["Stretch"] = 0] = "Stretch"; - ResizeMode2[ResizeMode2["Expand"] = 1] = "Expand"; - ResizeMode2[ResizeMode2["Fit"] = 2] = "Fit"; - return ResizeMode2; - })(ResizeMode || {}); - - // spine-webgl/src/LoadingScreen.ts - var spinnerImage; - var logoImage; - var loaded = 0; - var FADE_IN = 1; - var FADE_OUT = 1; - var logoWidth = 165; - var logoHeight = 108; - var spinnerSize = 163; - var LoadingScreen = class { - renderer; - logo = null; - spinner = null; - angle = 0; - fadeOut = 0; - fadeIn = 0; - timeKeeper = new TimeKeeper(); - backgroundColor = new Color(0.135, 0.135, 0.135, 1); - tempColor = new Color(); - constructor(renderer) { - this.renderer = renderer; - this.timeKeeper.maxDelta = 9; - if (!logoImage) { - let isSafari = navigator.userAgent.indexOf("Safari") > -1; - let onload = () => loaded++; - logoImage = new Image(); - logoImage.src = SPINE_LOGO_DATA; - if (!isSafari) - logoImage.crossOrigin = "anonymous"; - logoImage.onload = onload; - spinnerImage = new Image(); - spinnerImage.src = SPINNER_DATA; - if (!isSafari) - spinnerImage.crossOrigin = "anonymous"; - spinnerImage.onload = onload; - } - } - dispose() { - this.logo?.dispose(); - this.spinner?.dispose(); - } - draw(complete = false) { - if (loaded < 2 || complete && this.fadeOut > FADE_OUT) - return; - this.timeKeeper.update(); - let a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.25)); - this.angle -= this.timeKeeper.delta * 200 * (1 + 1.5 * Math.pow(a, 5)); - let tempColor = this.tempColor; - let renderer = this.renderer; - let canvas = renderer.canvas; - let gl = renderer.context.gl; - renderer.resize(1 /* Expand */); - renderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0); - renderer.batcher.setBlendMode(0 /* Normal */, true); - if (complete) { - this.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1); - if (this.fadeOut > FADE_OUT) - return; - tempColor.setFromColor(this.backgroundColor); - a = 1 - this.fadeOut / FADE_OUT; - a = 1 - (a - 1) * (a - 1); - tempColor.a *= a; - if (tempColor.a > 0) { - renderer.camera.zoom = 1; - renderer.begin(); - renderer.quad( - true, - 0, - 0, - canvas.width, - 0, - canvas.width, - canvas.height, - 0, - canvas.height, - tempColor, - tempColor, - tempColor, - tempColor - ); - renderer.end(); - } - } else { - this.fadeIn += this.timeKeeper.delta; - if (this.backgroundColor.a > 0) { - gl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a); - gl.clear(gl.COLOR_BUFFER_BIT); - } - a = 1; - } - a *= Math.min(this.fadeIn / FADE_IN, 1); - tempColor.set(a, a, a, a); - if (!this.logo) { - this.logo = new GLTexture(renderer.context, logoImage); - this.spinner = new GLTexture(renderer.context, spinnerImage); - } - renderer.camera.zoom = Math.max(1, spinnerSize / canvas.height); - renderer.begin(); - renderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, tempColor); - if (this.spinner) - renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerSize) / 2, (canvas.height - spinnerSize) / 2, spinnerSize, spinnerSize, spinnerSize / 2, spinnerSize / 2, this.angle, tempColor); - renderer.end(); - } - }; - var SPINNER_DATA = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5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HMBBkI0YYTZ0dZlxwLpkiWDULpmy5gwqayZgZNkA7oKQQCxctByYg0XIIEQQuRitGVHblMTA2ShKGPDpC6wu+DEgJqg2rDGDBtAF4Q6RAojp1xXGmSMbImVcR+YWNY04eQCtUG1ofUJ2/uvcETIgUhhdAE5GAlkKShjwHTNmhhODKgJqQ2sC14uOgyfD0IbRF+MlQaZAiZWyn2yJsTJATqGnHQO2Jhh+xlsACFCG0QbRtdyzQFZCZSxYPpmTS7Q5cjJHYNBYIkZpu99HoUQ/o4QIYSIZUZfjJ4ZMjZI32wZBDMU5yhy8pZTULl4XYP5fagMyEVoy4oupTpGduwnkloSlKEwY+AcQU4MhRTD6ovXBRwFzwWgCSEF0QVjJUGmgEllTS5OLlCIlIN1mS9mx/cZ5eLDALpCTI2RAhkTZQqYoTgpoCPECbaBHQ2ETL3PUl98ECAXYijG0OyYAmQoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII="; - - // spine-webgl/src/SpineCanvas.ts - var SpineCanvas = class { - /** Constructs a new spine canvas, rendering to the provided HTML canvas. */ - constructor(canvas, config) { - this.config = config; - if (!config.pathPrefix) - config.pathPrefix = ""; - if (!config.app) - config.app = { - loadAssets: () => { - }, - initialize: () => { - }, - update: () => { - }, - render: () => { - }, - error: () => { - }, - dispose: () => { - } - }; - if (!config.webglConfig) - config.webglConfig = { alpha: true }; - this.htmlCanvas = canvas; - this.context = new ManagedWebGLRenderingContext(canvas, config.webglConfig); - this.renderer = new SceneRenderer(canvas, this.context); - this.gl = this.context.gl; - this.assetManager = new AssetManager(this.context, config.pathPrefix); - this.input = new Input(canvas); - if (config.app.loadAssets) - config.app.loadAssets(this); - let loop = () => { - if (this.disposed) - return; - requestAnimationFrame(loop); - this.time.update(); - if (config.app.update) - config.app.update(this, this.time.delta); - if (config.app.render) - config.app.render(this); - }; - let waitForAssets = () => { - if (this.disposed) - return; - if (this.assetManager.isLoadingComplete()) { - if (this.assetManager.hasErrors()) { - if (config.app.error) - config.app.error(this, this.assetManager.getErrors()); - } else { - if (config.app.initialize) - config.app.initialize(this); - loop(); - } - return; - } - requestAnimationFrame(waitForAssets); - }; - requestAnimationFrame(waitForAssets); - } - context; - /** Tracks the current time, delta, and other time related statistics. */ - time = new TimeKeeper(); - /** The HTML canvas to render to. */ - htmlCanvas; - /** The WebGL rendering context. */ - gl; - /** The scene renderer for easy drawing of skeletons, shapes, and images. */ - renderer; - /** The asset manager to load assets with. */ - assetManager; - /** The input processor used to listen to mouse, touch, and keyboard events. */ - input; - disposed = false; - /** Clears the canvas with the given color. The color values are given in the range [0,1]. */ - clear(r, g, b, a) { - this.gl.clearColor(r, g, b, a); - this.gl.clear(this.gl.COLOR_BUFFER_BIT); - } - /** Disposes the app, so the update() and render() functions are no longer called. Calls the dispose() callback.*/ - dispose() { - if (this.config.app.dispose) - this.config.app.dispose(this); - this.disposed = true; - } - }; - - // spine-phaser-v3/src/mixins.ts - var components = Phaser.GameObjects.Components; - var ComputedSize = components.ComputedSize; - var Depth = components.Depth; - var Flip = components.Flip; - var ScrollFactor = components.ScrollFactor; - var Transform = components.Transform; - var Visible = components.Visible; - var Origin = components.Origin; - var Alpha = components.Alpha; - function createMixin(...component) { - return (BaseGameObject) => { - Phaser.Class.mixin(BaseGameObject, component); - return BaseGameObject; - }; - } - var ComputedSizeMixin = createMixin(ComputedSize); - var DepthMixin = createMixin(Depth); - var FlipMixin = createMixin(Flip); - var ScrollFactorMixin = createMixin(ScrollFactor); - var TransformMixin = createMixin(Transform); - var VisibleMixin = createMixin(Visible); - var OriginMixin = createMixin(Origin); - var AlphaMixin = createMixin(Alpha); - - // spine-phaser-v3/src/SpineGameObject.ts - var BaseSpineGameObject = class extends Phaser.GameObjects.GameObject { - constructor(scene, type) { - super(scene, type); - } - }; - var SetupPoseBoundsProvider = class { - /** - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(clipping = false) { - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton) - return { x: 0, y: 0, width: 0, height: 0 }; - const skeleton = new Skeleton(gameObject.skeleton.data); - skeleton.setToSetupPose(); - skeleton.updateWorldTransform(2 /* update */); - const bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : void 0); - return bounds.width == Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } - }; - var SkinsAndAnimationBoundsProvider = class { - /** - * @param animation The animation to use for calculating the bounds. If null, the setup pose is used. - * @param skins The skins to use for calculating the bounds. If empty, the default skin is used. - * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation. - * @param clipping If true, clipping attachments are used to compute the bounds. False, by default. - */ - constructor(animation, skins = [], timeStep = 0.05, clipping = false) { - this.animation = animation; - this.skins = skins; - this.timeStep = timeStep; - this.clipping = clipping; - } - calculateBounds(gameObject) { - if (!gameObject.skeleton || !gameObject.animationState) - return { x: 0, y: 0, width: 0, height: 0 }; - const animationState = new AnimationState(gameObject.animationState.data); - const skeleton = new Skeleton(gameObject.skeleton.data); - const clipper = this.clipping ? new SkeletonClipping() : void 0; - const data = skeleton.data; - if (this.skins.length > 0) { - let customSkin = new Skin("custom-skin"); - for (const skinName of this.skins) { - const skin = data.findSkin(skinName); - if (skin == null) - continue; - customSkin.addSkin(skin); - } - skeleton.setSkin(customSkin); - } - skeleton.setToSetupPose(); - const animation = this.animation != null ? data.findAnimation(this.animation) : null; - if (animation == null) { - skeleton.updateWorldTransform(2 /* update */); - const bounds = skeleton.getBoundsRect(clipper); - return bounds.width == Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } else { - let minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY; - animationState.clearTracks(); - animationState.setAnimationWith(0, animation, false); - const steps = Math.max(animation.duration / this.timeStep, 1); - for (let i = 0; i < steps; i++) { - const delta = i > 0 ? this.timeStep : 0; - animationState.update(delta); - animationState.apply(skeleton); - skeleton.update(delta); - skeleton.updateWorldTransform(2 /* update */); - const bounds2 = skeleton.getBoundsRect(clipper); - minX = Math.min(minX, bounds2.x); - minY = Math.min(minY, bounds2.y); - maxX = Math.max(maxX, bounds2.x + bounds2.width); - maxY = Math.max(maxY, bounds2.y + bounds2.height); - } - const bounds = { - x: minX, - y: minY, - width: maxX - minX, - height: maxY - minY - }; - return bounds.width == Number.NEGATIVE_INFINITY ? { x: 0, y: 0, width: 0, height: 0 } : bounds; - } - } - }; - var SpineGameObject = class extends DepthMixin( - OriginMixin( - ComputedSizeMixin( - FlipMixin( - ScrollFactorMixin( - TransformMixin(VisibleMixin(AlphaMixin(BaseSpineGameObject))) - ) - ) - ) - ) - ) { - constructor(scene, plugin, x, y, dataKey, atlasKey, boundsProvider = new SetupPoseBoundsProvider()) { - super(scene, window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE); - this.plugin = plugin; - this.boundsProvider = boundsProvider; - this.setPosition(x, y); - this.premultipliedAlpha = this.plugin.isAtlasPremultiplied(atlasKey); - this.skeleton = this.plugin.createSkeleton(dataKey, atlasKey); - this.animationStateData = new AnimationStateData(this.skeleton.data); - this.animationState = new AnimationState(this.animationStateData); - this.skeleton.updateWorldTransform(2 /* update */); - this.updateSize(); - } - blendMode = -1; - skeleton; - animationStateData; - animationState; - beforeUpdateWorldTransforms = () => { - }; - afterUpdateWorldTransforms = () => { - }; - premultipliedAlpha = false; - updateSize() { - if (!this.skeleton) - return; - let bounds = this.boundsProvider.calculateBounds(this); - let self = this; - self.width = bounds.width; - self.height = bounds.height; - this.displayOriginX = -bounds.x; - this.displayOriginY = -bounds.y; - } - /** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */ - skeletonToPhaserWorldCoordinates(point) { - let transform = this.getWorldTransformMatrix(); - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - let x = point.x; - let y = point.y; - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - } - /** Converts a point from the Phaser world coordinate system to the skeleton coordinate system. */ - phaserWorldCoordinatesToSkeleton(point) { - let transform = this.getWorldTransformMatrix(); - transform = transform.invert(); - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - let x = point.x; - let y = point.y; - point.x = x * a + y * c + tx; - point.y = x * b + y * d + ty; - } - /** Converts a point from the Phaser world coordinate system to the bone's local coordinate system. */ - phaserWorldCoordinatesToBone(point, bone) { - this.phaserWorldCoordinatesToSkeleton(point); - if (bone.parent) { - bone.parent.worldToLocal(point); - } else { - bone.worldToLocal(point); - } - } - /** - * Updates the {@link AnimationState}, applies it to the {@link Skeleton}, then updates the world transforms of all bones. - * @param delta The time delta in milliseconds - */ - updatePose(delta) { - this.animationState.update(delta / 1e3); - this.animationState.apply(this.skeleton); - this.beforeUpdateWorldTransforms(this); - this.skeleton.update(delta / 1e3); - this.skeleton.updateWorldTransform(2 /* update */); - this.afterUpdateWorldTransforms(this); - } - preUpdate(time, delta) { - if (!this.skeleton || !this.animationState) - return; - this.updatePose(delta); - } - preDestroy() { - } - willRender(camera) { - var GameObjectRenderMask = 15; - var result = !this.skeleton || !(GameObjectRenderMask !== this.renderFlags || this.cameraFilter !== 0 && this.cameraFilter & camera.id); - if (!this.visible) - result = false; - if (!result && this.parentContainer && this.plugin.webGLRenderer) { - var sceneRenderer = this.plugin.webGLRenderer; - if (this.plugin.gl && this.plugin.phaserRenderer instanceof Phaser.Renderer.WebGL.WebGLRenderer && sceneRenderer.batcher.isDrawing) { - sceneRenderer.end(); - this.plugin.phaserRenderer.pipelines.rebind(); - } - } - return result; - } - renderWebGL(renderer, src, camera, parentMatrix) { - if (!this.skeleton || !this.animationState || !this.plugin.webGLRenderer) - return; - let sceneRenderer = this.plugin.webGLRenderer; - if (renderer.newType) { - renderer.pipelines.clear(); - sceneRenderer.begin(); - } - camera.addToRenderList(src); - let transform = Phaser.GameObjects.GetCalcMatrix( - src, - camera, - parentMatrix - ).calc; - let a = transform.a, b = transform.b, c = transform.c, d = transform.d, tx = transform.tx, ty = transform.ty; - sceneRenderer.drawSkeleton( - this.skeleton, - this.premultipliedAlpha, - -1, - -1, - (vertices, numVertices, stride) => { - for (let i = 0; i < numVertices; i += stride) { - let vx = vertices[i]; - let vy = vertices[i + 1]; - vertices[i] = vx * a + vy * c + tx; - vertices[i + 1] = vx * b + vy * d + ty; - } - } - ); - if (!renderer.nextTypeMatch) { - sceneRenderer.end(); - renderer.pipelines.rebind(); - } - } - renderCanvas(renderer, src, camera, parentMatrix) { - if (!this.skeleton || !this.animationState || !this.plugin.canvasRenderer) - return; - let context = renderer.currentContext; - let skeletonRenderer = this.plugin.canvasRenderer; - skeletonRenderer.ctx = context; - camera.addToRenderList(src); - let transform = Phaser.GameObjects.GetCalcMatrix( - src, - camera, - parentMatrix - ).calc; - let skeleton = this.skeleton; - skeleton.x = transform.tx; - skeleton.y = transform.ty; - skeleton.scaleX = transform.scaleX; - skeleton.scaleY = transform.scaleY; - let root = skeleton.getRootBone(); - root.rotation = -MathUtils.radiansToDegrees * transform.rotationNormalized; - this.skeleton.updateWorldTransform(2 /* update */); - context.save(); - skeletonRenderer.draw(skeleton); - context.restore(); - } - }; - - // spine-canvas/src/CanvasTexture.ts - var CanvasTexture = class extends Texture { - constructor(image) { - super(image); - } - setFilters(minFilter, magFilter) { - } - setWraps(uWrap, vWrap) { - } - dispose() { - } - }; - - // spine-canvas/src/SkeletonRenderer.ts - var worldVertices = Utils.newFloatArray(8); - var _SkeletonRenderer2 = class { - ctx; - triangleRendering = false; - debugRendering = false; - vertices = Utils.newFloatArray(8 * 1024); - tempColor = new Color(); - constructor(context) { - this.ctx = context; - } - draw(skeleton) { - if (this.triangleRendering) - this.drawTriangles(skeleton); - else - this.drawImages(skeleton); - } - drawImages(skeleton) { - let ctx = this.ctx; - let color = this.tempColor; - let skeletonColor = skeleton.color; - let drawOrder = skeleton.drawOrder; - if (this.debugRendering) - ctx.strokeStyle = "green"; - for (let i = 0, n = drawOrder.length; i < n; i++) { - let slot = drawOrder[i]; - let bone = slot.bone; - if (!bone.active) - continue; - let attachment = slot.getAttachment(); - if (!(attachment instanceof RegionAttachment)) - continue; - attachment.computeWorldVertices(slot, worldVertices, 0, 2); - let region = attachment.region; - let image = region.texture.getImage(); - let slotColor = slot.color; - let regionColor = attachment.color; - color.set( - skeletonColor.r * slotColor.r * regionColor.r, - skeletonColor.g * slotColor.g * regionColor.g, - skeletonColor.b * slotColor.b * regionColor.b, - skeletonColor.a * slotColor.a * regionColor.a - ); - ctx.save(); - ctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY); - ctx.translate(attachment.offset[0], attachment.offset[1]); - ctx.rotate(attachment.rotation * Math.PI / 180); - let atlasScale = attachment.width / region.originalWidth; - ctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY); - let w = region.width, h = region.height; - ctx.translate(w / 2, h / 2); - if (attachment.region.degrees == 90) { - let t = w; - w = h; - h = t; - ctx.rotate(-Math.PI / 2); - } - ctx.scale(1, -1); - ctx.translate(-w / 2, -h / 2); - ctx.globalAlpha = color.a; - ctx.drawImage(image, image.width * region.u, image.height * region.v, w, h, 0, 0, w, h); - if (this.debugRendering) - ctx.strokeRect(0, 0, w, h); - ctx.restore(); - } - } - drawTriangles(skeleton) { - let ctx = this.ctx; - let color = this.tempColor; - let skeletonColor = skeleton.color; - let drawOrder = skeleton.drawOrder; - let blendMode = null; - let vertices = this.vertices; - let triangles = null; - for (let i = 0, n = drawOrder.length; i < n; i++) { - let slot = drawOrder[i]; - let attachment = slot.getAttachment(); - let texture; - let region; - if (attachment instanceof RegionAttachment) { - let regionAttachment = attachment; - vertices = this.computeRegionVertices(slot, regionAttachment, false); - triangles = _SkeletonRenderer2.QUAD_TRIANGLES; - texture = regionAttachment.region.texture.getImage(); - } else if (attachment instanceof MeshAttachment) { - let mesh = attachment; - vertices = this.computeMeshVertices(slot, mesh, false); - triangles = mesh.triangles; - texture = mesh.region.texture.getImage(); - } else - continue; - if (texture) { - if (slot.data.blendMode != blendMode) - blendMode = slot.data.blendMode; - let slotColor = slot.color; - let attachmentColor = attachment.color; - color.set( - skeletonColor.r * slotColor.r * attachmentColor.r, - skeletonColor.g * slotColor.g * attachmentColor.g, - skeletonColor.b * slotColor.b * attachmentColor.b, - skeletonColor.a * slotColor.a * attachmentColor.a - ); - ctx.globalAlpha = color.a; - for (var j = 0; j < triangles.length; j += 3) { - let t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8; - let x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7]; - let x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7]; - let x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7]; - this.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2); - if (this.debugRendering) { - ctx.strokeStyle = "green"; - ctx.beginPath(); - ctx.moveTo(x0, y0); - ctx.lineTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.lineTo(x0, y0); - ctx.stroke(); - } - } - } - } - this.ctx.globalAlpha = 1; - } - // Adapted from http://extremelysatisfactorytotalitarianism.com/blog/?p=2120 - // Apache 2 licensed - drawTriangle(img, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2) { - let ctx = this.ctx; - const width = img.width - 1; - const height = img.height - 1; - u0 *= width; - v0 *= height; - u1 *= width; - v1 *= height; - u2 *= width; - v2 *= height; - ctx.beginPath(); - ctx.moveTo(x0, y0); - ctx.lineTo(x1, y1); - ctx.lineTo(x2, y2); - ctx.closePath(); - x1 -= x0; - y1 -= y0; - x2 -= x0; - y2 -= y0; - u1 -= u0; - v1 -= v0; - u2 -= u0; - v2 -= v0; - let det = u1 * v2 - u2 * v1; - if (det == 0) - return; - det = 1 / det; - const a = (v2 * x1 - v1 * x2) * det; - const b = (v2 * y1 - v1 * y2) * det; - const c = (u1 * x2 - u2 * x1) * det; - const d = (u1 * y2 - u2 * y1) * det; - const e = x0 - a * u0 - c * v0; - const f = y0 - b * u0 - d * v0; - ctx.save(); - ctx.transform(a, b, c, d, e, f); - ctx.clip(); - ctx.drawImage(img, 0, 0); - ctx.restore(); - } - computeRegionVertices(slot, region, pma) { - let skeletonColor = slot.bone.skeleton.color; - let slotColor = slot.color; - let regionColor = region.color; - let alpha = skeletonColor.a * slotColor.a * regionColor.a; - let multiplier = pma ? alpha : 1; - let color = this.tempColor; - color.set( - skeletonColor.r * slotColor.r * regionColor.r * multiplier, - skeletonColor.g * slotColor.g * regionColor.g * multiplier, - skeletonColor.b * slotColor.b * regionColor.b * multiplier, - alpha - ); - region.computeWorldVertices(slot, this.vertices, 0, _SkeletonRenderer2.VERTEX_SIZE); - let vertices = this.vertices; - let uvs = region.uvs; - vertices[RegionAttachment.C1R] = color.r; - vertices[RegionAttachment.C1G] = color.g; - vertices[RegionAttachment.C1B] = color.b; - vertices[RegionAttachment.C1A] = color.a; - vertices[RegionAttachment.U1] = uvs[0]; - vertices[RegionAttachment.V1] = uvs[1]; - vertices[RegionAttachment.C2R] = color.r; - vertices[RegionAttachment.C2G] = color.g; - vertices[RegionAttachment.C2B] = color.b; - vertices[RegionAttachment.C2A] = color.a; - vertices[RegionAttachment.U2] = uvs[2]; - vertices[RegionAttachment.V2] = uvs[3]; - vertices[RegionAttachment.C3R] = color.r; - vertices[RegionAttachment.C3G] = color.g; - vertices[RegionAttachment.C3B] = color.b; - vertices[RegionAttachment.C3A] = color.a; - vertices[RegionAttachment.U3] = uvs[4]; - vertices[RegionAttachment.V3] = uvs[5]; - vertices[RegionAttachment.C4R] = color.r; - vertices[RegionAttachment.C4G] = color.g; - vertices[RegionAttachment.C4B] = color.b; - vertices[RegionAttachment.C4A] = color.a; - vertices[RegionAttachment.U4] = uvs[6]; - vertices[RegionAttachment.V4] = uvs[7]; - return vertices; - } - computeMeshVertices(slot, mesh, pma) { - let skeletonColor = slot.bone.skeleton.color; - let slotColor = slot.color; - let regionColor = mesh.color; - let alpha = skeletonColor.a * slotColor.a * regionColor.a; - let multiplier = pma ? alpha : 1; - let color = this.tempColor; - color.set( - skeletonColor.r * slotColor.r * regionColor.r * multiplier, - skeletonColor.g * slotColor.g * regionColor.g * multiplier, - skeletonColor.b * slotColor.b * regionColor.b * multiplier, - alpha - ); - let vertexCount = mesh.worldVerticesLength / 2; - let vertices = this.vertices; - if (vertices.length < mesh.worldVerticesLength) - this.vertices = vertices = Utils.newFloatArray(mesh.worldVerticesLength); - mesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, _SkeletonRenderer2.VERTEX_SIZE); - let uvs = mesh.uvs; - for (let i = 0, u = 0, v = 2; i < vertexCount; i++) { - vertices[v++] = color.r; - vertices[v++] = color.g; - vertices[v++] = color.b; - vertices[v++] = color.a; - vertices[v++] = uvs[u++]; - vertices[v++] = uvs[u++]; - v += 2; - } - return vertices; - } - }; - var SkeletonRenderer2 = _SkeletonRenderer2; - __publicField(SkeletonRenderer2, "QUAD_TRIANGLES", [0, 1, 2, 2, 3, 0]); - __publicField(SkeletonRenderer2, "VERTEX_SIZE", 2 + 2 + 4); - - // spine-phaser-v3/src/SpinePlugin.ts - var _SpinePlugin = class extends Phaser2.Plugins.ScenePlugin { - game; - isWebGL; - gl; - get webGLRenderer() { - return _SpinePlugin.gameWebGLRenderer; - } - canvasRenderer; - phaserRenderer; - skeletonDataCache; - atlasCache; - constructor(scene, pluginManager, pluginKey) { - super(scene, pluginManager, pluginKey); - this.game = pluginManager.game; - this.isWebGL = this.game.config.renderType === 2; - this.gl = this.isWebGL ? this.game.renderer.gl : null; - this.phaserRenderer = this.game.renderer; - this.canvasRenderer = null; - this.skeletonDataCache = this.game.cache.addCustom(SPINE_SKELETON_FILE_CACHE_KEY); - this.atlasCache = this.game.cache.addCustom(SPINE_ATLAS_CACHE_KEY); - let skeletonJsonFileCallback = function(key, url, xhrSettings) { - let file = new SpineSkeletonDataFile(this, key, url, SpineSkeletonDataFileType.json, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineJson", skeletonJsonFileCallback, scene); - let skeletonBinaryFileCallback = function(key, url, xhrSettings) { - let file = new SpineSkeletonDataFile(this, key, url, SpineSkeletonDataFileType.binary, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineBinary", skeletonBinaryFileCallback, scene); - let atlasFileCallback = function(key, url, premultipliedAlpha, xhrSettings) { - let file = new SpineAtlasFile(this, key, url, premultipliedAlpha, xhrSettings); - this.addFile(file.files); - return this; - }; - pluginManager.registerFileType("spineAtlas", atlasFileCallback, scene); - let addSpineGameObject = function(x, y, dataKey, atlasKey, boundsProvider) { - if (this.scene.sys.renderer instanceof Phaser2.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.clear(); - } - const spinePlugin = this.scene.sys[pluginKey]; - let gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, dataKey, atlasKey, boundsProvider); - this.displayList.add(gameObject); - this.updateList.add(gameObject); - if (this.scene.sys.renderer instanceof Phaser2.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.rebind(); - } - return gameObject; - }; - let makeSpineGameObject = function(config, addToScene = false) { - if (this.scene.sys.renderer instanceof Phaser2.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.clear(); - } - let x = config.x ? config.x : 0; - let y = config.y ? config.y : 0; - let boundsProvider = config.boundsProvider ? config.boundsProvider : void 0; - const spinePlugin = this.scene.sys[pluginKey]; - let gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, config.dataKey, config.atlasKey, boundsProvider); - if (addToScene !== void 0) { - config.add = addToScene; - } - if (this.scene.sys.renderer instanceof Phaser2.Renderer.WebGL.WebGLRenderer) { - this.scene.sys.renderer.pipelines.rebind(); - } - return Phaser2.GameObjects.BuildGameObject(this.scene, gameObject, config); - }; - pluginManager.registerGameObject(window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, addSpineGameObject, makeSpineGameObject); - } - boot() { - Skeleton.yDown = true; - if (this.isWebGL) { - if (!_SpinePlugin.gameWebGLRenderer) { - _SpinePlugin.gameWebGLRenderer = new SceneRenderer(this.game.renderer.canvas, this.gl, true); - } - this.onResize(); - this.game.scale.on(Phaser2.Scale.Events.RESIZE, this.onResize, this); - } else { - if (!this.canvasRenderer) { - this.canvasRenderer = new SkeletonRenderer2(this.scene.sys.context); - } - } - var eventEmitter = this.systems.events; - eventEmitter.once("shutdown", this.shutdown, this); - eventEmitter.once("destroy", this.destroy, this); - this.game.events.once("destroy", this.gameDestroy, this); - } - onResize() { - var phaserRenderer = this.game.renderer; - var sceneRenderer = this.webGLRenderer; - if (phaserRenderer && sceneRenderer) { - var viewportWidth = phaserRenderer.width; - var viewportHeight = phaserRenderer.height; - sceneRenderer.camera.position.x = viewportWidth / 2; - sceneRenderer.camera.position.y = viewportHeight / 2; - sceneRenderer.camera.up.y = -1; - sceneRenderer.camera.direction.z = 1; - sceneRenderer.camera.setViewport(viewportWidth, viewportHeight); - } - } - shutdown() { - this.systems.events.off("shutdown", this.shutdown, this); - if (this.isWebGL) { - this.game.scale.off(Phaser2.Scale.Events.RESIZE, this.onResize, this); - } - } - destroy() { - this.shutdown(); - } - gameDestroy() { - this.pluginManager.removeGameObject(window.SPINE_GAME_OBJECT_TYPE ? window.SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, true, true); - if (this.webGLRenderer) - this.webGLRenderer.dispose(); - _SpinePlugin.gameWebGLRenderer = null; - } - /** Returns the TextureAtlas instance for the given key */ - getAtlas(atlasKey) { - let atlas; - if (this.atlasCache.exists(atlasKey)) { - atlas = this.atlasCache.get(atlasKey); - } else { - let atlasFile = this.game.cache.text.get(atlasKey); - atlas = new TextureAtlas(atlasFile.data); - if (this.isWebGL) { - let gl = this.gl; - const phaserUnpackPmaValue = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL); - if (phaserUnpackPmaValue) - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); - for (let atlasPage of atlas.pages) { - atlasPage.setTexture(new GLTexture(gl, this.game.textures.get(atlasKey + "!" + atlasPage.name).getSourceImage(), false)); - } - if (phaserUnpackPmaValue) - gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true); - } else { - for (let atlasPage of atlas.pages) { - atlasPage.setTexture(new CanvasTexture(this.game.textures.get(atlasKey + "!" + atlasPage.name).getSourceImage())); - } - } - this.atlasCache.add(atlasKey, atlas); - } - return atlas; - } - /** Returns whether the TextureAtlas uses premultiplied alpha */ - isAtlasPremultiplied(atlasKey) { - let atlasFile = this.game.cache.text.get(atlasKey); - if (!atlasFile) - return false; - return atlasFile.premultipliedAlpha; - } - /** Returns the SkeletonData instance for the given data and atlas key */ - getSkeletonData(dataKey, atlasKey) { - const atlas = this.getAtlas(atlasKey); - const combinedKey = dataKey + atlasKey; - let skeletonData; - if (this.skeletonDataCache.exists(combinedKey)) { - skeletonData = this.skeletonDataCache.get(combinedKey); - } else { - if (this.game.cache.json.exists(dataKey)) { - let jsonFile = this.game.cache.json.get(dataKey); - let json = new SkeletonJson(new AtlasAttachmentLoader(atlas)); - skeletonData = json.readSkeletonData(jsonFile); - } else { - let binaryFile = this.game.cache.binary.get(dataKey); - let binary = new SkeletonBinary(new AtlasAttachmentLoader(atlas)); - skeletonData = binary.readSkeletonData(new Uint8Array(binaryFile)); - } - this.skeletonDataCache.add(combinedKey, skeletonData); - } - return skeletonData; - } - /** Creates a new Skeleton instance from the data and atlas. */ - createSkeleton(dataKey, atlasKey) { - return new Skeleton(this.getSkeletonData(dataKey, atlasKey)); - } - }; - var SpinePlugin = _SpinePlugin; - __publicField(SpinePlugin, "gameWebGLRenderer", null); - __publicField(SpinePlugin, "rendererId", 0); - var SpineSkeletonDataFileType = /* @__PURE__ */ ((SpineSkeletonDataFileType2) => { - SpineSkeletonDataFileType2[SpineSkeletonDataFileType2["json"] = 0] = "json"; - SpineSkeletonDataFileType2[SpineSkeletonDataFileType2["binary"] = 1] = "binary"; - return SpineSkeletonDataFileType2; - })(SpineSkeletonDataFileType || {}); - var SpineSkeletonDataFile = class extends Phaser2.Loader.MultiFile { - constructor(loader, key, url, fileType, xhrSettings) { - if (typeof key !== "string") { - const config = key; - key = config.key; - url = config.url; - fileType = config.type === "spineJson" ? 0 /* json */ : 1 /* binary */; - xhrSettings = config.xhrSettings; - } - let file = null; - let isJson = fileType == 0 /* json */; - if (isJson) { - file = new Phaser2.Loader.FileTypes.JSONFile(loader, { - key, - url, - extension: "json", - xhrSettings - }); - } else { - file = new Phaser2.Loader.FileTypes.BinaryFile(loader, { - key, - url, - extension: "skel", - xhrSettings - }); - } - super(loader, SPINE_SKELETON_DATA_FILE_TYPE, key, [file]); - this.fileType = fileType; - } - onFileComplete(file) { - this.pending--; - } - addToCache() { - if (this.isReadyToProcess()) - this.files[0].addToCache(); - } - }; - var SpineAtlasFile = class extends Phaser2.Loader.MultiFile { - constructor(loader, key, url, premultipliedAlpha, xhrSettings) { - if (typeof key !== "string") { - const config = key; - key = config.key; - url = config.url; - premultipliedAlpha = config.premultipliedAlpha; - xhrSettings = config.xhrSettings; - } - super(loader, SPINE_ATLAS_FILE_TYPE, key, [ - new Phaser2.Loader.FileTypes.TextFile(loader, { - key, - url, - xhrSettings, - extension: "atlas" - }) - ]); - this.premultipliedAlpha = premultipliedAlpha; - } - onFileComplete(file) { - if (this.files.indexOf(file) != -1) { - this.pending--; - if (file.type == "text") { - var lines = file.data.split(/\r\n|\r|\n/); - let textures = []; - textures.push(lines[0]); - for (var t = 1; t < lines.length; t++) { - var line = lines[t]; - if (line.trim() === "" && t < lines.length - 1) { - line = lines[t + 1]; - textures.push(line); - } - } - let basePath = file.src.match(/^.*\//) ?? ""; - for (var i = 0; i < textures.length; i++) { - var url = basePath + textures[i]; - var key = file.key + "!" + textures[i]; - var image = new Phaser2.Loader.FileTypes.ImageFile(this.loader, key, url); - if (!this.loader.keyExists(image)) { - this.addToMultiFile(image); - this.loader.addFile(image); - } - } - } - } - } - addToCache() { - if (this.isReadyToProcess()) { - let textureManager = this.loader.textureManager; - for (let file of this.files) { - if (file.type == "image") { - if (!textureManager.exists(file.key)) { - textureManager.addImage(file.key, file.data); - } - } else { - this.premultipliedAlpha = this.premultipliedAlpha ?? (file.data.indexOf("pma: true") >= 0 || file.data.indexOf("pma:true") >= 0); - file.data = { - data: file.data, - premultipliedAlpha: this.premultipliedAlpha - }; - file.addToCache(); - } - } - } - } - }; - - // spine-phaser-v3/src/index.ts - window.spine = { SpinePlugin }; - window["spine.SpinePlugin"] = SpinePlugin; - return __toCommonJS(src_exports); -})(); -//# sourceMappingURL=spine-phaser-v3.js.map diff --git a/spine-ts/spine-phaser-v3/dist/iife/spine-phaser-v3.js.map b/spine-ts/spine-phaser-v3/dist/iife/spine-phaser-v3.js.map deleted file mode 100644 index 394b78976..000000000 --- a/spine-ts/spine-phaser-v3/dist/iife/spine-phaser-v3.js.map +++ /dev/null @@ -1,7 +0,0 @@ -{ - "version": 3, - "sources": ["../../src/index.ts", "../../src/require-shim.ts", "../../src/SpinePlugin.ts", "../../src/keys.ts", "../../../spine-core/src/Utils.ts", "../../../spine-core/src/attachments/Attachment.ts", "../../../spine-core/src/attachments/Sequence.ts", "../../../spine-core/src/Animation.ts", "../../../spine-core/src/AnimationState.ts", "../../../spine-core/src/AnimationStateData.ts", "../../../spine-core/src/attachments/BoundingBoxAttachment.ts", "../../../spine-core/src/attachments/ClippingAttachment.ts", "../../../spine-core/src/Texture.ts", "../../../spine-core/src/TextureAtlas.ts", "../../../spine-core/src/attachments/MeshAttachment.ts", "../../../spine-core/src/attachments/PathAttachment.ts", "../../../spine-core/src/attachments/PointAttachment.ts", "../../../spine-core/src/attachments/RegionAttachment.ts", "../../../spine-core/src/AtlasAttachmentLoader.ts", "../../../spine-core/src/BoneData.ts", "../../../spine-core/src/Bone.ts", "../../../spine-core/src/ConstraintData.ts", "../../../spine-core/src/AssetManagerBase.ts", "../../../spine-core/src/Event.ts", "../../../spine-core/src/EventData.ts", "../../../spine-core/src/IkConstraint.ts", "../../../spine-core/src/IkConstraintData.ts", "../../../spine-core/src/PathConstraintData.ts", "../../../spine-core/src/PathConstraint.ts", "../../../spine-core/src/PhysicsConstraint.ts", "../../../spine-core/src/Slot.ts", "../../../spine-core/src/TransformConstraint.ts", "../../../spine-core/src/Skeleton.ts", "../../../spine-core/src/PhysicsConstraintData.ts", "../../../spine-core/src/SkeletonData.ts", "../../../spine-core/src/Skin.ts", "../../../spine-core/src/SlotData.ts", "../../../spine-core/src/TransformConstraintData.ts", "../../../spine-core/src/SkeletonBinary.ts", "../../../spine-core/src/SkeletonBounds.ts", "../../../spine-core/src/Triangulator.ts", "../../../spine-core/src/SkeletonClipping.ts", "../../../spine-core/src/SkeletonJson.ts", "../../../spine-core/src/polyfills.ts", "../../../spine-webgl/src/WebGL.ts", "../../../spine-webgl/src/GLTexture.ts", "../../../spine-webgl/src/AssetManager.ts", "../../../spine-webgl/src/Vector3.ts", "../../../spine-webgl/src/Matrix4.ts", "../../../spine-webgl/src/Camera.ts", "../../../spine-webgl/src/Input.ts", "../../../spine-webgl/src/CameraController.ts", "../../../spine-webgl/src/Shader.ts", "../../../spine-webgl/src/Mesh.ts", "../../../spine-webgl/src/PolygonBatcher.ts", "../../../spine-webgl/src/ShapeRenderer.ts", "../../../spine-webgl/src/SkeletonDebugRenderer.ts", "../../../spine-webgl/src/SkeletonRenderer.ts", "../../../spine-webgl/src/SceneRenderer.ts", "../../../spine-webgl/src/LoadingScreen.ts", "../../../spine-webgl/src/SpineCanvas.ts", "../../src/mixins.ts", "../../src/SpineGameObject.ts", "../../../spine-canvas/src/CanvasTexture.ts", "../../../spine-canvas/src/SkeletonRenderer.ts"], - "sourcesContent": ["/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport * from \"./require-shim.js\"\nexport * from \"./SpinePlugin.js\"\nexport * from \"./SpineGameObject.js\"\nexport * from \"./mixins.js\"\nexport * from \"@esotericsoftware/spine-core\";\nexport * from \"@esotericsoftware/spine-webgl\";\nimport { SpineGameObjectConfig, SpinePlugin } from \"./SpinePlugin.js\";\n(window as any).spine = { SpinePlugin: SpinePlugin };\n(window as any)[\"spine.SpinePlugin\"] = SpinePlugin;\n\nimport { SpineGameObject, SpineGameObjectBoundsProvider } from \"./SpineGameObject.js\";\n\ndeclare global {\n\tnamespace Phaser.Loader {\n\t\texport interface LoaderPlugin {\n\t\t\tspineJson (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t\tspineBinary (key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t\tspineAtlas (key: string, url: string, premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin;\n\t\t}\n\t}\n\n\tnamespace Phaser.GameObjects {\n\t\texport interface GameObjectFactory {\n\t\t\tspine (x: number, y: number, dataKey: string, atlasKey: string, boundsProvider?: SpineGameObjectBoundsProvider): SpineGameObject;\n\t\t}\n\n\t\texport interface GameObjectCreator {\n\t\t\tspine (config: SpineGameObjectConfig, addToScene?: boolean): SpineGameObject;\n\t\t}\n\t}\n\n\tnamespace Phaser {\n\t\texport interface Scene {\n\t\t\tspine: SpinePlugin;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\ndeclare global {\n\tvar require: any;\n}\nif (typeof window !== 'undefined' && window.Phaser) {\n\tlet prevRequire = window.require;\n\twindow.require = (x: string) => {\n\t\tif (prevRequire) return prevRequire(x);\n\t\telse if (x === \"Phaser\") return window.Phaser;\n\t}\n}\nexport { }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport * as Phaser from \"phaser\";\nimport { SPINE_ATLAS_CACHE_KEY, SPINE_GAME_OBJECT_TYPE, SPINE_SKELETON_DATA_FILE_TYPE, SPINE_ATLAS_FILE_TYPE, SPINE_SKELETON_FILE_CACHE_KEY as SPINE_SKELETON_DATA_CACHE_KEY } from \"./keys.js\";\nimport { AtlasAttachmentLoader, GLTexture, SceneRenderer, Skeleton, SkeletonBinary, SkeletonData, SkeletonJson, TextureAtlas } from \"@esotericsoftware/spine-webgl\"\nimport { SpineGameObject, SpineGameObjectBoundsProvider } from \"./SpineGameObject.js\";\nimport { CanvasTexture, SkeletonRenderer } from \"@esotericsoftware/spine-canvas\";\n\n/**\n * Configuration object used when creating {@link SpineGameObject} instances via a scene's\n * {@link GameObjectCreator} (`Scene.make`).\n */\nexport interface SpineGameObjectConfig extends Phaser.Types.GameObjects.GameObjectConfig {\n\t/** The x-position of the object, optional, default: 0 */\n\tx?: number,\n\t/** The y-position of the object, optional, default: 0 */\n\ty?: number,\n\t/** The skeleton data key */\n\tdataKey: string,\n\t/** The atlas key */\n\tatlasKey: string\n\t/** The bounds provider, optional, default: `SetupPoseBoundsProvider` */\n\tboundsProvider?: SpineGameObjectBoundsProvider\n}\n\n/**\n * {@link ScenePlugin} implementation adding Spine Runtime capabilities to a scene.\n *\n * The scene's {@link LoaderPlugin} (`Scene.load`) gets these additional functions:\n * * `spineBinary(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`.\n * * `spineJson(key: string, url: string, xhrSettings?: XHRSettingsObject)`: loads a skeleton binary `.skel` file from the `url`.\n * * `spineAtlas(key: string, url: string, premultipliedAlpha: boolean = true, xhrSettings?: XHRSettingsObject)`: loads a texture atlas `.atlas` file from the `url` as well as its correponding texture atlas page images.\n *\n * The scene's {@link GameObjectFactory} (`Scene.add`) gets these additional functions:\n * * `spine(x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider = SetupPoseBoundsProvider())`:\n * creates a new {@link SpineGameObject} from the data and atlas at position `(x, y)`, using the {@link BoundsProvider} to calculate its bounding box. The object is automatically added to the scene.\n *\n * The scene's {@link GameObjectCreator} (`Scene.make`) gets these additional functions:\n * * `spine(config: SpineGameObjectConfig)`: creates a new {@link SpineGameObject} from the given configuration object.\n *\n * The plugin has additional public methods to work with Spine Runtime core API objects:\n * * `getAtlas(atlasKey: string)`: returns the {@link TextureAtlas} instance for the given atlas key.\n * * `getSkeletonData(skeletonDataKey: string)`: returns the {@link SkeletonData} instance for the given skeleton data key.\n * * `createSkeleton(skeletonDataKey: string, atlasKey: string, premultipliedAlpha: boolean = true)`: creates a new {@link Skeleton} instance from the given skeleton data and atlas key.\n * * `isPremultipliedAlpha(atlasKey: string)`: returns `true` if the atlas with the given key has premultiplied alpha.\n */\nexport class SpinePlugin extends Phaser.Plugins.ScenePlugin {\n\tgame: Phaser.Game;\n\tprivate isWebGL: boolean;\n\tgl: WebGLRenderingContext | null;\n\tstatic gameWebGLRenderer: SceneRenderer | null = null;\n\tget webGLRenderer (): SceneRenderer | null {\n\t\treturn SpinePlugin.gameWebGLRenderer;\n\t}\n\tcanvasRenderer: SkeletonRenderer | null;\n\tphaserRenderer: Phaser.Renderer.Canvas.CanvasRenderer | Phaser.Renderer.WebGL.WebGLRenderer;\n\tprivate skeletonDataCache: Phaser.Cache.BaseCache;\n\tprivate atlasCache: Phaser.Cache.BaseCache;\n\n\tconstructor (scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n\t\tsuper(scene, pluginManager, pluginKey);\n\t\tthis.game = pluginManager.game;\n\t\tthis.isWebGL = this.game.config.renderType === 2;\n\t\tthis.gl = this.isWebGL ? (this.game.renderer as Phaser.Renderer.WebGL.WebGLRenderer).gl : null;\n\t\tthis.phaserRenderer = this.game.renderer;\n\t\tthis.canvasRenderer = null;\n\t\tthis.skeletonDataCache = this.game.cache.addCustom(SPINE_SKELETON_DATA_CACHE_KEY);\n\t\tthis.atlasCache = this.game.cache.addCustom(SPINE_ATLAS_CACHE_KEY);\n\n\t\tlet skeletonJsonFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineSkeletonDataFile(this as any, key, url, SpineSkeletonDataFileType.json, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineJson\", skeletonJsonFileCallback, scene);\n\n\t\tlet skeletonBinaryFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineSkeletonDataFile(this as any, key, url, SpineSkeletonDataFileType.binary, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineBinary\", skeletonBinaryFileCallback, scene);\n\n\t\tlet atlasFileCallback = function (this: any, key: string,\n\t\t\turl: string,\n\t\t\tpremultipliedAlpha: boolean,\n\t\t\txhrSettings: Phaser.Types.Loader.XHRSettingsObject) {\n\t\t\tlet file = new SpineAtlasFile(this as any, key, url, premultipliedAlpha, xhrSettings);\n\t\t\tthis.addFile(file.files);\n\t\t\treturn this;\n\t\t};\n\t\tpluginManager.registerFileType(\"spineAtlas\", atlasFileCallback, scene);\n\n\t\tlet addSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, x: number, y: number, dataKey: string, atlasKey: string, boundsProvider: SpineGameObjectBoundsProvider) {\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.clear();\n\t\t\t}\n\n\t\t\tconst spinePlugin = (this.scene.sys as any)[pluginKey] as SpinePlugin;\n\t\t\tlet gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, dataKey, atlasKey, boundsProvider);\n\t\t\tthis.displayList.add(gameObject);\n\t\t\tthis.updateList.add(gameObject);\n\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.rebind();\n\t\t\t}\n\n\t\t\treturn gameObject;\n\t\t};\n\n\t\tlet makeSpineGameObject = function (this: Phaser.GameObjects.GameObjectFactory, config: SpineGameObjectConfig, addToScene: boolean = false) {\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.clear();\n\t\t\t}\n\n\t\t\tlet x = config.x ? config.x : 0;\n\t\t\tlet y = config.y ? config.y : 0;\n\t\t\tlet boundsProvider = config.boundsProvider ? config.boundsProvider : undefined;\n\n\t\t\tconst spinePlugin = (this.scene.sys as any)[pluginKey] as SpinePlugin;\n\t\t\tlet gameObject = new SpineGameObject(this.scene, spinePlugin, x, y, config.dataKey, config.atlasKey, boundsProvider);\n\t\t\tif (addToScene !== undefined) {\n\t\t\t\tconfig.add = addToScene;\n\t\t\t}\n\n\t\t\tif (this.scene.sys.renderer instanceof Phaser.Renderer.WebGL.WebGLRenderer) {\n\t\t\t\tthis.scene.sys.renderer.pipelines.rebind();\n\t\t\t}\n\n\t\t\treturn Phaser.GameObjects.BuildGameObject(this.scene, gameObject, config);\n\t\t}\n\t\tpluginManager.registerGameObject((window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, addSpineGameObject, makeSpineGameObject);\n\t}\n\n\tstatic rendererId = 0;\n\tboot () {\n\t\tSkeleton.yDown = true;\n\t\tif (this.isWebGL) {\n\t\t\tif (!SpinePlugin.gameWebGLRenderer) {\n\t\t\t\tSpinePlugin.gameWebGLRenderer = new SceneRenderer((this.game.renderer! as Phaser.Renderer.WebGL.WebGLRenderer).canvas, this.gl!, true);\n\t\t\t}\n\t\t\tthis.onResize();\n\t\t\tthis.game.scale.on(Phaser.Scale.Events.RESIZE, this.onResize, this);\n\t\t} else {\n\t\t\tif (!this.canvasRenderer) {\n\t\t\t\tthis.canvasRenderer = new SkeletonRenderer(this.scene!.sys.context);\n\t\t\t}\n\t\t}\n\n\t\tvar eventEmitter = this.systems!.events;\n\t\teventEmitter.once('shutdown', this.shutdown, this);\n\t\teventEmitter.once('destroy', this.destroy, this);\n\t\tthis.game.events.once('destroy', this.gameDestroy, this);\n\t}\n\n\tonResize () {\n\t\tvar phaserRenderer = this.game.renderer;\n\t\tvar sceneRenderer = this.webGLRenderer;\n\n\t\tif (phaserRenderer && sceneRenderer) {\n\t\t\tvar viewportWidth = phaserRenderer.width;\n\t\t\tvar viewportHeight = phaserRenderer.height;\n\t\t\tsceneRenderer.camera.position.x = viewportWidth / 2;\n\t\t\tsceneRenderer.camera.position.y = viewportHeight / 2;\n\t\t\tsceneRenderer.camera.up.y = -1;\n\t\t\tsceneRenderer.camera.direction.z = 1;\n\t\t\tsceneRenderer.camera.setViewport(viewportWidth, viewportHeight);\n\t\t}\n\t}\n\n\tshutdown () {\n\t\tthis.systems!.events.off(\"shutdown\", this.shutdown, this);\n\t\tif (this.isWebGL) {\n\t\t\tthis.game.scale.off(Phaser.Scale.Events.RESIZE, this.onResize, this);\n\t\t}\n\t}\n\n\tdestroy () {\n\t\tthis.shutdown()\n\t}\n\n\tgameDestroy () {\n\t\tthis.pluginManager.removeGameObject((window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE, true, true);\n\t\tif (this.webGLRenderer) this.webGLRenderer.dispose();\n\t\tSpinePlugin.gameWebGLRenderer = null;\n\t}\n\n\t/** Returns the TextureAtlas instance for the given key */\n\tgetAtlas (atlasKey: string) {\n\t\tlet atlas: TextureAtlas;\n\t\tif (this.atlasCache.exists(atlasKey)) {\n\t\t\tatlas = this.atlasCache.get(atlasKey);\n\t\t} else {\n\t\t\tlet atlasFile = this.game.cache.text.get(atlasKey) as { data: string, premultipliedAlpha: boolean };\n\t\t\tatlas = new TextureAtlas(atlasFile.data);\n\t\t\tif (this.isWebGL) {\n\t\t\t\tlet gl = this.gl!;\n\t\t\t\tconst phaserUnpackPmaValue = gl.getParameter(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL);\n\t\t\t\tif (phaserUnpackPmaValue) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\t\t\t\tfor (let atlasPage of atlas.pages) {\n\t\t\t\t\tatlasPage.setTexture(new GLTexture(gl, this.game.textures.get(atlasKey + \"!\" + atlasPage.name).getSourceImage() as HTMLImageElement | ImageBitmap, false));\n\t\t\t\t}\n\t\t\t\tif (phaserUnpackPmaValue) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n\t\t\t} else {\n\t\t\t\tfor (let atlasPage of atlas.pages) {\n\t\t\t\t\tatlasPage.setTexture(new CanvasTexture(this.game.textures.get(atlasKey + \"!\" + atlasPage.name).getSourceImage() as HTMLImageElement | ImageBitmap));\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.atlasCache.add(atlasKey, atlas);\n\t\t}\n\t\treturn atlas;\n\t}\n\n\t/** Returns whether the TextureAtlas uses premultiplied alpha */\n\tisAtlasPremultiplied (atlasKey: string) {\n\t\tlet atlasFile = this.game.cache.text.get(atlasKey);\n\t\tif (!atlasFile) return false;\n\t\treturn atlasFile.premultipliedAlpha;\n\t}\n\n\t/** Returns the SkeletonData instance for the given data and atlas key */\n\tgetSkeletonData (dataKey: string, atlasKey: string) {\n\t\tconst atlas = this.getAtlas(atlasKey)\n\t\tconst combinedKey = dataKey + atlasKey;\n\t\tlet skeletonData: SkeletonData;\n\t\tif (this.skeletonDataCache.exists(combinedKey)) {\n\t\t\tskeletonData = this.skeletonDataCache.get(combinedKey);\n\t\t} else {\n\t\t\tif (this.game.cache.json.exists(dataKey)) {\n\t\t\t\tlet jsonFile = this.game.cache.json.get(dataKey) as any;\n\t\t\t\tlet json = new SkeletonJson(new AtlasAttachmentLoader(atlas));\n\t\t\t\tskeletonData = json.readSkeletonData(jsonFile);\n\t\t\t} else {\n\t\t\t\tlet binaryFile = this.game.cache.binary.get(dataKey) as ArrayBuffer;\n\t\t\t\tlet binary = new SkeletonBinary(new AtlasAttachmentLoader(atlas));\n\t\t\t\tskeletonData = binary.readSkeletonData(new Uint8Array(binaryFile));\n\t\t\t}\n\t\t\tthis.skeletonDataCache.add(combinedKey, skeletonData);\n\t\t}\n\t\treturn skeletonData;\n\t}\n\n\t/** Creates a new Skeleton instance from the data and atlas. */\n\tcreateSkeleton (dataKey: string, atlasKey: string) {\n\t\treturn new Skeleton(this.getSkeletonData(dataKey, atlasKey));\n\t}\n}\n\nenum SpineSkeletonDataFileType {\n\tjson,\n\tbinary\n}\n\ninterface SpineSkeletonDataFileConfig {\n\tkey: string;\n\turl: string;\n\ttype: \"spineJson\" | \"spineBinary\";\n\txhrSettings?: Phaser.Types.Loader.XHRSettingsObject\n}\n\nclass SpineSkeletonDataFile extends Phaser.Loader.MultiFile {\n\tconstructor (loader: Phaser.Loader.LoaderPlugin, key: string | SpineSkeletonDataFileConfig, url?: string, public fileType?: SpineSkeletonDataFileType, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject) {\n\t\tif (typeof key !== \"string\") {\n\t\t\tconst config = key;\n\t\t\tkey = config.key;\n\t\t\turl = config.url;\n\t\t\tfileType = config.type === \"spineJson\" ? SpineSkeletonDataFileType.json : SpineSkeletonDataFileType.binary;\n\t\t\txhrSettings = config.xhrSettings;\n\t\t}\n\t\tlet file = null;\n\t\tlet isJson = fileType == SpineSkeletonDataFileType.json;\n\t\tif (isJson) {\n\t\t\tfile = new Phaser.Loader.FileTypes.JSONFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\textension: \"json\",\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t} as Phaser.Types.Loader.FileTypes.JSONFileConfig);\n\t\t} else {\n\t\t\tfile = new Phaser.Loader.FileTypes.BinaryFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\textension: \"skel\",\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t} as Phaser.Types.Loader.FileTypes.BinaryFileConfig);\n\t\t}\n\t\tsuper(loader, SPINE_SKELETON_DATA_FILE_TYPE, key, [file]);\n\t}\n\n\tonFileComplete (file: Phaser.Loader.File) {\n\t\tthis.pending--;\n\t}\n\n\taddToCache () {\n\t\tif (this.isReadyToProcess()) this.files[0].addToCache();\n\t}\n}\n\ninterface SpineAtlasFileConfig {\n\tkey: string;\n\turl: string;\n\tpremultipliedAlpha?: boolean;\n\txhrSettings?: Phaser.Types.Loader.XHRSettingsObject;\n}\n\nclass SpineAtlasFile extends Phaser.Loader.MultiFile {\n\tconstructor (loader: Phaser.Loader.LoaderPlugin, key: string | SpineAtlasFileConfig, url?: string, public premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject) {\n\t\tif (typeof key !== \"string\") {\n\t\t\tconst config = key;\n\t\t\tkey = config.key;\n\t\t\turl = config.url;\n\t\t\tpremultipliedAlpha = config.premultipliedAlpha;\n\t\t\txhrSettings = config.xhrSettings;\n\t\t}\n\n\t\tsuper(loader, SPINE_ATLAS_FILE_TYPE, key, [\n\t\t\tnew Phaser.Loader.FileTypes.TextFile(loader, {\n\t\t\t\tkey: key,\n\t\t\t\turl: url,\n\t\t\t\txhrSettings: xhrSettings,\n\t\t\t\textension: \"atlas\"\n\t\t\t})\n\t\t]);\n\t}\n\n\tonFileComplete (file: Phaser.Loader.File) {\n\t\tif (this.files.indexOf(file) != -1) {\n\t\t\tthis.pending--;\n\n\t\t\tif (file.type == \"text\") {\n\t\t\t\tvar lines = file.data.split(/\\r\\n|\\r|\\n/);\n\t\t\t\tlet textures = [];\n\t\t\t\ttextures.push(lines[0]);\n\t\t\t\tfor (var t = 1; t < lines.length; t++) {\n\t\t\t\t\tvar line = lines[t];\n\t\t\t\t\tif (line.trim() === '' && t < lines.length - 1) {\n\t\t\t\t\t\tline = lines[t + 1];\n\t\t\t\t\t\ttextures.push(line);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlet basePath = file.src.match(/^.*\\//) ?? \"\";\n\t\t\t\tfor (var i = 0; i < textures.length; i++) {\n\t\t\t\t\tvar url = basePath + textures[i];\n\t\t\t\t\tvar key = file.key + \"!\" + textures[i];\n\t\t\t\t\tvar image = new Phaser.Loader.FileTypes.ImageFile(this.loader, key, url);\n\n\t\t\t\t\tif (!this.loader.keyExists(image)) {\n\t\t\t\t\t\tthis.addToMultiFile(image);\n\t\t\t\t\t\tthis.loader.addFile(image);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\taddToCache () {\n\t\tif (this.isReadyToProcess()) {\n\t\t\tlet textureManager = this.loader.textureManager;\n\t\t\tfor (let file of this.files) {\n\t\t\t\tif (file.type == \"image\") {\n\t\t\t\t\tif (!textureManager.exists(file.key)) {\n\t\t\t\t\t\ttextureManager.addImage(file.key, file.data);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.premultipliedAlpha = this.premultipliedAlpha ?? (file.data.indexOf(\"pma: true\") >= 0 || file.data.indexOf(\"pma:true\") >= 0);\n\t\t\t\t\tfile.data = {\n\t\t\t\t\t\tdata: file.data,\n\t\t\t\t\t\tpremultipliedAlpha: this.premultipliedAlpha,\n\t\t\t\t\t};\n\t\t\t\t\tfile.addToCache();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport const SPINE_SKELETON_FILE_CACHE_KEY = \"esotericsoftware.spine.skeletonFile.cache\";\nexport const SPINE_ATLAS_CACHE_KEY = \"esotericsoftware.spine.atlas.cache\";\nexport const SPINE_LOADER_TYPE = \"spine\";\nexport const SPINE_SKELETON_DATA_FILE_TYPE = \"spineSkeletonData\";\nexport const SPINE_ATLAS_FILE_TYPE = \"spineAtlasData\";\nexport const SPINE_GAME_OBJECT_TYPE = \"spine\";\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Skeleton } from \"./Skeleton.js\";\nimport { MixBlend } from \"./Animation.js\";\n\nexport interface StringMap {\n\t[key: string]: T;\n}\n\nexport class IntSet {\n\tarray = new Array();\n\n\tadd (value: number): boolean {\n\t\tlet contains = this.contains(value);\n\t\tthis.array[value | 0] = value | 0;\n\t\treturn !contains;\n\t}\n\n\tcontains (value: number) {\n\t\treturn this.array[value | 0] != undefined;\n\t}\n\n\tremove (value: number) {\n\t\tthis.array[value | 0] = undefined;\n\t}\n\n\tclear () {\n\t\tthis.array.length = 0;\n\t}\n}\n\nexport class StringSet {\n\tentries: StringMap = {};\n\tsize = 0;\n\n\tadd (value: string): boolean {\n\t\tlet contains = this.entries[value];\n\t\tthis.entries[value] = true;\n\t\tif (!contains) {\n\t\t\tthis.size++;\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\taddAll (values: string[]): boolean {\n\t\tlet oldSize = this.size;\n\t\tfor (var i = 0, n = values.length; i < n; i++)\n\t\t\tthis.add(values[i]);\n\t\treturn oldSize != this.size;\n\t}\n\n\tcontains (value: string) {\n\t\treturn this.entries[value];\n\t}\n\n\tclear () {\n\t\tthis.entries = {};\n\t\tthis.size = 0;\n\t}\n}\n\nexport type NumberArrayLike = Array | Float32Array;\nexport type IntArrayLike = Array | Int16Array;\n\nexport interface Disposable {\n\tdispose (): void;\n}\n\nexport interface Restorable {\n\trestore (): void;\n}\n\nexport class Color {\n\tpublic static WHITE = new Color(1, 1, 1, 1);\n\tpublic static RED = new Color(1, 0, 0, 1);\n\tpublic static GREEN = new Color(0, 1, 0, 1);\n\tpublic static BLUE = new Color(0, 0, 1, 1);\n\tpublic static MAGENTA = new Color(1, 0, 1, 1);\n\n\tconstructor (public r: number = 0, public g: number = 0, public b: number = 0, public a: number = 0) {\n\t}\n\n\tset (r: number, g: number, b: number, a: number) {\n\t\tthis.r = r;\n\t\tthis.g = g;\n\t\tthis.b = b;\n\t\tthis.a = a;\n\t\treturn this.clamp();\n\t}\n\n\tsetFromColor (c: Color) {\n\t\tthis.r = c.r;\n\t\tthis.g = c.g;\n\t\tthis.b = c.b;\n\t\tthis.a = c.a;\n\t\treturn this;\n\t}\n\n\tsetFromString (hex: string) {\n\t\thex = hex.charAt(0) == '#' ? hex.substr(1) : hex;\n\t\tthis.r = parseInt(hex.substr(0, 2), 16) / 255;\n\t\tthis.g = parseInt(hex.substr(2, 2), 16) / 255;\n\t\tthis.b = parseInt(hex.substr(4, 2), 16) / 255;\n\t\tthis.a = hex.length != 8 ? 1 : parseInt(hex.substr(6, 2), 16) / 255;\n\t\treturn this;\n\t}\n\n\tadd (r: number, g: number, b: number, a: number) {\n\t\tthis.r += r;\n\t\tthis.g += g;\n\t\tthis.b += b;\n\t\tthis.a += a;\n\t\treturn this.clamp();\n\t}\n\n\tclamp () {\n\t\tif (this.r < 0) this.r = 0;\n\t\telse if (this.r > 1) this.r = 1;\n\n\t\tif (this.g < 0) this.g = 0;\n\t\telse if (this.g > 1) this.g = 1;\n\n\t\tif (this.b < 0) this.b = 0;\n\t\telse if (this.b > 1) this.b = 1;\n\n\t\tif (this.a < 0) this.a = 0;\n\t\telse if (this.a > 1) this.a = 1;\n\t\treturn this;\n\t}\n\n\tstatic rgba8888ToColor (color: Color, value: number) {\n\t\tcolor.r = ((value & 0xff000000) >>> 24) / 255;\n\t\tcolor.g = ((value & 0x00ff0000) >>> 16) / 255;\n\t\tcolor.b = ((value & 0x0000ff00) >>> 8) / 255;\n\t\tcolor.a = ((value & 0x000000ff)) / 255;\n\t}\n\n\tstatic rgb888ToColor (color: Color, value: number) {\n\t\tcolor.r = ((value & 0x00ff0000) >>> 16) / 255;\n\t\tcolor.g = ((value & 0x0000ff00) >>> 8) / 255;\n\t\tcolor.b = ((value & 0x000000ff)) / 255;\n\t}\n\n\ttoRgb888 () {\n\t\tconst hex = (x: number) => (\"0\" + (x * 255).toString(16)).slice(-2);\n\t\treturn Number(\"0x\" + hex(this.r) + hex(this.g) + hex(this.b));\n\t}\n\n\tstatic fromString (hex: string): Color {\n\t\treturn new Color().setFromString(hex);\n\t}\n}\n\nexport class MathUtils {\n\tstatic PI = 3.1415927;\n\tstatic PI2 = MathUtils.PI * 2;\n\tstatic invPI2 = 1 / MathUtils.PI2;\n\tstatic radiansToDegrees = 180 / MathUtils.PI;\n\tstatic radDeg = MathUtils.radiansToDegrees;\n\tstatic degreesToRadians = MathUtils.PI / 180;\n\tstatic degRad = MathUtils.degreesToRadians;\n\n\tstatic clamp (value: number, min: number, max: number) {\n\t\tif (value < min) return min;\n\t\tif (value > max) return max;\n\t\treturn value;\n\t}\n\n\tstatic cosDeg (degrees: number) {\n\t\treturn Math.cos(degrees * MathUtils.degRad);\n\t}\n\n\tstatic sinDeg (degrees: number) {\n\t\treturn Math.sin(degrees * MathUtils.degRad);\n\t}\n\n\tstatic atan2Deg (y: number, x: number) {\n\t\treturn Math.atan2(y, x) * MathUtils.degRad;\n\t}\n\n\tstatic signum (value: number): number {\n\t\treturn value > 0 ? 1 : value < 0 ? -1 : 0;\n\t}\n\n\tstatic toInt (x: number) {\n\t\treturn x > 0 ? Math.floor(x) : Math.ceil(x);\n\t}\n\n\tstatic cbrt (x: number) {\n\t\tlet y = Math.pow(Math.abs(x), 1 / 3);\n\t\treturn x < 0 ? -y : y;\n\t}\n\n\tstatic randomTriangular (min: number, max: number): number {\n\t\treturn MathUtils.randomTriangularWith(min, max, (min + max) * 0.5);\n\t}\n\n\tstatic randomTriangularWith (min: number, max: number, mode: number): number {\n\t\tlet u = Math.random();\n\t\tlet d = max - min;\n\t\tif (u <= (mode - min) / d) return min + Math.sqrt(u * d * (mode - min));\n\t\treturn max - Math.sqrt((1 - u) * d * (max - mode));\n\t}\n\n\tstatic isPowerOfTwo (value: number) {\n\t\treturn value && (value & (value - 1)) === 0;\n\t}\n}\n\nexport abstract class Interpolation {\n\tprotected abstract applyInternal (a: number): number;\n\tapply (start: number, end: number, a: number): number {\n\t\treturn start + (end - start) * this.applyInternal(a);\n\t}\n}\n\nexport class Pow extends Interpolation {\n\tprotected power = 2;\n\n\tconstructor (power: number) {\n\t\tsuper();\n\t\tthis.power = power;\n\t}\n\n\tapplyInternal (a: number): number {\n\t\tif (a <= 0.5) return Math.pow(a * 2, this.power) / 2;\n\t\treturn Math.pow((a - 1) * 2, this.power) / (this.power % 2 == 0 ? -2 : 2) + 1;\n\t}\n}\n\nexport class PowOut extends Pow {\n\tconstructor (power: number) {\n\t\tsuper(power);\n\t}\n\n\tapplyInternal (a: number): number {\n\t\treturn Math.pow(a - 1, this.power) * (this.power % 2 == 0 ? -1 : 1) + 1;\n\t}\n}\n\nexport class Utils {\n\tstatic SUPPORTS_TYPED_ARRAYS = typeof (Float32Array) !== \"undefined\";\n\n\tstatic arrayCopy (source: ArrayLike, sourceStart: number, dest: ArrayLike, destStart: number, numElements: number) {\n\t\tfor (let i = sourceStart, j = destStart; i < sourceStart + numElements; i++, j++) {\n\t\t\tdest[j] = source[i];\n\t\t}\n\t}\n\n\tstatic arrayFill (array: ArrayLike, fromIndex: number, toIndex: number, value: T) {\n\t\tfor (let i = fromIndex; i < toIndex; i++)\n\t\t\tarray[i] = value;\n\t}\n\n\tstatic setArraySize (array: Array, size: number, value: any = 0): Array {\n\t\tlet oldSize = array.length;\n\t\tif (oldSize == size) return array;\n\t\tarray.length = size;\n\t\tif (oldSize < size) {\n\t\t\tfor (let i = oldSize; i < size; i++) array[i] = value;\n\t\t}\n\t\treturn array;\n\t}\n\n\tstatic ensureArrayCapacity (array: Array, size: number, value: any = 0): Array {\n\t\tif (array.length >= size) return array;\n\t\treturn Utils.setArraySize(array, size, value);\n\t}\n\n\tstatic newArray (size: number, defaultValue: T): Array {\n\t\tlet array = new Array(size);\n\t\tfor (let i = 0; i < size; i++) array[i] = defaultValue;\n\t\treturn array;\n\t}\n\n\tstatic newFloatArray (size: number): NumberArrayLike {\n\t\tif (Utils.SUPPORTS_TYPED_ARRAYS)\n\t\t\treturn new Float32Array(size)\n\t\telse {\n\t\t\tlet array = new Array(size);\n\t\t\tfor (let i = 0; i < array.length; i++) array[i] = 0;\n\t\t\treturn array;\n\t\t}\n\t}\n\n\tstatic newShortArray (size: number): IntArrayLike {\n\t\tif (Utils.SUPPORTS_TYPED_ARRAYS)\n\t\t\treturn new Int16Array(size)\n\t\telse {\n\t\t\tlet array = new Array(size);\n\t\t\tfor (let i = 0; i < array.length; i++) array[i] = 0;\n\t\t\treturn array;\n\t\t}\n\t}\n\n\tstatic toFloatArray (array: Array) {\n\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? new Float32Array(array) : array;\n\t}\n\n\tstatic toSinglePrecision (value: number) {\n\t\treturn Utils.SUPPORTS_TYPED_ARRAYS ? Math.fround(value) : value;\n\t}\n\n\t// This function is used to fix WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\tstatic webkit602BugfixHelper (alpha: number, blend: MixBlend) {\n\t}\n\n\tstatic contains (array: Array, element: T, identity = true) {\n\t\tfor (var i = 0; i < array.length; i++)\n\t\t\tif (array[i] == element) return true;\n\t\treturn false;\n\t}\n\n\tstatic enumValue (type: any, name: string) {\n\t\treturn type[name[0].toUpperCase() + name.slice(1)];\n\t}\n}\n\nexport class DebugUtils {\n\tstatic logBones (skeleton: Skeleton) {\n\t\tfor (let i = 0; i < skeleton.bones.length; i++) {\n\t\t\tlet bone = skeleton.bones[i];\n\t\t\tconsole.log(bone.data.name + \", \" + bone.a + \", \" + bone.b + \", \" + bone.c + \", \" + bone.d + \", \" + bone.worldX + \", \" + bone.worldY);\n\t\t}\n\t}\n}\n\nexport class Pool {\n\tprivate items = new Array();\n\tprivate instantiator: () => T;\n\n\tconstructor (instantiator: () => T) {\n\t\tthis.instantiator = instantiator;\n\t}\n\n\tobtain () {\n\t\treturn this.items.length > 0 ? this.items.pop()! : this.instantiator();\n\t}\n\n\tfree (item: T) {\n\t\tif ((item as any).reset) (item as any).reset();\n\t\tthis.items.push(item);\n\t}\n\n\tfreeAll (items: ArrayLike) {\n\t\tfor (let i = 0; i < items.length; i++)\n\t\t\tthis.free(items[i]);\n\t}\n\n\tclear () {\n\t\tthis.items.length = 0;\n\t}\n}\n\nexport class Vector2 {\n\tconstructor (public x = 0, public y = 0) {\n\t}\n\n\tset (x: number, y: number): Vector2 {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\treturn this;\n\t}\n\n\tlength () {\n\t\tlet x = this.x;\n\t\tlet y = this.y;\n\t\treturn Math.sqrt(x * x + y * y);\n\t}\n\n\tnormalize () {\n\t\tlet len = this.length();\n\t\tif (len != 0) {\n\t\t\tthis.x /= len;\n\t\t\tthis.y /= len;\n\t\t}\n\t\treturn this;\n\t}\n}\n\nexport class TimeKeeper {\n\tmaxDelta = 0.064;\n\tframesPerSecond = 0;\n\tdelta = 0;\n\ttotalTime = 0;\n\n\tprivate lastTime = Date.now() / 1000;\n\tprivate frameCount = 0;\n\tprivate frameTime = 0;\n\n\tupdate () {\n\t\tlet now = Date.now() / 1000;\n\t\tthis.delta = now - this.lastTime;\n\t\tthis.frameTime += this.delta;\n\t\tthis.totalTime += this.delta;\n\t\tif (this.delta > this.maxDelta) this.delta = this.maxDelta;\n\t\tthis.lastTime = now;\n\n\t\tthis.frameCount++;\n\t\tif (this.frameTime > 1) {\n\t\t\tthis.framesPerSecond = this.frameCount / this.frameTime;\n\t\t\tthis.frameTime = 0;\n\t\t\tthis.frameCount = 0;\n\t\t}\n\t}\n}\n\nexport interface ArrayLike {\n\tlength: number;\n\t[n: number]: T;\n}\n\nexport class WindowedMean {\n\tvalues: Array;\n\taddedValues = 0;\n\tlastValue = 0;\n\tmean = 0;\n\tdirty = true;\n\n\tconstructor (windowSize: number = 32) {\n\t\tthis.values = new Array(windowSize);\n\t}\n\n\thasEnoughData () {\n\t\treturn this.addedValues >= this.values.length;\n\t}\n\n\taddValue (value: number) {\n\t\tif (this.addedValues < this.values.length) this.addedValues++;\n\t\tthis.values[this.lastValue++] = value;\n\t\tif (this.lastValue > this.values.length - 1) this.lastValue = 0;\n\t\tthis.dirty = true;\n\t}\n\n\tgetMean () {\n\t\tif (this.hasEnoughData()) {\n\t\t\tif (this.dirty) {\n\t\t\t\tlet mean = 0;\n\t\t\t\tfor (let i = 0; i < this.values.length; i++)\n\t\t\t\t\tmean += this.values[i];\n\t\t\t\tthis.mean = mean / this.values.length;\n\t\t\t\tthis.dirty = false;\n\t\t\t}\n\t\t\treturn this.mean;\n\t\t}\n\t\treturn 0;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Slot } from \"../Slot.js\";\nimport { NumberArrayLike, Utils } from \"../Utils.js\";\n\n/** The base class for all attachments. */\nexport abstract class Attachment {\n\tname: string;\n\n\tconstructor (name: string) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t}\n\n\tabstract copy (): Attachment;\n}\n\n/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's\n * {@link Slot#deform}. */\nexport abstract class VertexAttachment extends Attachment {\n\tprivate static nextID = 0;\n\n\t/** The unique ID for this attachment. */\n\tid = VertexAttachment.nextID++;\n\n\t/** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting\n\t * the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#bones}. Will be null\n\t * if this attachment has no weights. */\n\tbones: Array | null = null;\n\n\t/** The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are `x,y`\n\t * entries for each vertex. For a weighted attachment, the values are `x,y,weight` entries for each bone affecting\n\t * each vertex. */\n\tvertices: NumberArrayLike = [];\n\n\t/** The maximum number of world vertex values that can be output by\n\t * {@link #computeWorldVertices()} using the `count` parameter. */\n\tworldVerticesLength = 0;\n\n\t/** Timelines for the timeline attachment are also applied to this attachment.\n\t * May be null if no attachment-specific timelines should be applied. */\n\ttimelineAttachment: Attachment = this;\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\t/** Transforms the attachment's local {@link #vertices} to world coordinates. If the slot's {@link Slot#deform} is\n\t * not empty, it is used to deform the vertices.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide.\n\t * @param start The index of the first {@link #vertices} value to transform. Each vertex has 2 values, x and y.\n\t * @param count The number of world vertex values to output. Must be <= {@link #worldVerticesLength} - `start`.\n\t * @param worldVertices The output world vertices. Must have a length >= `offset` + `count` *\n\t * `stride` / 2.\n\t * @param offset The `worldVertices` index to begin writing values.\n\t * @param stride The number of `worldVertices` entries between the value pairs written. */\n\tcomputeWorldVertices (slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tcount = offset + (count >> 1) * stride;\n\t\tlet skeleton = slot.bone.skeleton;\n\t\tlet deformArray = slot.deform;\n\t\tlet vertices = this.vertices;\n\t\tlet bones = this.bones;\n\t\tif (!bones) {\n\t\t\tif (deformArray.length > 0) vertices = deformArray;\n\t\t\tlet bone = slot.bone;\n\t\t\tlet x = bone.worldX;\n\t\t\tlet y = bone.worldY;\n\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\tfor (let v = start, w = offset; w < count; v += 2, w += stride) {\n\t\t\t\tlet vx = vertices[v], vy = vertices[v + 1];\n\t\t\t\tworldVertices[w] = vx * a + vy * b + x;\n\t\t\t\tworldVertices[w + 1] = vx * c + vy * d + y;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet v = 0, skip = 0;\n\t\tfor (let i = 0; i < start; i += 2) {\n\t\t\tlet n = bones[v];\n\t\t\tv += n + 1;\n\t\t\tskip += n;\n\t\t}\n\t\tlet skeletonBones = skeleton.bones;\n\t\tif (deformArray.length == 0) {\n\t\t\tfor (let w = offset, b = skip * 3; w < count; w += stride) {\n\t\t\t\tlet wx = 0, wy = 0;\n\t\t\t\tlet n = bones[v++];\n\t\t\t\tn += v;\n\t\t\t\tfor (; v < n; v++, b += 3) {\n\t\t\t\t\tlet bone = skeletonBones[bones[v]];\n\t\t\t\t\tlet vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2];\n\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n\t\t\t\t}\n\t\t\t\tworldVertices[w] = wx;\n\t\t\t\tworldVertices[w + 1] = wy;\n\t\t\t}\n\t\t} else {\n\t\t\tlet deform = deformArray;\n\t\t\tfor (let w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) {\n\t\t\t\tlet wx = 0, wy = 0;\n\t\t\t\tlet n = bones[v++];\n\t\t\t\tn += v;\n\t\t\t\tfor (; v < n; v++, b += 3, f += 2) {\n\t\t\t\t\tlet bone = skeletonBones[bones[v]];\n\t\t\t\t\tlet vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2];\n\t\t\t\t\twx += (vx * bone.a + vy * bone.b + bone.worldX) * weight;\n\t\t\t\t\twy += (vx * bone.c + vy * bone.d + bone.worldY) * weight;\n\t\t\t\t}\n\t\t\t\tworldVertices[w] = wx;\n\t\t\t\tworldVertices[w + 1] = wy;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Does not copy id (generated) or name (set on construction). **/\n\tcopyTo (attachment: VertexAttachment) {\n\t\tif (this.bones) {\n\t\t\tattachment.bones = new Array(this.bones.length);\n\t\t\tUtils.arrayCopy(this.bones, 0, attachment.bones, 0, this.bones.length);\n\t\t} else\n\t\t\tattachment.bones = null;\n\n\t\tif (this.vertices) {\n\t\t\tattachment.vertices = Utils.newFloatArray(this.vertices.length);\n\t\t\tUtils.arrayCopy(this.vertices, 0, attachment.vertices, 0, this.vertices.length);\n\t\t}\n\n\t\tattachment.worldVerticesLength = this.worldVerticesLength;\n\t\tattachment.timelineAttachment = this.timelineAttachment;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TextureRegion } from \"../Texture.js\";\nimport { Slot } from \"../Slot.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Utils } from \"../Utils.js\";\n\n\nexport class Sequence {\n\tprivate static _nextID = 0;\n\n\tid = Sequence.nextID();\n\tregions: TextureRegion[];\n\tstart = 0;\n\tdigits = 0;\n\t/** The index of the region to show for the setup pose. */\n\tsetupIndex = 0;\n\n\tconstructor (count: number) {\n\t\tthis.regions = new Array(count);\n\t}\n\n\tcopy (): Sequence {\n\t\tlet copy = new Sequence(this.regions.length);\n\t\tUtils.arrayCopy(this.regions, 0, copy.regions, 0, this.regions.length);\n\t\tcopy.start = this.start;\n\t\tcopy.digits = this.digits;\n\t\tcopy.setupIndex = this.setupIndex;\n\t\treturn copy;\n\t}\n\n\tapply (slot: Slot, attachment: HasTextureRegion) {\n\t\tlet index = slot.sequenceIndex;\n\t\tif (index == -1) index = this.setupIndex;\n\t\tif (index >= this.regions.length) index = this.regions.length - 1;\n\t\tlet region = this.regions[index];\n\t\tif (attachment.region != region) {\n\t\t\tattachment.region = region;\n\t\t\tattachment.updateRegion();\n\t\t}\n\t}\n\n\tgetPath (basePath: string, index: number): string {\n\t\tlet result = basePath;\n\t\tlet frame = (this.start + index).toString();\n\t\tfor (let i = this.digits - frame.length; i > 0; i--)\n\t\t\tresult += \"0\";\n\t\tresult += frame;\n\t\treturn result;\n\t}\n\n\tprivate static nextID (): number {\n\t\treturn Sequence._nextID++;\n\t}\n}\n\nexport enum SequenceMode {\n\thold = 0,\n\tonce = 1,\n\tloop = 2,\n\tpingpong = 3,\n\tonceReverse = 4,\n\tloopReverse = 5,\n\tpingpongReverse = 6\n}\n\nexport const SequenceModeValues = [\n\tSequenceMode.hold,\n\tSequenceMode.once,\n\tSequenceMode.loop,\n\tSequenceMode.pingpong,\n\tSequenceMode.onceReverse,\n\tSequenceMode.loopReverse,\n\tSequenceMode.pingpongReverse\n];\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { IkConstraint } from \"./IkConstraint.js\";\nimport { PathConstraint } from \"./PathConstraint.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { TransformConstraint } from \"./TransformConstraint.js\";\nimport { StringSet, Utils, MathUtils, NumberArrayLike } from \"./Utils.js\";\nimport { Event } from \"./Event.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { SequenceMode, SequenceModeValues } from \"./attachments/Sequence.js\";\nimport { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Inherit } from \"./BoneData.js\";\n\n/** A simple container for a list of timelines and a name. */\nexport class Animation {\n\t/** The animation's name, which is unique across all animations in the skeleton. */\n\tname: string;\n\ttimelines: Array = [];\n\ttimelineIds: StringSet = new StringSet();\n\n\t/** The duration of the animation in seconds, which is the highest time of all keys in the timeline. */\n\tduration: number;\n\n\tconstructor (name: string, timelines: Array, duration: number) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t\tthis.setTimelines(timelines);\n\t\tthis.duration = duration;\n\t}\n\n\tsetTimelines (timelines: Array) {\n\t\tif (!timelines) throw new Error(\"timelines cannot be null.\");\n\t\tthis.timelines = timelines;\n\t\tthis.timelineIds.clear();\n\t\tfor (var i = 0; i < timelines.length; i++)\n\t\t\tthis.timelineIds.addAll(timelines[i].getPropertyIds());\n\t}\n\n\thasTimeline (ids: string[]): boolean {\n\t\tfor (let i = 0; i < ids.length; i++)\n\t\t\tif (this.timelineIds.contains(ids[i])) return true;\n\t\treturn false;\n\t}\n\n\t/** Applies all the animation's timelines to the specified skeleton.\n\t *\n\t * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}.\n\t * @param loop If true, the animation repeats after {@link #getDuration()}.\n\t * @param events May be null to ignore fired events. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, loop: boolean, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\n\t\tif (loop && this.duration != 0) {\n\t\t\ttime %= this.duration;\n\t\t\tif (lastTime > 0) lastTime %= this.duration;\n\t\t}\n\n\t\tlet timelines = this.timelines;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\ttimelines[i].apply(skeleton, lastTime, time, events, alpha, blend, direction);\n\t}\n}\n\n/** Controls how a timeline value is mixed with the setup pose value or current pose value when a timeline's `alpha`\n * < 1.\n *\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */\nexport enum MixBlend {\n\t/** Transitions from the setup value to the timeline value (the current value is not used). Before the first key, the setup\n\t * value is set. */\n\tsetup,\n\t/** Transitions from the current value to the timeline value. Before the first key, transitions from the current value to\n\t * the setup value. Timelines which perform instant transitions, such as {@link DrawOrderTimeline} or\n\t * {@link AttachmentTimeline}, use the setup value before the first key.\n\t *\n\t * `first` is intended for the first animations applied, not for animations layered on top of those. */\n\tfirst,\n\t/** Transitions from the current value to the timeline value. No change is made before the first key (the current value is\n\t * kept until the first key).\n\t *\n\t * `replace` is intended for animations layered on top of others, not for the first animations applied. */\n\treplace,\n\t/** Transitions from the current value to the current value plus the timeline value. No change is made before the first key\n\t * (the current value is kept until the first key).\n\t *\n\t * `add` is intended for animations layered on top of others, not for the first animations applied. Properties\n\t * keyed by additive animations must be set manually or by another animation before applying the additive animations, else\n\t * the property values will increase continually. */\n\tadd\n}\n\n/** Indicates whether a timeline's `alpha` is mixing out over time toward 0 (the setup or current pose value) or\n * mixing in toward 1 (the timeline's value).\n *\n * See Timeline {@link Timeline#apply(Skeleton, float, float, Array, float, MixBlend, MixDirection)}. */\nexport enum MixDirection {\n\tmixIn, mixOut\n}\n\nconst Property = {\n\trotate: 0,\n\tx: 1,\n\ty: 2,\n\tscaleX: 3,\n\tscaleY: 4,\n\tshearX: 5,\n\tshearY: 6,\n\tinherit: 7,\n\n\trgb: 8,\n\talpha: 9,\n\trgb2: 10,\n\n\tattachment: 11,\n\tdeform: 12,\n\n\tevent: 13,\n\tdrawOrder: 14,\n\n\tikConstraint: 15,\n\ttransformConstraint: 16,\n\n\tpathConstraintPosition: 17,\n\tpathConstraintSpacing: 18,\n\tpathConstraintMix: 19,\n\n\tphysicsConstraintInertia: 20,\n\tphysicsConstraintStrength: 21,\n\tphysicsConstraintDamping: 22,\n\tphysicsConstraintMass: 23,\n\tphysicsConstraintWind: 24,\n\tphysicsConstraintGravity: 25,\n\tphysicsConstraintMix: 26,\n\tphysicsConstraintReset: 27,\n\n\tsequence: 28,\n}\n\n/** The interface for all timelines. */\nexport abstract class Timeline {\n\tpropertyIds: string[];\n\tframes: NumberArrayLike;\n\n\tconstructor (frameCount: number, propertyIds: string[]) {\n\t\tthis.propertyIds = propertyIds;\n\t\tthis.frames = Utils.newFloatArray(frameCount * this.getFrameEntries());\n\t}\n\n\tgetPropertyIds () {\n\t\treturn this.propertyIds;\n\t}\n\n\tgetFrameEntries (): number {\n\t\treturn 1;\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length / this.getFrameEntries();\n\t}\n\n\tgetDuration (): number {\n\t\treturn this.frames[this.frames.length - this.getFrameEntries()];\n\t}\n\n\tabstract apply (skeleton: Skeleton, lastTime: number, time: number, events: Array | null, alpha: number, blend: MixBlend, direction: MixDirection): void;\n\n\tstatic search1 (frames: NumberArrayLike, time: number) {\n\t\tlet n = frames.length;\n\t\tfor (let i = 1; i < n; i++)\n\t\t\tif (frames[i] > time) return i - 1;\n\t\treturn n - 1;\n\t}\n\n\tstatic search (frames: NumberArrayLike, time: number, step: number) {\n\t\tlet n = frames.length;\n\t\tfor (let i = step; i < n; i += step)\n\t\t\tif (frames[i] > time) return i - step;\n\t\treturn n - step;\n\t}\n}\n\nexport interface BoneTimeline {\n\t/** The index of the bone in {@link Skeleton#bones} that will be changed. */\n\tboneIndex: number;\n}\n\nexport interface SlotTimeline {\n\t/** The index of the slot in {@link Skeleton#slots} that will be changed. */\n\tslotIndex: number;\n}\n\n/** The base class for timelines that use interpolation between key frame values. */\nexport abstract class CurveTimeline extends Timeline {\n\tprotected curves: NumberArrayLike; // type, x, y, ...\n\n\tconstructor (frameCount: number, bezierCount: number, propertyIds: string[]) {\n\t\tsuper(frameCount, propertyIds);\n\t\tthis.curves = Utils.newFloatArray(frameCount + bezierCount * 18/*BEZIER_SIZE*/);\n\t\tthis.curves[frameCount - 1] = 1/*STEPPED*/;\n\t}\n\n\t/** Sets the specified key frame to linear interpolation. */\n\tsetLinear (frame: number) {\n\t\tthis.curves[frame] = 0/*LINEAR*/;\n\t}\n\n\t/** Sets the specified key frame to stepped interpolation. */\n\tsetStepped (frame: number) {\n\t\tthis.curves[frame] = 1/*STEPPED*/;\n\t}\n\n\t/** Shrinks the storage for Bezier curves, for use when bezierCount (specified in the constructor) was larger\n\t * than the actual number of Bezier curves. */\n\tshrink (bezierCount: number) {\n\t\tlet size = this.getFrameCount() + bezierCount * 18/*BEZIER_SIZE*/;\n\t\tif (this.curves.length > size) {\n\t\t\tlet newCurves = Utils.newFloatArray(size);\n\t\t\tUtils.arrayCopy(this.curves, 0, newCurves, 0, size);\n\t\t\tthis.curves = newCurves;\n\t\t}\n\t}\n\n\t/** Stores the segments for the specified Bezier curve. For timelines that modify multiple values, there may be more than\n\t * one curve per frame.\n\t * @param bezier The ordinal of this Bezier curve for this timeline, between 0 and bezierCount - 1 (specified\n\t * in the constructor), inclusive.\n\t * @param frame Between 0 and frameCount - 1, inclusive.\n\t * @param value The index of the value for this frame that this curve is used for.\n\t * @param time1 The time for the first key.\n\t * @param value1 The value for the first key.\n\t * @param cx1 The time for the first Bezier handle.\n\t * @param cy1 The value for the first Bezier handle.\n\t * @param cx2 The time of the second Bezier handle.\n\t * @param cy2 The value for the second Bezier handle.\n\t * @param time2 The time for the second key.\n\t * @param value2 The value for the second key. */\n\tsetBezier (bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number,\n\t\tcy2: number, time2: number, value2: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = this.getFrameCount() + bezier * 18/*BEZIER_SIZE*/;\n\t\tif (value == 0) curves[frame] = 2/*BEZIER*/ + i;\n\t\tlet tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = (value1 - cy1 * 2 + cy2) * 0.03;\n\t\tlet dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = ((cy1 - cy2) * 3 - value1 + value2) * 0.006;\n\t\tlet ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\n\t\tlet dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = (cy1 - value1) * 0.3 + tmpy + dddy * 0.16666667;\n\t\tlet x = time1 + dx, y = value1 + dy;\n\t\tfor (let n = i + 18/*BEZIER_SIZE*/; i < n; i += 2) {\n\t\t\tcurves[i] = x;\n\t\t\tcurves[i + 1] = y;\n\t\t\tdx += ddx;\n\t\t\tdy += ddy;\n\t\t\tddx += dddx;\n\t\t\tddy += dddy;\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t}\n\n\t/** Returns the Bezier interpolated value for the specified time.\n\t * @param frameIndex The index into {@link #getFrames()} for the values of the frame before time.\n\t * @param valueOffset The offset from frameIndex to the value this curve is used for.\n\t * @param i The index of the Bezier segments. See {@link #getCurveType(int)}. */\n\tgetBezierValue (time: number, frameIndex: number, valueOffset: number, i: number) {\n\t\tlet curves = this.curves;\n\t\tif (curves[i] > time) {\n\t\t\tlet x = this.frames[frameIndex], y = this.frames[frameIndex + valueOffset];\n\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t}\n\t\tlet n = i + 18/*BEZIER_SIZE*/;\n\t\tfor (i += 2; i < n; i += 2) {\n\t\t\tif (curves[i] >= time) {\n\t\t\t\tlet x = curves[i - 2], y = curves[i - 1];\n\t\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t\t}\n\t\t}\n\t\tframeIndex += this.getFrameEntries();\n\t\tlet x = curves[n - 2], y = curves[n - 1];\n\t\treturn y + (time - x) / (this.frames[frameIndex] - x) * (this.frames[frameIndex + valueOffset] - y);\n\t}\n}\n\nexport abstract class CurveTimeline1 extends CurveTimeline {\n\tconstructor (frameCount: number, bezierCount: number, propertyId: string) {\n\t\tsuper(frameCount, bezierCount, [propertyId]);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 2/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and value for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, value: number) {\n\t\tframe <<= 1;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*VALUE*/] = value;\n\t}\n\n\t/** Returns the interpolated value for the specified time. */\n\tgetCurveValue (time: number) {\n\t\tlet frames = this.frames;\n\t\tlet i = frames.length - 2;\n\t\tfor (let ii = 2; ii <= i; ii += 2) {\n\t\t\tif (frames[ii] > time) {\n\t\t\t\ti = ii - 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tlet curveType = this.curves[i >> 1];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i], value = frames[i + 1/*VALUE*/];\n\t\t\t\treturn value + (time - before) / (frames[i + 2/*ENTRIES*/] - before) * (frames[i + 2/*ENTRIES*/ + 1/*VALUE*/] - value);\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\treturn frames[i + 1/*VALUE*/];\n\t\t}\n\t\treturn this.getBezierValue(time, i, 1/*VALUE*/, curveType - 2/*BEZIER*/);\n\t}\n\n\tgetRelativeValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time);\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\treturn setup + value * alpha;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tvalue += setup - current;\n\t\t}\n\t\treturn current + value * alpha;\n\t}\n\n\tgetAbsoluteValue (time: number, alpha: number, blend: MixBlend, current: number, setup: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time);\n\t\tif (blend == MixBlend.setup) return setup + (value - setup) * alpha;\n\t\treturn current + (value - current) * alpha;\n\t}\n\n\tgetAbsoluteValue2 (time: number, alpha: number, blend: MixBlend, current: number, setup: number, value: number) {\n\t\tif (time < this.frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tif (blend == MixBlend.setup) return setup + (value - setup) * alpha;\n\t\treturn current + (value - current) * alpha;\n\t}\n\n\tgetScaleValue (time: number, alpha: number, blend: MixBlend, direction: MixDirection, current: number, setup: number) {\n\t\tconst frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\treturn current + (setup - current) * alpha;\n\t\t\t}\n\t\t\treturn current;\n\t\t}\n\t\tlet value = this.getCurveValue(time) * setup;\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) return current + value - setup;\n\t\t\treturn value;\n\t\t}\n\t\t// Mixing out uses sign of setup or current pose, else use sign of key.\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\treturn setup + (Math.abs(value) * MathUtils.signum(setup) - setup) * alpha;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\treturn current + (Math.abs(value) * MathUtils.signum(current) - current) * alpha;\n\t\t\t}\n\t\t} else {\n\t\t\tlet s = 0;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\ts = Math.abs(setup) * MathUtils.signum(value);\n\t\t\t\t\treturn s + (value - s) * alpha;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\ts = Math.abs(current) * MathUtils.signum(value);\n\t\t\t\t\treturn s + (value - s) * alpha;\n\t\t\t}\n\t\t}\n\t\treturn current + (value - setup) * alpha;\n\t}\n}\n\n/** The base class for a {@link CurveTimeline} which sets two properties. */\nexport abstract class CurveTimeline2 extends CurveTimeline {\n\t/** @param bezierCount The maximum number of Bezier curves. See {@link #shrink(int)}.\n\t * @param propertyIds Unique identifiers for the properties the timeline modifies. */\n\tconstructor (frameCount: number, bezierCount: number, propertyId1: string, propertyId2: string) {\n\t\tsuper(frameCount, bezierCount, [propertyId1, propertyId2]);\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 3/*ENTRIES*/;\n\t}\n\n\t/** Sets the time and values for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tsetFrame (frame: number, time: number, value1: number, value2: number) {\n\t\tframe *= 3/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*VALUE1*/] = value1;\n\t\tthis.frames[frame + 2/*VALUE2*/] = value2;\n\t}\n}\n\n/** Changes a bone's local {@link Bone#rotation}. */\nexport class RotateTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.rotate + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array | null, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.rotation = this.getRelativeValue(time, alpha, blend, bone.rotation, bone.data.rotation);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x} and {@link Bone#y}. */\nexport class TranslateTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.x + \"|\" + boneIndex,\n\t\t\tProperty.y + \"|\" + boneIndex,\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.x = bone.data.x;\n\t\t\t\t\tbone.y = bone.data.y;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.x += (bone.data.x - bone.x) * alpha;\n\t\t\t\t\tbone.y += (bone.data.y - bone.y) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = 0, y = 0;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\tbone.x = bone.data.x + x * alpha;\n\t\t\t\tbone.y = bone.data.y + y * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tbone.x += (bone.data.x + x - bone.x) * alpha;\n\t\t\t\tbone.y += (bone.data.y + y - bone.y) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tbone.x += x * alpha;\n\t\t\t\tbone.y += y * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x}. */\nexport class TranslateXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.x + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.x = this.getRelativeValue(time, alpha, blend, bone.x, bone.data.x);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#x}. */\nexport class TranslateYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.y + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.y = this.getRelativeValue(time, alpha, blend, bone.y, bone.data.y);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.scaleX + \"|\" + boneIndex,\n\t\t\tProperty.scaleY + \"|\" + boneIndex\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.scaleX = bone.data.scaleX;\n\t\t\t\t\tbone.scaleY = bone.data.scaleY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;\n\t\t\t\t\tbone.scaleY += (bone.data.scaleY - bone.scaleY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x, y;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\t\tx *= bone.data.scaleX;\n\t\ty *= bone.data.scaleY;\n\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) {\n\t\t\t\tbone.scaleX += x - bone.data.scaleX;\n\t\t\t\tbone.scaleY += y - bone.data.scaleY;\n\t\t\t} else {\n\t\t\t\tbone.scaleX = x;\n\t\t\t\tbone.scaleY = y;\n\t\t\t}\n\t\t} else {\n\t\t\tlet bx = 0, by = 0;\n\t\t\tif (direction == MixDirection.mixOut) {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\t\tbx = bone.data.scaleX;\n\t\t\t\t\t\tby = bone.data.scaleY;\n\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tbx = bone.scaleX;\n\t\t\t\t\t\tby = bone.scaleY;\n\t\t\t\t\t\tbone.scaleX = bx + (Math.abs(x) * MathUtils.signum(bx) - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (Math.abs(y) * MathUtils.signum(by) - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tbone.scaleX += (x - bone.data.scaleX) * alpha;\n\t\t\t\t\t\tbone.scaleY += (y - bone.data.scaleY) * alpha;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\t\tbx = Math.abs(bone.data.scaleX) * MathUtils.signum(x);\n\t\t\t\t\t\tby = Math.abs(bone.data.scaleY) * MathUtils.signum(y);\n\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tbx = Math.abs(bone.scaleX) * MathUtils.signum(x);\n\t\t\t\t\t\tby = Math.abs(bone.scaleY) * MathUtils.signum(y);\n\t\t\t\t\t\tbone.scaleX = bx + (x - bx) * alpha;\n\t\t\t\t\t\tbone.scaleY = by + (y - by) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tbone.scaleX += (x - bone.data.scaleX) * alpha;\n\t\t\t\t\t\tbone.scaleY += (y - bone.data.scaleY) * alpha;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.scaleX + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.scaleX = this.getScaleValue(time, alpha, blend, direction, bone.scaleX, bone.data.scaleX);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#scaleX)} and {@link Bone#scaleY}. */\nexport class ScaleYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.scaleY + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.scaleY = this.getScaleValue(time, alpha, blend, direction, bone.scaleY, bone.data.scaleY);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearTimeline extends CurveTimeline2 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount,\n\t\t\tProperty.shearX + \"|\" + boneIndex,\n\t\t\tProperty.shearY + \"|\" + boneIndex\n\t\t);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.shearX = bone.data.shearX;\n\t\t\t\t\tbone.shearY = bone.data.shearY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tbone.shearX += (bone.data.shearX - bone.shearX) * alpha;\n\t\t\t\t\tbone.shearY += (bone.data.shearY - bone.shearY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet x = 0, y = 0;\n\t\tlet i = Timeline.search(frames, time, 3/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 3/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 3/*ENTRIES*/] - before);\n\t\t\t\tx += (frames[i + 3/*ENTRIES*/ + 1/*VALUE1*/] - x) * t;\n\t\t\t\ty += (frames[i + 3/*ENTRIES*/ + 2/*VALUE2*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tx = frames[i + 1/*VALUE1*/];\n\t\t\t\ty = frames[i + 2/*VALUE2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tx = this.getBezierValue(time, i, 1/*VALUE1*/, curveType - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 2/*VALUE2*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tswitch (blend) {\n\t\t\tcase MixBlend.setup:\n\t\t\t\tbone.shearX = bone.data.shearX + x * alpha;\n\t\t\t\tbone.shearY = bone.data.shearY + y * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.first:\n\t\t\tcase MixBlend.replace:\n\t\t\t\tbone.shearX += (bone.data.shearX + x - bone.shearX) * alpha;\n\t\t\t\tbone.shearY += (bone.data.shearY + y - bone.shearY) * alpha;\n\t\t\t\tbreak;\n\t\t\tcase MixBlend.add:\n\t\t\t\tbone.shearX += x * alpha;\n\t\t\t\tbone.shearY += y * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearXTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.shearX + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.shearX = this.getRelativeValue(time, alpha, blend, bone.shearX, bone.data.shearX);\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class ShearYTimeline extends CurveTimeline1 implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, boneIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.shearY + \"|\" + boneIndex);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (bone.active) bone.shearY = this.getRelativeValue(time, alpha, blend, bone.shearY, bone.data.shearY);\n\t}\n}\n\nexport class InheritTimeline extends Timeline implements BoneTimeline {\n\tboneIndex = 0;\n\n\tconstructor (frameCount: number, boneIndex: number) {\n\t\tsuper(frameCount, [Property.inherit + \"|\" + boneIndex]);\n\t\tthis.boneIndex = boneIndex;\n\t}\n\n\tpublic getFrameEntries () {\n\t\treturn 2/*ENTRIES*/;\n\t}\n\n\t/** Sets the transform mode for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time The frame time in seconds. */\n\tpublic setFrame (frame: number, time: number, inherit: Inherit) {\n\t\tframe *= 2/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*INHERIT*/] = inherit;\n\t}\n\n\tpublic apply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet bone = skeleton.bones[this.boneIndex];\n\t\tif (!bone.active) return;\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) bone.inherit = bone.data.inherit;\n\t\t\treturn;\n\t\t}\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) bone.inherit = bone.data.inherit;\n\t\t\treturn;\n\t\t}\n\t\tbone.inherit = this.frames[Timeline.search(frames, time, 2/*ENTRIES*/) + 1/*INHERIT*/];\n\t}\n}\n\n/** Changes a slot's {@link Slot#color}. */\nexport class RGBATimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.alpha + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 5/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, a: number) {\n\t\tframe *= 5/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*A*/] = a;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet color = slot.color;\n\t\tif (time < frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.setFromColor(setup);\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.add((setup.r - color.r) * alpha, (setup.g - color.g) * alpha, (setup.b - color.b) * alpha,\n\t\t\t\t\t\t(setup.a - color.a) * alpha);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0;\n\t\tlet i = Timeline.search(frames, time, 5/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 5/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 5/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 5/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 5/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 5/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\ta += (frames[i + 5/*ENTRIES*/ + 4/*A*/] - a) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\ta = this.getBezierValue(time, i, 4/*A*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t}\n\t\tif (alpha == 1)\n\t\t\tcolor.set(r, g, b, a);\n\t\telse {\n\t\t\tif (blend == MixBlend.setup) color.setFromColor(slot.data.color);\n\t\t\tcolor.add((r - color.r) * alpha, (g - color.g) * alpha, (b - color.b) * alpha, (a - color.a) * alpha);\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color}. */\nexport class RGBTimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 4/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, red, green, blue, and alpha for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number) {\n\t\tframe <<= 2;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet color = slot.color;\n\t\tif (time < frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.r = setup.r;\n\t\t\t\t\tcolor.g = setup.g;\n\t\t\t\t\tcolor.b = setup.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.r += (setup.r - color.r) * alpha;\n\t\t\t\t\tcolor.g += (setup.g - color.g) * alpha;\n\t\t\t\t\tcolor.b += (setup.b - color.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0;\n\t\tlet i = Timeline.search(frames, time, 4/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 2];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 4/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 4/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 4/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 4/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t}\n\t\tif (alpha == 1) {\n\t\t\tcolor.r = r;\n\t\t\tcolor.g = g;\n\t\t\tcolor.b = b;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlet setup = slot.data.color;\n\t\t\t\tcolor.r = setup.r;\n\t\t\t\tcolor.g = setup.g;\n\t\t\t\tcolor.b = setup.b;\n\t\t\t}\n\t\t\tcolor.r += (r - color.r) * alpha;\n\t\t\tcolor.g += (g - color.g) * alpha;\n\t\t\tcolor.b += (b - color.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a bone's local {@link Bone#shearX} and {@link Bone#shearY}. */\nexport class AlphaTimeline extends CurveTimeline1 implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.alpha + \"|\" + slotIndex);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet color = slot.color;\n\t\tif (time < this.frames[0]) {\n\t\t\tlet setup = slot.data.color;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tcolor.a = setup.a;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcolor.a += (setup.a - color.a) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet a = this.getCurveValue(time);\n\t\tif (alpha == 1)\n\t\t\tcolor.a = a;\n\t\telse {\n\t\t\tif (blend == MixBlend.setup) color.a = slot.data.color.a;\n\t\t\tcolor.a += (a - color.a) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */\nexport class RGBA2Timeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.alpha + \"|\" + slotIndex,\n\t\t\tProperty.rgb2 + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 8/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, light, and dark colors for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, a: number, r2: number, g2: number, b2: number) {\n\t\tframe <<= 3;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*A*/] = a;\n\t\tthis.frames[frame + 5/*R2*/] = r2;\n\t\tthis.frames[frame + 6/*G2*/] = g2;\n\t\tthis.frames[frame + 7/*B2*/] = b2;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet light = slot.color, dark = slot.darkColor!;\n\t\tif (time < frames[0]) {\n\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tlight.setFromColor(setupLight);\n\t\t\t\t\tdark.r = setupDark.r;\n\t\t\t\t\tdark.g = setupDark.g;\n\t\t\t\t\tdark.b = setupDark.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tlight.add((setupLight.r - light.r) * alpha, (setupLight.g - light.g) * alpha, (setupLight.b - light.b) * alpha,\n\t\t\t\t\t\t(setupLight.a - light.a) * alpha);\n\t\t\t\t\tdark.r += (setupDark.r - dark.r) * alpha;\n\t\t\t\t\tdark.g += (setupDark.g - dark.g) * alpha;\n\t\t\t\t\tdark.b += (setupDark.b - dark.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\n\t\tlet i = Timeline.search(frames, time, 8/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 3];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tr2 = frames[i + 5/*R2*/];\n\t\t\t\tg2 = frames[i + 6/*G2*/];\n\t\t\t\tb2 = frames[i + 7/*B2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 8/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 8/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 8/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 8/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\ta += (frames[i + 8/*ENTRIES*/ + 4/*A*/] - a) * t;\n\t\t\t\tr2 += (frames[i + 8/*ENTRIES*/ + 5/*R2*/] - r2) * t;\n\t\t\t\tg2 += (frames[i + 8/*ENTRIES*/ + 6/*G2*/] - g2) * t;\n\t\t\t\tb2 += (frames[i + 8/*ENTRIES*/ + 7/*B2*/] - b2) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\ta = frames[i + 4/*A*/];\n\t\t\t\tr2 = frames[i + 5/*R2*/];\n\t\t\t\tg2 = frames[i + 6/*G2*/];\n\t\t\t\tb2 = frames[i + 7/*B2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\ta = this.getBezierValue(time, i, 4/*A*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tr2 = this.getBezierValue(time, i, 5/*R2*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tg2 = this.getBezierValue(time, i, 6/*G2*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t\t\tb2 = this.getBezierValue(time, i, 7/*B2*/, curveType + 18/*BEZIER_SIZE*/ * 6 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (alpha == 1) {\n\t\t\tlight.set(r, g, b, a);\n\t\t\tdark.r = r2;\n\t\t\tdark.g = g2;\n\t\t\tdark.b = b2;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlight.setFromColor(slot.data.color);\n\t\t\t\tlet setupDark = slot.data.darkColor!;\n\t\t\t\tdark.r = setupDark.r;\n\t\t\t\tdark.g = setupDark.g;\n\t\t\t\tdark.b = setupDark.b;\n\t\t\t}\n\t\t\tlight.add((r - light.r) * alpha, (g - light.g) * alpha, (b - light.b) * alpha, (a - light.a) * alpha);\n\t\t\tdark.r += (r2 - dark.r) * alpha;\n\t\t\tdark.g += (g2 - dark.g) * alpha;\n\t\t\tdark.b += (b2 - dark.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#color} and {@link Slot#darkColor} for two color tinting. */\nexport class RGB2Timeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.rgb + \"|\" + slotIndex,\n\t\t\tProperty.rgb2 + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 7/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, light, and dark colors for the specified key frame. */\n\tsetFrame (frame: number, time: number, r: number, g: number, b: number, r2: number, g2: number, b2: number) {\n\t\tframe *= 7/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*R*/] = r;\n\t\tthis.frames[frame + 2/*G*/] = g;\n\t\tthis.frames[frame + 3/*B*/] = b;\n\t\tthis.frames[frame + 4/*R2*/] = r2;\n\t\tthis.frames[frame + 5/*G2*/] = g2;\n\t\tthis.frames[frame + 6/*B2*/] = b2;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tlet frames = this.frames;\n\t\tlet light = slot.color, dark = slot.darkColor!;\n\t\tif (time < frames[0]) {\n\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tlight.r = setupLight.r;\n\t\t\t\t\tlight.g = setupLight.g;\n\t\t\t\t\tlight.b = setupLight.b;\n\t\t\t\t\tdark.r = setupDark.r;\n\t\t\t\t\tdark.g = setupDark.g;\n\t\t\t\t\tdark.b = setupDark.b;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tlight.r += (setupLight.r - light.r) * alpha;\n\t\t\t\t\tlight.g += (setupLight.g - light.g) * alpha;\n\t\t\t\t\tlight.b += (setupLight.b - light.b) * alpha;\n\t\t\t\t\tdark.r += (setupDark.r - dark.r) * alpha;\n\t\t\t\t\tdark.g += (setupDark.g - dark.g) * alpha;\n\t\t\t\t\tdark.b += (setupDark.b - dark.b) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet r = 0, g = 0, b = 0, a = 0, r2 = 0, g2 = 0, b2 = 0;\n\t\tlet i = Timeline.search(frames, time, 7/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 7/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tr2 = frames[i + 4/*R2*/];\n\t\t\t\tg2 = frames[i + 5/*G2*/];\n\t\t\t\tb2 = frames[i + 6/*B2*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 7/*ENTRIES*/] - before);\n\t\t\t\tr += (frames[i + 7/*ENTRIES*/ + 1/*R*/] - r) * t;\n\t\t\t\tg += (frames[i + 7/*ENTRIES*/ + 2/*G*/] - g) * t;\n\t\t\t\tb += (frames[i + 7/*ENTRIES*/ + 3/*B*/] - b) * t;\n\t\t\t\tr2 += (frames[i + 7/*ENTRIES*/ + 4/*R2*/] - r2) * t;\n\t\t\t\tg2 += (frames[i + 7/*ENTRIES*/ + 5/*G2*/] - g2) * t;\n\t\t\t\tb2 += (frames[i + 7/*ENTRIES*/ + 6/*B2*/] - b2) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tr = frames[i + 1/*R*/];\n\t\t\t\tg = frames[i + 2/*G*/];\n\t\t\t\tb = frames[i + 3/*B*/];\n\t\t\t\tr2 = frames[i + 4/*R2*/];\n\t\t\t\tg2 = frames[i + 5/*G2*/];\n\t\t\t\tb2 = frames[i + 6/*B2*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tr = this.getBezierValue(time, i, 1/*R*/, curveType - 2/*BEZIER*/);\n\t\t\t\tg = this.getBezierValue(time, i, 2/*G*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\tb = this.getBezierValue(time, i, 3/*B*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\tr2 = this.getBezierValue(time, i, 4/*R2*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tg2 = this.getBezierValue(time, i, 5/*G2*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tb2 = this.getBezierValue(time, i, 6/*B2*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (alpha == 1) {\n\t\t\tlight.r = r;\n\t\t\tlight.g = g;\n\t\t\tlight.b = b;\n\t\t\tdark.r = r2;\n\t\t\tdark.g = g2;\n\t\t\tdark.b = b2;\n\t\t} else {\n\t\t\tif (blend == MixBlend.setup) {\n\t\t\t\tlet setupLight = slot.data.color, setupDark = slot.data.darkColor!;\n\t\t\t\tlight.r = setupLight.r;\n\t\t\t\tlight.g = setupLight.g;\n\t\t\t\tlight.b = setupLight.b;\n\t\t\t\tdark.r = setupDark.r;\n\t\t\t\tdark.g = setupDark.g;\n\t\t\t\tdark.b = setupDark.b;\n\t\t\t}\n\t\t\tlight.r += (r - light.r) * alpha;\n\t\t\tlight.g += (g - light.g) * alpha;\n\t\t\tlight.b += (b - light.b) * alpha;\n\t\t\tdark.r += (r2 - dark.r) * alpha;\n\t\t\tdark.g += (g2 - dark.g) * alpha;\n\t\t\tdark.b += (b2 - dark.b) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#attachment}. */\nexport class AttachmentTimeline extends Timeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\t/** The attachment name for each key frame. May contain null values to clear the attachment. */\n\tattachmentNames: Array;\n\n\tconstructor (frameCount: number, slotIndex: number) {\n\t\tsuper(frameCount, [\n\t\t\tProperty.attachment + \"|\" + slotIndex\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachmentNames = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the attachment name for the specified key frame. */\n\tsetFrame (frame: number, time: number, attachmentName: string | null) {\n\t\tthis.frames[frame] = time;\n\t\tthis.attachmentNames[frame] = attachmentName;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) this.setAttachment(skeleton, slot, slot.data.attachmentName);\n\t\t\treturn;\n\t\t}\n\n\t\tif (time < this.frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) this.setAttachment(skeleton, slot, slot.data.attachmentName);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setAttachment(skeleton, slot, this.attachmentNames[Timeline.search1(this.frames, time)]);\n\t}\n\n\tsetAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string | null) {\n\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(this.slotIndex, attachmentName));\n\t}\n}\n\n/** Changes a slot's {@link Slot#deform} to deform a {@link VertexAttachment}. */\nexport class DeformTimeline extends CurveTimeline implements SlotTimeline {\n\tslotIndex = 0;\n\n\t/** The attachment that will be deformed. */\n\tattachment: VertexAttachment;\n\n\t/** The vertices for each key frame. */\n\tvertices: Array;\n\n\tconstructor (frameCount: number, bezierCount: number, slotIndex: number, attachment: VertexAttachment) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.deform + \"|\" + slotIndex + \"|\" + attachment.id\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachment = attachment;\n\t\tthis.vertices = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the vertices for the specified key frame.\n\t * @param vertices Vertex positions for an unweighted VertexAttachment, or deform offsets if it has weights. */\n\tsetFrame (frame: number, time: number, vertices: NumberArrayLike) {\n\t\tthis.frames[frame] = time;\n\t\tthis.vertices[frame] = vertices;\n\t}\n\n\t/** @param value1 Ignored (0 is used for a deform timeline).\n\t * @param value2 Ignored (1 is used for a deform timeline). */\n\tsetBezier (bezier: number, frame: number, value: number, time1: number, value1: number, cx1: number, cy1: number, cx2: number,\n\t\tcy2: number, time2: number, value2: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = this.getFrameCount() + bezier * 18/*BEZIER_SIZE*/;\n\t\tif (value == 0) curves[frame] = 2/*BEZIER*/ + i;\n\t\tlet tmpx = (time1 - cx1 * 2 + cx2) * 0.03, tmpy = cy2 * 0.03 - cy1 * 0.06;\n\t\tlet dddx = ((cx1 - cx2) * 3 - time1 + time2) * 0.006, dddy = (cy1 - cy2 + 0.33333333) * 0.018;\n\t\tlet ddx = tmpx * 2 + dddx, ddy = tmpy * 2 + dddy;\n\t\tlet dx = (cx1 - time1) * 0.3 + tmpx + dddx * 0.16666667, dy = cy1 * 0.3 + tmpy + dddy * 0.16666667;\n\t\tlet x = time1 + dx, y = dy;\n\t\tfor (let n = i + 18/*BEZIER_SIZE*/; i < n; i += 2) {\n\t\t\tcurves[i] = x;\n\t\t\tcurves[i + 1] = y;\n\t\t\tdx += ddx;\n\t\t\tdy += ddy;\n\t\t\tddx += dddx;\n\t\t\tddy += dddy;\n\t\t\tx += dx;\n\t\t\ty += dy;\n\t\t}\n\t}\n\n\tgetCurvePercent (time: number, frame: number) {\n\t\tlet curves = this.curves;\n\t\tlet i = curves[frame];\n\t\tswitch (i) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet x = this.frames[frame];\n\t\t\t\treturn (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\treturn 0;\n\t\t}\n\t\ti -= 2/*BEZIER*/;\n\t\tif (curves[i] > time) {\n\t\t\tlet x = this.frames[frame];\n\t\t\treturn curves[i + 1] * (time - x) / (curves[i] - x);\n\t\t}\n\t\tlet n = i + 18/*BEZIER_SIZE*/;\n\t\tfor (i += 2; i < n; i += 2) {\n\t\t\tif (curves[i] >= time) {\n\t\t\t\tlet x = curves[i - 2], y = curves[i - 1];\n\t\t\t\treturn y + (time - x) / (curves[i] - x) * (curves[i + 1] - y);\n\t\t\t}\n\t\t}\n\t\tlet x = curves[n - 2], y = curves[n - 1];\n\t\treturn y + (1 - y) * (time - x) / (this.frames[frame + this.getFrameEntries()] - x);\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot: Slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\t\tlet slotAttachment: Attachment | null = slot.getAttachment();\n\t\tif (!slotAttachment) return;\n\t\tif (!(slotAttachment instanceof VertexAttachment) || (slotAttachment).timelineAttachment != this.attachment) return;\n\n\t\tlet deform: Array = slot.deform;\n\t\tif (deform.length == 0) blend = MixBlend.setup;\n\n\t\tlet vertices = this.vertices;\n\t\tlet vertexCount = vertices[0].length;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tdeform.length = 0;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tif (alpha == 1) {\n\t\t\t\t\t\tdeform.length = 0;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tdeform.length = vertexCount;\n\t\t\t\t\tlet vertexAttachment = slotAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += (setupVertices[i] - deform[i]) * alpha;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets.\n\t\t\t\t\t\talpha = 1 - alpha;\n\t\t\t\t\t\tfor (var i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] *= alpha;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tdeform.length = vertexCount;\n\t\tif (time >= frames[frames.length - 1]) {\n\t\t\tlet lastVertices = vertices[frames.length - 1];\n\t\t\tif (alpha == 1) {\n\t\t\t\tif (blend == MixBlend.add) {\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += lastVertices[i] - setupVertices[i];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += lastVertices[i];\n\t\t\t\t\t}\n\t\t\t\t} else\n\t\t\t\t\tUtils.arrayCopy(lastVertices, 0, deform, 0, vertexCount);\n\t\t\t} else {\n\t\t\t\tswitch (blend) {\n\t\t\t\t\tcase MixBlend.setup: {\n\t\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\t\tlet setup = setupVertices[i];\n\t\t\t\t\t\t\t\tdeform[i] = setup + (lastVertices[i] - setup) * alpha;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] = lastVertices[i] * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\tdeform[i] += (lastVertices[i] - deform[i]) * alpha;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase MixBlend.add:\n\t\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] += (lastVertices[i] - setupVertices[i]) * alpha;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\t\t\t\t\t\tdeform[i] += lastVertices[i] * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// Interpolate between the previous frame and the current frame.\n\t\tlet frame = Timeline.search1(frames, time);\n\t\tlet percent = this.getCurvePercent(time, frame);\n\t\tlet prevVertices = vertices[frame];\n\t\tlet nextVertices = vertices[frame + 1];\n\n\t\tif (alpha == 1) {\n\t\t\tif (blend == MixBlend.add) {\n\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += prev + (nextVertices[i] - prev) * percent - setupVertices[i];\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += prev + (nextVertices[i] - prev) * percent;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\tdeform[i] = prev + (nextVertices[i] - prev) * percent;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup: {\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i], setup = setupVertices[i];\n\t\t\t\t\t\t\tdeform[i] = setup + (prev + (nextVertices[i] - prev) * percent - setup) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] = (prev + (nextVertices[i] - prev) * percent) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase MixBlend.first:\n\t\t\t\tcase MixBlend.replace:\n\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent - deform[i]) * alpha;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase MixBlend.add:\n\t\t\t\t\tlet vertexAttachment = slotAttachment as VertexAttachment;\n\t\t\t\t\tif (!vertexAttachment.bones) {\n\t\t\t\t\t\t// Unweighted vertex positions, with alpha.\n\t\t\t\t\t\tlet setupVertices = vertexAttachment.vertices;\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent - setupVertices[i]) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Weighted deform offsets, with alpha.\n\t\t\t\t\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\t\t\t\t\tlet prev = prevVertices[i];\n\t\t\t\t\t\t\tdeform[i] += (prev + (nextVertices[i] - prev) * percent) * alpha;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Fires an {@link Event} when specific animation times are reached. */\nexport class EventTimeline extends Timeline {\n\tstatic propertyIds = [\"\" + Property.event];\n\n\t/** The event for each key frame. */\n\tevents: Array;\n\n\tconstructor (frameCount: number) {\n\t\tsuper(frameCount, EventTimeline.propertyIds);\n\n\t\tthis.events = new Array(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the event for the specified key frame. */\n\tsetFrame (frame: number, event: Event) {\n\t\tthis.frames[frame] = event.time;\n\t\tthis.events[frame] = event;\n\t}\n\n\t/** Fires events for frames > `lastTime` and <= `time`. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (!firedEvents) return;\n\n\t\tlet frames = this.frames;\n\t\tlet frameCount = this.frames.length;\n\n\t\tif (lastTime > time) { // Apply after lastTime for looped animations.\n\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, firedEvents, alpha, blend, direction);\n\t\t\tlastTime = -1;\n\t\t} else if (lastTime >= frames[frameCount - 1]) // Last time is after last frame.\n\t\t\treturn;\n\t\tif (time < frames[0]) return;\n\n\t\tlet i = 0;\n\t\tif (lastTime < frames[0])\n\t\t\ti = 0;\n\t\telse {\n\t\t\ti = Timeline.search1(frames, lastTime) + 1;\n\t\t\tlet frameTime = frames[i];\n\t\t\twhile (i > 0) { // Fire multiple events with the same frame.\n\t\t\t\tif (frames[i - 1] != frameTime) break;\n\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t\tfor (; i < frameCount && time >= frames[i]; i++)\n\t\t\tfiredEvents.push(this.events[i]);\n\t}\n}\n\n/** Changes a skeleton's {@link Skeleton#drawOrder}. */\nexport class DrawOrderTimeline extends Timeline {\n\tstatic propertyIds = [\"\" + Property.drawOrder];\n\n\t/** The draw order for each key frame. See {@link #setFrame(int, float, int[])}. */\n\tdrawOrders: Array | null>;\n\n\tconstructor (frameCount: number) {\n\t\tsuper(frameCount, DrawOrderTimeline.propertyIds);\n\t\tthis.drawOrders = new Array | null>(frameCount);\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time in seconds and the draw order for the specified key frame.\n\t * @param drawOrder For each slot in {@link Skeleton#slots}, the index of the new draw order. May be null to use setup pose\n\t * draw order. */\n\tsetFrame (frame: number, time: number, drawOrder: Array | null) {\n\t\tthis.frames[frame] = time;\n\t\tthis.drawOrders[frame] = drawOrder;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\t\treturn;\n\t\t}\n\n\t\tif (time < this.frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) Utils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\t\treturn;\n\t\t}\n\n\t\tlet idx = Timeline.search1(this.frames, time);\n\t\tlet drawOrderToSetupIndex = this.drawOrders[idx];\n\t\tif (!drawOrderToSetupIndex)\n\t\t\tUtils.arrayCopy(skeleton.slots, 0, skeleton.drawOrder, 0, skeleton.slots.length);\n\t\telse {\n\t\t\tlet drawOrder: Array = skeleton.drawOrder;\n\t\t\tlet slots: Array = skeleton.slots;\n\t\t\tfor (let i = 0, n = drawOrderToSetupIndex.length; i < n; i++)\n\t\t\t\tdrawOrder[i] = slots[drawOrderToSetupIndex[i]];\n\t\t}\n\t}\n}\n\n/** Changes an IK constraint's {@link IkConstraint#mix}, {@link IkConstraint#softness},\n * {@link IkConstraint#bendDirection}, {@link IkConstraint#stretch}, and {@link IkConstraint#compress}. */\nexport class IkConstraintTimeline extends CurveTimeline {\n\t/** The index of the IK constraint in {@link Skeleton#getIkConstraints()} that will be changed when this timeline is applied */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, ikConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.ikConstraint + \"|\" + ikConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = ikConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 6/*ENTRIES*/;\n\t}\n\n\t/** Sets the time in seconds, mix, softness, bend direction, compress, and stretch for the specified key frame. */\n\tsetFrame (frame: number, time: number, mix: number, softness: number, bendDirection: number, compress: boolean, stretch: boolean) {\n\t\tframe *= 6/*ENTRIES*/;\n\t\tthis.frames[frame] = time;\n\t\tthis.frames[frame + 1/*MIX*/] = mix;\n\t\tthis.frames[frame + 2/*SOFTNESS*/] = softness;\n\t\tthis.frames[frame + 3/*BEND_DIRECTION*/] = bendDirection;\n\t\tthis.frames[frame + 4/*COMPRESS*/] = compress ? 1 : 0;\n\t\tthis.frames[frame + 5/*STRETCH*/] = stretch ? 1 : 0;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: IkConstraint = skeleton.ikConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mix = constraint.data.mix;\n\t\t\t\t\tconstraint.softness = constraint.data.softness;\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mix += (constraint.data.mix - constraint.mix) * alpha;\n\t\t\t\t\tconstraint.softness += (constraint.data.softness - constraint.softness) * alpha;\n\t\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet mix = 0, softness = 0;\n\t\tlet i = Timeline.search(frames, time, 6/*ENTRIES*/)\n\t\tlet curveType = this.curves[i / 6/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\tmix = frames[i + 1/*MIX*/];\n\t\t\t\tsoftness = frames[i + 2/*SOFTNESS*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 6/*ENTRIES*/] - before);\n\t\t\t\tmix += (frames[i + 6/*ENTRIES*/ + 1/*MIX*/] - mix) * t;\n\t\t\t\tsoftness += (frames[i + 6/*ENTRIES*/ + 2/*SOFTNESS*/] - softness) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\tmix = frames[i + 1/*MIX*/];\n\t\t\t\tsoftness = frames[i + 2/*SOFTNESS*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmix = this.getBezierValue(time, i, 1/*MIX*/, curveType - 2/*BEZIER*/);\n\t\t\t\tsoftness = this.getBezierValue(time, i, 2/*SOFTNESS*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tconstraint.mix = constraint.data.mix + (mix - constraint.data.mix) * alpha;\n\t\t\tconstraint.softness = constraint.data.softness + (softness - constraint.data.softness) * alpha;\n\n\t\t\tif (direction == MixDirection.mixOut) {\n\t\t\t\tconstraint.bendDirection = constraint.data.bendDirection;\n\t\t\t\tconstraint.compress = constraint.data.compress;\n\t\t\t\tconstraint.stretch = constraint.data.stretch;\n\t\t\t} else {\n\t\t\t\tconstraint.bendDirection = frames[i + 3/*BEND_DIRECTION*/];\n\t\t\t\tconstraint.compress = frames[i + 4/*COMPRESS*/] != 0;\n\t\t\t\tconstraint.stretch = frames[i + 5/*STRETCH*/] != 0;\n\t\t\t}\n\t\t} else {\n\t\t\tconstraint.mix += (mix - constraint.mix) * alpha;\n\t\t\tconstraint.softness += (softness - constraint.softness) * alpha;\n\t\t\tif (direction == MixDirection.mixIn) {\n\t\t\t\tconstraint.bendDirection = frames[i + 3/*BEND_DIRECTION*/];\n\t\t\t\tconstraint.compress = frames[i + 4/*COMPRESS*/] != 0;\n\t\t\t\tconstraint.stretch = frames[i + 5/*STRETCH*/] != 0;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a transform constraint's {@link TransformConstraint#rotateMix}, {@link TransformConstraint#translateMix},\n * {@link TransformConstraint#scaleMix}, and {@link TransformConstraint#shearMix}. */\nexport class TransformConstraintTimeline extends CurveTimeline {\n\t/** The index of the transform constraint slot in {@link Skeleton#transformConstraints} that will be changed. */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, transformConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.transformConstraint + \"|\" + transformConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = transformConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 7/*ENTRIES*/;\n\t}\n\n\t/** The time in seconds, rotate mix, translate mix, scale mix, and shear mix for the specified key frame. */\n\tsetFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number, mixScaleX: number, mixScaleY: number,\n\t\tmixShearY: number) {\n\t\tlet frames = this.frames;\n\t\tframe *= 7/*ENTRIES*/;\n\t\tframes[frame] = time;\n\t\tframes[frame + 1/*ROTATE*/] = mixRotate;\n\t\tframes[frame + 2/*X*/] = mixX;\n\t\tframes[frame + 3/*Y*/] = mixY;\n\t\tframes[frame + 4/*SCALEX*/] = mixScaleX;\n\t\tframes[frame + 5/*SCALEY*/] = mixScaleY;\n\t\tframes[frame + 6/*SHEARY*/] = mixShearY;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: TransformConstraint = skeleton.transformConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tlet data = constraint.data;\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mixRotate = data.mixRotate;\n\t\t\t\t\tconstraint.mixX = data.mixX;\n\t\t\t\t\tconstraint.mixY = data.mixY;\n\t\t\t\t\tconstraint.mixScaleX = data.mixScaleX;\n\t\t\t\t\tconstraint.mixScaleY = data.mixScaleY;\n\t\t\t\t\tconstraint.mixShearY = data.mixShearY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mixRotate += (data.mixRotate - constraint.mixRotate) * alpha;\n\t\t\t\t\tconstraint.mixX += (data.mixX - constraint.mixX) * alpha;\n\t\t\t\t\tconstraint.mixY += (data.mixY - constraint.mixY) * alpha;\n\t\t\t\t\tconstraint.mixScaleX += (data.mixScaleX - constraint.mixScaleX) * alpha;\n\t\t\t\t\tconstraint.mixScaleY += (data.mixScaleY - constraint.mixScaleY) * alpha;\n\t\t\t\t\tconstraint.mixShearY += (data.mixShearY - constraint.mixShearY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet rotate, x, y, scaleX, scaleY, shearY;\n\t\tlet i = Timeline.search(frames, time, 7/*ENTRIES*/);\n\t\tlet curveType = this.curves[i / 7/*ENTRIES*/];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tscaleX = frames[i + 4/*SCALEX*/];\n\t\t\t\tscaleY = frames[i + 5/*SCALEY*/];\n\t\t\t\tshearY = frames[i + 6/*SHEARY*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 7/*ENTRIES*/] - before);\n\t\t\t\trotate += (frames[i + 7/*ENTRIES*/ + 1/*ROTATE*/] - rotate) * t;\n\t\t\t\tx += (frames[i + 7/*ENTRIES*/ + 2/*X*/] - x) * t;\n\t\t\t\ty += (frames[i + 7/*ENTRIES*/ + 3/*Y*/] - y) * t;\n\t\t\t\tscaleX += (frames[i + 7/*ENTRIES*/ + 4/*SCALEX*/] - scaleX) * t;\n\t\t\t\tscaleY += (frames[i + 7/*ENTRIES*/ + 5/*SCALEY*/] - scaleY) * t;\n\t\t\t\tshearY += (frames[i + 7/*ENTRIES*/ + 6/*SHEARY*/] - shearY) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tscaleX = frames[i + 4/*SCALEX*/];\n\t\t\t\tscaleY = frames[i + 5/*SCALEY*/];\n\t\t\t\tshearY = frames[i + 6/*SHEARY*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\trotate = this.getBezierValue(time, i, 1/*ROTATE*/, curveType - 2/*BEZIER*/);\n\t\t\t\tx = this.getBezierValue(time, i, 2/*X*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 3/*Y*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t\t\tscaleX = this.getBezierValue(time, i, 4/*SCALEX*/, curveType + 18/*BEZIER_SIZE*/ * 3 - 2/*BEZIER*/);\n\t\t\t\tscaleY = this.getBezierValue(time, i, 5/*SCALEY*/, curveType + 18/*BEZIER_SIZE*/ * 4 - 2/*BEZIER*/);\n\t\t\t\tshearY = this.getBezierValue(time, i, 6/*SHEARY*/, curveType + 18/*BEZIER_SIZE*/ * 5 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tlet data = constraint.data;\n\t\t\tconstraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\n\t\t\tconstraint.mixX = data.mixX + (x - data.mixX) * alpha;\n\t\t\tconstraint.mixY = data.mixY + (y - data.mixY) * alpha;\n\t\t\tconstraint.mixScaleX = data.mixScaleX + (scaleX - data.mixScaleX) * alpha;\n\t\t\tconstraint.mixScaleY = data.mixScaleY + (scaleY - data.mixScaleY) * alpha;\n\t\t\tconstraint.mixShearY = data.mixShearY + (shearY - data.mixShearY) * alpha;\n\t\t} else {\n\t\t\tconstraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\n\t\t\tconstraint.mixX += (x - constraint.mixX) * alpha;\n\t\t\tconstraint.mixY += (y - constraint.mixY) * alpha;\n\t\t\tconstraint.mixScaleX += (scaleX - constraint.mixScaleX) * alpha;\n\t\t\tconstraint.mixScaleY += (scaleY - constraint.mixScaleY) * alpha;\n\t\t\tconstraint.mixShearY += (shearY - constraint.mixShearY) * alpha;\n\t\t}\n\t}\n}\n\n/** Changes a path constraint's {@link PathConstraint#position}. */\nexport class PathConstraintPositionTimeline extends CurveTimeline1 {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex: number = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.pathConstraintPosition + \"|\" + pathConstraintIndex);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (constraint.active)\n\t\t\tconstraint.position = this.getAbsoluteValue(time, alpha, blend, constraint.position, constraint.data.position);\n\t}\n}\n\n/** Changes a path constraint's {@link PathConstraint#spacing}. */\nexport class PathConstraintSpacingTimeline extends CurveTimeline1 {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, Property.pathConstraintSpacing + \"|\" + pathConstraintIndex);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (constraint.active)\n\t\t\tconstraint.spacing = this.getAbsoluteValue(time, alpha, blend, constraint.spacing, constraint.data.spacing);\n\t}\n}\n\n/** Changes a transform constraint's {@link PathConstraint#getMixRotate()}, {@link PathConstraint#getMixX()}, and\n * {@link PathConstraint#getMixY()}. */\nexport class PathConstraintMixTimeline extends CurveTimeline {\n\t/** The index of the path constraint in {@link Skeleton#getPathConstraints()} that will be changed when this timeline is\n\t * applied. */\n\tconstraintIndex = 0;\n\n\tconstructor (frameCount: number, bezierCount: number, pathConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, [\n\t\t\tProperty.pathConstraintMix + \"|\" + pathConstraintIndex\n\t\t]);\n\t\tthis.constraintIndex = pathConstraintIndex;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn 4/*ENTRIES*/;\n\t}\n\n\tsetFrame (frame: number, time: number, mixRotate: number, mixX: number, mixY: number) {\n\t\tlet frames = this.frames;\n\t\tframe <<= 2;\n\t\tframes[frame] = time;\n\t\tframes[frame + 1/*ROTATE*/] = mixRotate;\n\t\tframes[frame + 2/*X*/] = mixX;\n\t\tframes[frame + 3/*Y*/] = mixY;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PathConstraint = skeleton.pathConstraints[this.constraintIndex];\n\t\tif (!constraint.active) return;\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tconstraint.mixRotate = constraint.data.mixRotate;\n\t\t\t\t\tconstraint.mixX = constraint.data.mixX;\n\t\t\t\t\tconstraint.mixY = constraint.data.mixY;\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tconstraint.mixRotate += (constraint.data.mixRotate - constraint.mixRotate) * alpha;\n\t\t\t\t\tconstraint.mixX += (constraint.data.mixX - constraint.mixX) * alpha;\n\t\t\t\t\tconstraint.mixY += (constraint.data.mixY - constraint.mixY) * alpha;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tlet rotate, x, y;\n\t\tlet i = Timeline.search(frames, time, 4/*ENTRIES*/);\n\t\tlet curveType = this.curves[i >> 2];\n\t\tswitch (curveType) {\n\t\t\tcase 0/*LINEAR*/:\n\t\t\t\tlet before = frames[i];\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tlet t = (time - before) / (frames[i + 4/*ENTRIES*/] - before);\n\t\t\t\trotate += (frames[i + 4/*ENTRIES*/ + 1/*ROTATE*/] - rotate) * t;\n\t\t\t\tx += (frames[i + 4/*ENTRIES*/ + 2/*X*/] - x) * t;\n\t\t\t\ty += (frames[i + 4/*ENTRIES*/ + 3/*Y*/] - y) * t;\n\t\t\t\tbreak;\n\t\t\tcase 1/*STEPPED*/:\n\t\t\t\trotate = frames[i + 1/*ROTATE*/];\n\t\t\t\tx = frames[i + 2/*X*/];\n\t\t\t\ty = frames[i + 3/*Y*/];\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\trotate = this.getBezierValue(time, i, 1/*ROTATE*/, curveType - 2/*BEZIER*/);\n\t\t\t\tx = this.getBezierValue(time, i, 2/*X*/, curveType + 18/*BEZIER_SIZE*/ - 2/*BEZIER*/);\n\t\t\t\ty = this.getBezierValue(time, i, 3/*Y*/, curveType + 18/*BEZIER_SIZE*/ * 2 - 2/*BEZIER*/);\n\t\t}\n\n\t\tif (blend == MixBlend.setup) {\n\t\t\tlet data = constraint.data;\n\t\t\tconstraint.mixRotate = data.mixRotate + (rotate - data.mixRotate) * alpha;\n\t\t\tconstraint.mixX = data.mixX + (x - data.mixX) * alpha;\n\t\t\tconstraint.mixY = data.mixY + (y - data.mixY) * alpha;\n\t\t} else {\n\t\t\tconstraint.mixRotate += (rotate - constraint.mixRotate) * alpha;\n\t\t\tconstraint.mixX += (x - constraint.mixX) * alpha;\n\t\t\tconstraint.mixY += (y - constraint.mixY) * alpha;\n\t\t}\n\t}\n}\n\n/** The base class for most {@link PhysicsConstraint} timelines. */\nexport abstract class PhysicsConstraintTimeline extends CurveTimeline1 {\n\t/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be changed when this timeline\n\t * is applied, or -1 if all physics constraints in the skeleton will be changed. */\n\tconstraintIndex = 0;\n\n\t/** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number, property: number) {\n\t\tsuper(frameCount, bezierCount, property + \"|\" + physicsConstraintIndex);\n\t\tthis.constraintIndex = physicsConstraintIndex;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet constraint: PhysicsConstraint;\n\t\tif (this.constraintIndex == -1) {\n\t\t\tconst value = time >= this.frames[0] ? this.getCurveValue(time) : 0;\n\n\t\t\tfor (const constraint of skeleton.physicsConstraints) {\n\t\t\t\tif (constraint.active && this.global(constraint.data))\n\t\t\t\t\tthis.set(constraint, this.getAbsoluteValue2(time, alpha, blend, this.get(constraint), this.setup(constraint), value));\n\t\t\t}\n\t\t} else {\n\t\t\tconstraint = skeleton.physicsConstraints[this.constraintIndex];\n\t\t\tif (constraint.active) this.set(constraint, this.getAbsoluteValue(time, alpha, blend, this.get(constraint), this.setup(constraint)));\n\t\t}\n\t}\n\n\tabstract setup (constraint: PhysicsConstraint): number;\n\n\tabstract get (constraint: PhysicsConstraint): number;\n\n\tabstract set (constraint: PhysicsConstraint, value: number): void;\n\n\tabstract global (constraint: PhysicsConstraintData): boolean;\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getInertia()}. */\nexport class PhysicsConstraintInertiaTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintInertia);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.inertia;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.inertia;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.inertia = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.inertiaGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getStrength()}. */\nexport class PhysicsConstraintStrengthTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintStrength);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.strength;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.strength;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.strength = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.strengthGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getDamping()}. */\nexport class PhysicsConstraintDampingTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintDamping);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.damping;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.damping;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.damping = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.dampingGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getMassInverse()}. The timeline values are not inverted. */\nexport class PhysicsConstraintMassTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMass);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn 1 / constraint.data.massInverse;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn 1 / constraint.massInverse;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.massInverse = 1 / value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.massGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getWind()}. */\nexport class PhysicsConstraintWindTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintWind);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.wind;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.wind;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.wind = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.windGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getGravity()}. */\nexport class PhysicsConstraintGravityTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintGravity);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.gravity;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.gravity;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.gravity = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.gravityGlobal;\n\t}\n}\n\n/** Changes a physics constraint's {@link PhysicsConstraint#getMix()}. */\nexport class PhysicsConstraintMixTimeline extends PhysicsConstraintTimeline {\n\tconstructor (frameCount: number, bezierCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, bezierCount, physicsConstraintIndex, Property.physicsConstraintMix);\n\t}\n\n\tsetup (constraint: PhysicsConstraint): number {\n\t\treturn constraint.data.mix;\n\t}\n\n\tget (constraint: PhysicsConstraint): number {\n\t\treturn constraint.mix;\n\t}\n\n\tset (constraint: PhysicsConstraint, value: number): void {\n\t\tconstraint.mix = value;\n\t}\n\n\tglobal (constraint: PhysicsConstraintData): boolean {\n\t\treturn constraint.mixGlobal;\n\t}\n}\n\n/** Resets a physics constraint when specific animation times are reached. */\nexport class PhysicsConstraintResetTimeline extends Timeline {\n\tprivate static propertyIds: string[] = [Property.physicsConstraintReset.toString()];\n\n\t/** The index of the physics constraint in {@link Skeleton#getPhysicsConstraints()} that will be reset when this timeline is\n\t* applied, or -1 if all physics constraints in the skeleton will be reset. */\n\tconstraintIndex: number;\n\n\t/** @param physicsConstraintIndex -1 for all physics constraints in the skeleton. */\n\tconstructor (frameCount: number, physicsConstraintIndex: number) {\n\t\tsuper(frameCount, PhysicsConstraintResetTimeline.propertyIds);\n\t\tthis.constraintIndex = physicsConstraintIndex;\n\t}\n\n\tgetFrameCount () {\n\t\treturn this.frames.length;\n\t}\n\n\t/** Sets the time for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive. */\n\tsetFrame (frame: number, time: number) {\n\t\tthis.frames[frame] = time;\n\t}\n\n\t/** Resets the physics constraint when frames > lastTime and <= time. */\n\tapply (skeleton: Skeleton, lastTime: number, time: number, firedEvents: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\n\t\tlet constraint: PhysicsConstraint | undefined;\n\t\tif (this.constraintIndex != -1) {\n\t\t\tconstraint = skeleton.physicsConstraints[this.constraintIndex];\n\t\t\tif (!constraint.active) return;\n\t\t}\n\n\t\tconst frames = this.frames;\n\n\t\tif (lastTime > time) { // Apply after lastTime for looped animations.\n\t\t\tthis.apply(skeleton, lastTime, Number.MAX_VALUE, [], alpha, blend, direction);\n\t\t\tlastTime = -1;\n\t\t} else if (lastTime >= frames[frames.length - 1]) // Last time is after last frame.\n\t\t\treturn;\n\t\tif (time < frames[0]) return;\n\n\t\tif (lastTime < frames[0] || time >= frames[Timeline.search1(frames, lastTime) + 1]) {\n\t\t\tif (constraint != null)\n\t\t\t\tconstraint.reset();\n\t\t\telse {\n\t\t\t\tfor (const constraint of skeleton.physicsConstraints) {\n\t\t\t\t\tif (constraint.active) constraint.reset();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\n/** Changes a slot's {@link Slot#getSequenceIndex()} for an attachment's {@link Sequence}. */\nexport class SequenceTimeline extends Timeline implements SlotTimeline {\n\tstatic ENTRIES = 3;\n\tstatic MODE = 1;\n\tstatic DELAY = 2;\n\n\tslotIndex: number;\n\tattachment: HasTextureRegion;\n\n\tconstructor (frameCount: number, slotIndex: number, attachment: HasTextureRegion) {\n\t\tsuper(frameCount, [\n\t\t\tProperty.sequence + \"|\" + slotIndex + \"|\" + attachment.sequence!.id\n\t\t]);\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.attachment = attachment;\n\t}\n\n\tgetFrameEntries () {\n\t\treturn SequenceTimeline.ENTRIES;\n\t}\n\n\tgetSlotIndex () {\n\t\treturn this.slotIndex;\n\t}\n\n\tgetAttachment () {\n\t\treturn this.attachment as unknown as Attachment;\n\t}\n\n\t/** Sets the time, mode, index, and frame time for the specified frame.\n\t * @param frame Between 0 and frameCount, inclusive.\n\t * @param time Seconds between frames. */\n\tsetFrame (frame: number, time: number, mode: SequenceMode, index: number, delay: number) {\n\t\tlet frames = this.frames;\n\t\tframe *= SequenceTimeline.ENTRIES;\n\t\tframes[frame] = time;\n\t\tframes[frame + SequenceTimeline.MODE] = mode | (index << 4);\n\t\tframes[frame + SequenceTimeline.DELAY] = delay;\n\t}\n\n\tapply (skeleton: Skeleton, lastTime: number, time: number, events: Array, alpha: number, blend: MixBlend, direction: MixDirection) {\n\t\tlet slot = skeleton.slots[this.slotIndex];\n\t\tif (!slot.bone.active) return;\n\t\tlet slotAttachment = slot.attachment;\n\t\tlet attachment = this.attachment as unknown as Attachment;\n\t\tif (slotAttachment != attachment) {\n\t\t\tif (!(slotAttachment instanceof VertexAttachment)\n\t\t\t\t|| (slotAttachment as VertexAttachment).timelineAttachment != attachment) return;\n\t\t}\n\n\t\tif (direction == MixDirection.mixOut) {\n\t\t\tif (blend == MixBlend.setup) slot.sequenceIndex = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tlet frames = this.frames;\n\t\tif (time < frames[0]) {\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first) slot.sequenceIndex = -1;\n\t\t\treturn;\n\t\t}\n\n\t\tlet i = Timeline.search(frames, time, SequenceTimeline.ENTRIES);\n\t\tlet before = frames[i];\n\t\tlet modeAndIndex = frames[i + SequenceTimeline.MODE];\n\t\tlet delay = frames[i + SequenceTimeline.DELAY];\n\n\t\tif (!this.attachment.sequence) return;\n\t\tlet index = modeAndIndex >> 4, count = this.attachment.sequence!.regions.length;\n\t\tlet mode = SequenceModeValues[modeAndIndex & 0xf];\n\t\tif (mode != SequenceMode.hold) {\n\t\t\tindex += (((time - before) / delay + 0.00001) | 0);\n\t\t\tswitch (mode) {\n\t\t\t\tcase SequenceMode.once:\n\t\t\t\t\tindex = Math.min(count - 1, index);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.loop:\n\t\t\t\t\tindex %= count;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.pingpong: {\n\t\t\t\t\tlet n = (count << 1) - 2;\n\t\t\t\t\tindex = n == 0 ? 0 : index % n;\n\t\t\t\t\tif (index >= count) index = n - index;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase SequenceMode.onceReverse:\n\t\t\t\t\tindex = Math.max(count - 1 - index, 0);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.loopReverse:\n\t\t\t\t\tindex = count - 1 - (index % count);\n\t\t\t\t\tbreak;\n\t\t\t\tcase SequenceMode.pingpongReverse: {\n\t\t\t\t\tlet n = (count << 1) - 2;\n\t\t\t\t\tindex = n == 0 ? 0 : (index + count - 1) % n;\n\t\t\t\t\tif (index >= count) index = n - index;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tslot.sequenceIndex = index;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, MixBlend, AttachmentTimeline, MixDirection, RotateTimeline, DrawOrderTimeline, Timeline, EventTimeline } from \"./Animation.js\";\nimport { AnimationStateData } from \"./AnimationStateData.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { StringSet, Pool, Utils, MathUtils } from \"./Utils.js\";\nimport { Event } from \"./Event.js\";\n\n\n/** Applies animations over time, queues animations for later playback, mixes (crossfading) between animations, and applies\n * multiple animations on top of each other (layering).\n *\n * See [Applying Animations](http://esotericsoftware.com/spine-applying-animations/) in the Spine Runtimes Guide. */\nexport class AnimationState {\n\tstatic _emptyAnimation = new Animation(\"\", [], 0);\n\tprivate static emptyAnimation (): Animation {\n\t\treturn AnimationState._emptyAnimation;\n\t}\n\n\t/** The AnimationStateData to look up mix durations. */\n\tdata: AnimationStateData;\n\n\t/** The list of tracks that currently have animations, which may contain null entries. */\n\ttracks = new Array();\n\n\t/** Multiplier for the delta time when the animation state is updated, causing time for all animations and mixes to play slower\n\t * or faster. Defaults to 1.\n\t *\n\t * See TrackEntry {@link TrackEntry#timeScale} for affecting a single animation. */\n\ttimeScale = 1;\n\tunkeyedState = 0;\n\n\tevents = new Array();\n\tlisteners = new Array();\n\tqueue = new EventQueue(this);\n\tpropertyIDs = new StringSet();\n\tanimationsChanged = false;\n\n\ttrackEntryPool = new Pool(() => new TrackEntry());\n\n\tconstructor (data: AnimationStateData) {\n\t\tthis.data = data;\n\t}\n\n\t/** Increments each track entry {@link TrackEntry#trackTime()}, setting queued animations as current if needed. */\n\tupdate (delta: number) {\n\t\tdelta *= this.timeScale;\n\t\tlet tracks = this.tracks;\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet current = tracks[i];\n\t\t\tif (!current) continue;\n\n\t\t\tcurrent.animationLast = current.nextAnimationLast;\n\t\t\tcurrent.trackLast = current.nextTrackLast;\n\n\t\t\tlet currentDelta = delta * current.timeScale;\n\n\t\t\tif (current.delay > 0) {\n\t\t\t\tcurrent.delay -= currentDelta;\n\t\t\t\tif (current.delay > 0) continue;\n\t\t\t\tcurrentDelta = -current.delay;\n\t\t\t\tcurrent.delay = 0;\n\t\t\t}\n\n\t\t\tlet next = current.next;\n\t\t\tif (next) {\n\t\t\t\t// When the next entry's delay is passed, change to the next entry, preserving leftover time.\n\t\t\t\tlet nextTime = current.trackLast - next.delay;\n\t\t\t\tif (nextTime >= 0) {\n\t\t\t\t\tnext.delay = 0;\n\t\t\t\t\tnext.trackTime += current.timeScale == 0 ? 0 : (nextTime / current.timeScale + delta) * next.timeScale;\n\t\t\t\t\tcurrent.trackTime += currentDelta;\n\t\t\t\t\tthis.setCurrent(i, next, true);\n\t\t\t\t\twhile (next.mixingFrom) {\n\t\t\t\t\t\tnext.mixTime += delta;\n\t\t\t\t\t\tnext = next.mixingFrom;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t} else if (current.trackLast >= current.trackEnd && !current.mixingFrom) {\n\t\t\t\ttracks[i] = null;\n\t\t\t\tthis.queue.end(current);\n\t\t\t\tthis.clearNext(current);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (current.mixingFrom && this.updateMixingFrom(current, delta)) {\n\t\t\t\t// End mixing from entries once all have completed.\n\t\t\t\tlet from: TrackEntry | null = current.mixingFrom;\n\t\t\t\tcurrent.mixingFrom = null;\n\t\t\t\tif (from) from.mixingTo = null;\n\t\t\t\twhile (from) {\n\t\t\t\t\tthis.queue.end(from);\n\t\t\t\t\tfrom = from.mixingFrom;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcurrent.trackTime += currentDelta;\n\t\t}\n\n\t\tthis.queue.drain();\n\t}\n\n\t/** Returns true when all mixing from entries are complete. */\n\tupdateMixingFrom (to: TrackEntry, delta: number): boolean {\n\t\tlet from = to.mixingFrom;\n\t\tif (!from) return true;\n\n\t\tlet finished = this.updateMixingFrom(from, delta);\n\n\t\tfrom.animationLast = from.nextAnimationLast;\n\t\tfrom.trackLast = from.nextTrackLast;\n\n\t\t// The from entry was applied at least once and the mix is complete.\n\t\tif (to.nextTrackLast != -1 && to.mixTime >= to.mixDuration) {\n\t\t\t// Mixing is complete for all entries before the from entry or the mix is instantaneous.\n\t\t\tif (from.totalAlpha == 0 || to.mixDuration == 0) {\n\t\t\t\tto.mixingFrom = from.mixingFrom;\n\t\t\t\tif (from.mixingFrom != null) from.mixingFrom.mixingTo = to;\n\t\t\t\tto.interruptAlpha = from.interruptAlpha;\n\t\t\t\tthis.queue.end(from);\n\t\t\t}\n\t\t\treturn finished;\n\t\t}\n\n\t\tfrom.trackTime += delta * from.timeScale;\n\t\tto.mixTime += delta;\n\t\treturn false;\n\t}\n\n\t/** Poses the skeleton using the track entry animations. There are no side effects other than invoking listeners, so the\n\t * animation state can be applied to multiple skeletons to pose them identically.\n\t * @returns True if any animations were applied. */\n\tapply (skeleton: Skeleton): boolean {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tif (this.animationsChanged) this._animationsChanged();\n\n\t\tlet events = this.events;\n\t\tlet tracks = this.tracks;\n\t\tlet applied = false;\n\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet current = tracks[i];\n\t\t\tif (!current || current.delay > 0) continue;\n\t\t\tapplied = true;\n\t\t\tlet blend: MixBlend = i == 0 ? MixBlend.first : current.mixBlend;\n\n\t\t\t// Apply mixing from entries first.\n\t\t\tlet alpha = current.alpha;\n\t\t\tif (current.mixingFrom)\n\t\t\t\talpha *= this.applyMixingFrom(current, skeleton, blend);\n\t\t\telse if (current.trackTime >= current.trackEnd && !current.next)\n\t\t\t\talpha = 0;\n\t\t\tlet attachments = alpha >= current.alphaAttachmentThreshold;\n\n\n\t\t\t// Apply current entry.\n\t\t\tlet animationLast = current.animationLast, animationTime = current.getAnimationTime(), applyTime = animationTime;\n\t\t\tlet applyEvents: Event[] | null = events;\n\t\t\tif (current.reverse) {\n\t\t\t\tapplyTime = current.animation!.duration - applyTime;\n\t\t\t\tapplyEvents = null;\n\t\t\t}\n\t\t\tlet timelines = current.animation!.timelines;\n\t\t\tlet timelineCount = timelines.length;\n\t\t\tif ((i == 0 && alpha == 1) || blend == MixBlend.add) {\n\t\t\t\tif (i == 0) attachments = true;\n\t\t\t\tfor (let ii = 0; ii < timelineCount; ii++) {\n\t\t\t\t\t// Fixes issue #302 on IOS9 where mix, blend sometimes became undefined and caused assets\n\t\t\t\t\t// to sometimes stop rendering when using color correction, as their RGBA values become NaN.\n\t\t\t\t\t// (https://github.com/pixijs/pixi-spine/issues/302)\n\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\tvar timeline = timelines[ii];\n\t\t\t\t\tif (timeline instanceof AttachmentTimeline)\n\t\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments);\n\t\t\t\t\telse\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection.mixIn);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet timelineMode = current.timelineMode;\n\n\t\t\t\tlet shortestRotation = current.shortestRotation;\n\t\t\t\tlet firstFrame = !shortestRotation && current.timelinesRotation.length != timelineCount << 1;\n\t\t\t\tif (firstFrame) current.timelinesRotation.length = timelineCount << 1;\n\n\t\t\t\tfor (let ii = 0; ii < timelineCount; ii++) {\n\t\t\t\t\tlet timeline = timelines[ii];\n\t\t\t\t\tlet timelineBlend = timelineMode[ii] == SUBSEQUENT ? blend : MixBlend.setup;\n\t\t\t\t\tif (!shortestRotation && timeline instanceof RotateTimeline) {\n\t\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, current.timelinesRotation, ii << 1, firstFrame);\n\t\t\t\t\t} else if (timeline instanceof AttachmentTimeline) {\n\t\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, blend, attachments);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\t\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, MixDirection.mixIn);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.queueEvents(current, animationTime);\n\t\t\tevents.length = 0;\n\t\t\tcurrent.nextAnimationLast = animationTime;\n\t\t\tcurrent.nextTrackLast = current.trackTime;\n\t\t}\n\n\t\t// Set slots attachments to the setup pose, if needed. This occurs if an animation that is mixing out sets attachments so\n\t\t// subsequent timelines see any deform, but the subsequent timelines don't set an attachment (eg they are also mixing out or\n\t\t// the time is before the first key).\n\t\tvar setupState = this.unkeyedState + SETUP;\n\t\tvar slots = skeleton.slots;\n\t\tfor (var i = 0, n = skeleton.slots.length; i < n; i++) {\n\t\t\tvar slot = slots[i];\n\t\t\tif (slot.attachmentState == setupState) {\n\t\t\t\tvar attachmentName = slot.data.attachmentName;\n\t\t\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n\t\t\t}\n\t\t}\n\t\tthis.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.\n\n\t\tthis.queue.drain();\n\t\treturn applied;\n\t}\n\n\tapplyMixingFrom (to: TrackEntry, skeleton: Skeleton, blend: MixBlend) {\n\t\tlet from = to.mixingFrom!;\n\t\tif (from.mixingFrom) this.applyMixingFrom(from, skeleton, blend);\n\n\t\tlet mix = 0;\n\t\tif (to.mixDuration == 0) { // Single frame mix to undo mixingFrom changes.\n\t\t\tmix = 1;\n\t\t\tif (blend == MixBlend.first) blend = MixBlend.setup;\n\t\t} else {\n\t\t\tmix = to.mixTime / to.mixDuration;\n\t\t\tif (mix > 1) mix = 1;\n\t\t\tif (blend != MixBlend.first) blend = from.mixBlend;\n\t\t}\n\n\t\tlet attachments = mix < from.mixAttachmentThreshold, drawOrder = mix < from.mixDrawOrderThreshold;\n\t\tlet timelines = from.animation!.timelines;\n\t\tlet timelineCount = timelines.length;\n\t\tlet alphaHold = from.alpha * to.interruptAlpha, alphaMix = alphaHold * (1 - mix);\n\t\tlet animationLast = from.animationLast, animationTime = from.getAnimationTime(), applyTime = animationTime;\n\t\tlet events = null;\n\t\tif (from.reverse)\n\t\t\tapplyTime = from.animation!.duration - applyTime;\n\t\telse if (mix < from.eventThreshold)\n\t\t\tevents = this.events;\n\n\t\tif (blend == MixBlend.add) {\n\t\t\tfor (let i = 0; i < timelineCount; i++)\n\t\t\t\ttimelines[i].apply(skeleton, animationLast, applyTime, events, alphaMix, blend, MixDirection.mixOut);\n\t\t} else {\n\t\t\tlet timelineMode = from.timelineMode;\n\t\t\tlet timelineHoldMix = from.timelineHoldMix;\n\n\t\t\tlet shortestRotation = from.shortestRotation;\n\t\t\tlet firstFrame = !shortestRotation && from.timelinesRotation.length != timelineCount << 1;\n\t\t\tif (firstFrame) from.timelinesRotation.length = timelineCount << 1;\n\n\t\t\tfrom.totalAlpha = 0;\n\t\t\tfor (let i = 0; i < timelineCount; i++) {\n\t\t\t\tlet timeline = timelines[i];\n\t\t\t\tlet direction = MixDirection.mixOut;\n\t\t\t\tlet timelineBlend: MixBlend;\n\t\t\t\tlet alpha = 0;\n\t\t\t\tswitch (timelineMode[i]) {\n\t\t\t\t\tcase SUBSEQUENT:\n\t\t\t\t\t\tif (!drawOrder && timeline instanceof DrawOrderTimeline) continue;\n\t\t\t\t\t\ttimelineBlend = blend;\n\t\t\t\t\t\talpha = alphaMix;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase FIRST:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\talpha = alphaMix;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOLD_SUBSEQUENT:\n\t\t\t\t\t\ttimelineBlend = blend;\n\t\t\t\t\t\talpha = alphaHold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase HOLD_FIRST:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\talpha = alphaHold;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\ttimelineBlend = MixBlend.setup;\n\t\t\t\t\t\tlet holdMix = timelineHoldMix[i];\n\t\t\t\t\t\talpha = alphaHold * Math.max(0, 1 - holdMix.mixTime / holdMix.mixDuration);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfrom.totalAlpha += alpha;\n\n\t\t\t\tif (!shortestRotation && timeline instanceof RotateTimeline)\n\t\t\t\t\tthis.applyRotateTimeline(timeline, skeleton, applyTime, alpha, timelineBlend, from.timelinesRotation, i << 1, firstFrame);\n\t\t\t\telse if (timeline instanceof AttachmentTimeline)\n\t\t\t\t\tthis.applyAttachmentTimeline(timeline, skeleton, applyTime, timelineBlend, attachments && alpha >= from.alphaAttachmentThreshold);\n\t\t\t\telse {\n\t\t\t\t\t// This fixes the WebKit 602 specific issue described at http://esotericsoftware.com/forum/iOS-10-disappearing-graphics-10109\n\t\t\t\t\tUtils.webkit602BugfixHelper(alpha, blend);\n\t\t\t\t\tif (drawOrder && timeline instanceof DrawOrderTimeline && timelineBlend == MixBlend.setup)\n\t\t\t\t\t\tdirection = MixDirection.mixIn;\n\t\t\t\t\ttimeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (to.mixDuration > 0) this.queueEvents(from, animationTime);\n\t\tthis.events.length = 0;\n\t\tfrom.nextAnimationLast = animationTime;\n\t\tfrom.nextTrackLast = from.trackTime;\n\n\t\treturn mix;\n\t}\n\n\tapplyAttachmentTimeline (timeline: AttachmentTimeline, skeleton: Skeleton, time: number, blend: MixBlend, attachments: boolean) {\n\t\tvar slot = skeleton.slots[timeline.slotIndex];\n\t\tif (!slot.bone.active) return;\n\n\t\tif (time < timeline.frames[0]) { // Time is before first frame.\n\t\t\tif (blend == MixBlend.setup || blend == MixBlend.first)\n\t\t\t\tthis.setAttachment(skeleton, slot, slot.data.attachmentName, attachments);\n\t\t} else\n\t\t\tthis.setAttachment(skeleton, slot, timeline.attachmentNames[Timeline.search1(timeline.frames, time)], attachments);\n\n\t\t// If an attachment wasn't set (ie before the first frame or attachments is false), set the setup attachment later.\n\t\tif (slot.attachmentState <= this.unkeyedState) slot.attachmentState = this.unkeyedState + SETUP;\n\t}\n\n\tsetAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string | null, attachments: boolean) {\n\t\tslot.setAttachment(!attachmentName ? null : skeleton.getAttachment(slot.data.index, attachmentName));\n\t\tif (attachments) slot.attachmentState = this.unkeyedState + CURRENT;\n\t}\n\n\tapplyRotateTimeline (timeline: RotateTimeline, skeleton: Skeleton, time: number, alpha: number, blend: MixBlend,\n\t\ttimelinesRotation: Array, i: number, firstFrame: boolean) {\n\n\t\tif (firstFrame) timelinesRotation[i] = 0;\n\n\t\tif (alpha == 1) {\n\t\t\ttimeline.apply(skeleton, 0, time, null, 1, blend, MixDirection.mixIn);\n\t\t\treturn;\n\t\t}\n\n\t\tlet bone = skeleton.bones[timeline.boneIndex];\n\t\tif (!bone.active) return;\n\t\tlet frames = timeline.frames;\n\t\tlet r1 = 0, r2 = 0;\n\t\tif (time < frames[0]) {\n\t\t\tswitch (blend) {\n\t\t\t\tcase MixBlend.setup:\n\t\t\t\t\tbone.rotation = bone.data.rotation;\n\t\t\t\tdefault:\n\t\t\t\t\treturn;\n\t\t\t\tcase MixBlend.first:\n\t\t\t\t\tr1 = bone.rotation;\n\t\t\t\t\tr2 = bone.data.rotation;\n\t\t\t}\n\t\t} else {\n\t\t\tr1 = blend == MixBlend.setup ? bone.data.rotation : bone.rotation;\n\t\t\tr2 = bone.data.rotation + timeline.getCurveValue(time);\n\t\t}\n\n\t\t// Mix between rotations using the direction of the shortest route on the first frame while detecting crosses.\n\t\tlet total = 0, diff = r2 - r1;\n\t\tdiff -= Math.ceil(diff / 360 - 0.5) * 360;\n\t\tif (diff == 0) {\n\t\t\ttotal = timelinesRotation[i];\n\t\t} else {\n\t\t\tlet lastTotal = 0, lastDiff = 0;\n\t\t\tif (firstFrame) {\n\t\t\t\tlastTotal = 0;\n\t\t\t\tlastDiff = diff;\n\t\t\t} else {\n\t\t\t\tlastTotal = timelinesRotation[i];\n\t\t\t\tlastDiff = timelinesRotation[i + 1];\n\t\t\t}\n\t\t\tlet loops = lastTotal - lastTotal % 360;\n\t\t\ttotal = diff + loops;\n\t\t\tlet current = diff >= 0, dir = lastTotal >= 0;\n\t\t\tif (Math.abs(lastDiff) <= 90 && MathUtils.signum(lastDiff) != MathUtils.signum(diff)) {\n\t\t\t\tif (Math.abs(lastTotal - loops) > 180) {\n\t\t\t\t\ttotal += 360 * MathUtils.signum(lastTotal);\n\t\t\t\t\tdir = current;\n\t\t\t\t} else if (loops != 0)\n\t\t\t\t\ttotal -= 360 * MathUtils.signum(lastTotal);\n\t\t\t\telse\n\t\t\t\t\tdir = current;\n\t\t\t}\n\t\t\tif (dir != current) total += 360 * MathUtils.signum(lastTotal);\n\t\t\ttimelinesRotation[i] = total;\n\t\t}\n\t\ttimelinesRotation[i + 1] = diff;\n\t\tbone.rotation = r1 + total * alpha;\n\t}\n\n\tqueueEvents (entry: TrackEntry, animationTime: number) {\n\t\tlet animationStart = entry.animationStart, animationEnd = entry.animationEnd;\n\t\tlet duration = animationEnd - animationStart;\n\t\tlet trackLastWrapped = entry.trackLast % duration;\n\n\t\t// Queue events before complete.\n\t\tlet events = this.events;\n\t\tlet i = 0, n = events.length;\n\t\tfor (; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.time < trackLastWrapped) break;\n\t\t\tif (event.time > animationEnd) continue; // Discard events outside animation start/end.\n\t\t\tthis.queue.event(entry, event);\n\t\t}\n\n\t\t// Queue complete if completed a loop iteration or the animation.\n\t\tlet complete = false;\n\t\tif (entry.loop) {\n\t\t\tif (duration == 0)\n\t\t\t\tcomplete = true;\n\t\t\telse {\n\t\t\t\tconst cycles = Math.floor(entry.trackTime / duration);\n\t\t\t\tcomplete = cycles > 0 && cycles > Math.floor(entry.trackLast / duration);\n\t\t\t}\n\t\t} else\n\t\t\tcomplete = animationTime >= animationEnd && entry.animationLast < animationEnd;\n\t\tif (complete) this.queue.complete(entry);\n\n\t\t// Queue events after complete.\n\t\tfor (; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.time < animationStart) continue; // Discard events outside animation start/end.\n\t\t\tthis.queue.event(entry, event);\n\t\t}\n\t}\n\n\t/** Removes all animations from all tracks, leaving skeletons in their current pose.\n\t *\n\t * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\n\t * rather than leaving them in their current pose. */\n\tclearTracks () {\n\t\tlet oldDrainDisabled = this.queue.drainDisabled;\n\t\tthis.queue.drainDisabled = true;\n\t\tfor (let i = 0, n = this.tracks.length; i < n; i++)\n\t\t\tthis.clearTrack(i);\n\t\tthis.tracks.length = 0;\n\t\tthis.queue.drainDisabled = oldDrainDisabled;\n\t\tthis.queue.drain();\n\t}\n\n\t/** Removes all animations from the track, leaving skeletons in their current pose.\n\t *\n\t * It may be desired to use {@link AnimationState#setEmptyAnimation()} to mix the skeletons back to the setup pose,\n\t * rather than leaving them in their current pose. */\n\tclearTrack (trackIndex: number) {\n\t\tif (trackIndex >= this.tracks.length) return;\n\t\tlet current = this.tracks[trackIndex];\n\t\tif (!current) return;\n\n\t\tthis.queue.end(current);\n\n\t\tthis.clearNext(current);\n\n\t\tlet entry = current;\n\t\twhile (true) {\n\t\t\tlet from = entry.mixingFrom;\n\t\t\tif (!from) break;\n\t\t\tthis.queue.end(from);\n\t\t\tentry.mixingFrom = null;\n\t\t\tentry.mixingTo = null;\n\t\t\tentry = from;\n\t\t}\n\n\t\tthis.tracks[current.trackIndex] = null;\n\n\t\tthis.queue.drain();\n\t}\n\n\tsetCurrent (index: number, current: TrackEntry, interrupt: boolean) {\n\t\tlet from = this.expandToIndex(index);\n\t\tthis.tracks[index] = current;\n\t\tcurrent.previous = null;\n\n\t\tif (from) {\n\t\t\tif (interrupt) this.queue.interrupt(from);\n\t\t\tcurrent.mixingFrom = from;\n\t\t\tfrom.mixingTo = current;\n\t\t\tcurrent.mixTime = 0;\n\n\t\t\t// Store the interrupted mix percentage.\n\t\t\tif (from.mixingFrom && from.mixDuration > 0)\n\t\t\t\tcurrent.interruptAlpha *= Math.min(1, from.mixTime / from.mixDuration);\n\n\t\t\tfrom.timelinesRotation.length = 0; // Reset rotation for mixing out, in case entry was mixed in.\n\t\t}\n\n\t\tthis.queue.start(current);\n\t}\n\n\t/** Sets an animation by name.\n\t *\n\t * See {@link #setAnimationWith()}. */\n\tsetAnimation (trackIndex: number, animationName: string, loop: boolean = false) {\n\t\tlet animation = this.data.skeletonData.findAnimation(animationName);\n\t\tif (!animation) throw new Error(\"Animation not found: \" + animationName);\n\t\treturn this.setAnimationWith(trackIndex, animation, loop);\n\t}\n\n\t/** Sets the current animation for a track, discarding any queued animations. If the formerly current track entry was never\n\t * applied to a skeleton, it is replaced (not mixed from).\n\t * @param loop If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. In either case {@link TrackEntry#trackEnd} determines when the track is cleared.\n\t * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\tsetAnimationWith (trackIndex: number, animation: Animation, loop: boolean = false) {\n\t\tif (!animation) throw new Error(\"animation cannot be null.\");\n\t\tlet interrupt = true;\n\t\tlet current = this.expandToIndex(trackIndex);\n\t\tif (current) {\n\t\t\tif (current.nextTrackLast == -1) {\n\t\t\t\t// Don't mix from an entry that was never applied.\n\t\t\t\tthis.tracks[trackIndex] = current.mixingFrom;\n\t\t\t\tthis.queue.interrupt(current);\n\t\t\t\tthis.queue.end(current);\n\t\t\t\tthis.clearNext(current);\n\t\t\t\tcurrent = current.mixingFrom;\n\t\t\t\tinterrupt = false;\n\t\t\t} else\n\t\t\t\tthis.clearNext(current);\n\t\t}\n\t\tlet entry = this.trackEntry(trackIndex, animation, loop, current);\n\t\tthis.setCurrent(trackIndex, entry, interrupt);\n\t\tthis.queue.drain();\n\t\treturn entry;\n\t}\n\n\t/** Queues an animation by name.\n\t *\n\t * See {@link #addAnimationWith()}. */\n\taddAnimation (trackIndex: number, animationName: string, loop: boolean = false, delay: number = 0) {\n\t\tlet animation = this.data.skeletonData.findAnimation(animationName);\n\t\tif (!animation) throw new Error(\"Animation not found: \" + animationName);\n\t\treturn this.addAnimationWith(trackIndex, animation, loop, delay);\n\t}\n\n\t/** Adds an animation to be played after the current or last queued animation for a track. If the track is empty, it is\n\t * equivalent to calling {@link #setAnimationWith()}.\n\t * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\n\t * minus any mix duration (from the {@link AnimationStateData}) plus the specified `delay` (ie the mix\n\t * ends at (`delay` = 0) or before (`delay` < 0) the previous track entry duration). If the\n\t * previous entry is looping, its next loop completion is used instead of its duration.\n\t * @returns A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\taddAnimationWith (trackIndex: number, animation: Animation, loop: boolean = false, delay: number = 0) {\n\t\tif (!animation) throw new Error(\"animation cannot be null.\");\n\n\t\tlet last = this.expandToIndex(trackIndex);\n\t\tif (last) {\n\t\t\twhile (last.next)\n\t\t\t\tlast = last.next;\n\t\t}\n\n\t\tlet entry = this.trackEntry(trackIndex, animation, loop, last);\n\n\t\tif (!last) {\n\t\t\tthis.setCurrent(trackIndex, entry, true);\n\t\t\tthis.queue.drain();\n\t\t} else {\n\t\t\tlast.next = entry;\n\t\t\tentry.previous = last;\n\t\t\tif (delay <= 0) delay += last.getTrackComplete() - entry.mixDuration;\n\t\t}\n\n\t\tentry.delay = delay;\n\t\treturn entry;\n\t}\n\n\t/** Sets an empty animation for a track, discarding any queued animations, and sets the track entry's\n\t * {@link TrackEntry#mixduration}. An empty animation has no timelines and serves as a placeholder for mixing in or out.\n\t *\n\t * Mixing out is done by setting an empty animation with a mix duration using either {@link #setEmptyAnimation()},\n\t * {@link #setEmptyAnimations()}, or {@link #addEmptyAnimation()}. Mixing to an empty animation causes\n\t * the previous animation to be applied less and less over the mix duration. Properties keyed in the previous animation\n\t * transition to the value from lower tracks or to the setup pose value if no lower tracks key the property. A mix duration of\n\t * 0 still mixes out over one frame.\n\t *\n\t * Mixing in is done by first setting an empty animation, then adding an animation using\n\t * {@link #addAnimation()} and on the returned track entry, set the\n\t * {@link TrackEntry#setMixDuration()}. Mixing from an empty animation causes the new animation to be applied more and\n\t * more over the mix duration. Properties keyed in the new animation transition from the value from lower tracks or from the\n\t * setup pose value if no lower tracks key the property to the value keyed in the new animation. */\n\tsetEmptyAnimation (trackIndex: number, mixDuration: number = 0) {\n\t\tlet entry = this.setAnimationWith(trackIndex, AnimationState.emptyAnimation(), false);\n\t\tentry.mixDuration = mixDuration;\n\t\tentry.trackEnd = mixDuration;\n\t\treturn entry;\n\t}\n\n\t/** Adds an empty animation to be played after the current or last queued animation for a track, and sets the track entry's\n\t * {@link TrackEntry#mixDuration}. If the track is empty, it is equivalent to calling\n\t * {@link #setEmptyAnimation()}.\n\t *\n\t * See {@link #setEmptyAnimation()}.\n\t * @param delay If > 0, sets {@link TrackEntry#delay}. If <= 0, the delay set is the duration of the previous track entry\n\t * minus any mix duration plus the specified `delay` (ie the mix ends at (`delay` = 0) or\n\t * before (`delay` < 0) the previous track entry duration). If the previous entry is looping, its next\n\t * loop completion is used instead of its duration.\n\t * @return A track entry to allow further customization of animation playback. References to the track entry must not be kept\n\t * after the {@link AnimationStateListener#dispose()} event occurs. */\n\taddEmptyAnimation (trackIndex: number, mixDuration: number = 0, delay: number = 0) {\n\t\tlet entry = this.addAnimationWith(trackIndex, AnimationState.emptyAnimation(), false, delay);\n\t\tif (delay <= 0) entry.delay += entry.mixDuration - mixDuration;\n\t\tentry.mixDuration = mixDuration;\n\t\tentry.trackEnd = mixDuration;\n\t\treturn entry;\n\t}\n\n\t/** Sets an empty animation for every track, discarding any queued animations, and mixes to it over the specified mix\n\t * duration. */\n\tsetEmptyAnimations (mixDuration: number = 0) {\n\t\tlet oldDrainDisabled = this.queue.drainDisabled;\n\t\tthis.queue.drainDisabled = true;\n\t\tfor (let i = 0, n = this.tracks.length; i < n; i++) {\n\t\t\tlet current = this.tracks[i];\n\t\t\tif (current) this.setEmptyAnimation(current.trackIndex, mixDuration);\n\t\t}\n\t\tthis.queue.drainDisabled = oldDrainDisabled;\n\t\tthis.queue.drain();\n\t}\n\n\texpandToIndex (index: number) {\n\t\tif (index < this.tracks.length) return this.tracks[index];\n\t\tUtils.ensureArrayCapacity(this.tracks, index + 1, null);\n\t\tthis.tracks.length = index + 1;\n\t\treturn null;\n\t}\n\n\t/** @param last May be null. */\n\ttrackEntry (trackIndex: number, animation: Animation, loop: boolean, last: TrackEntry | null) {\n\t\tlet entry = this.trackEntryPool.obtain();\n\t\tentry.reset();\n\t\tentry.trackIndex = trackIndex;\n\t\tentry.animation = animation;\n\t\tentry.loop = loop;\n\t\tentry.holdPrevious = false;\n\n\t\tentry.reverse = false;\n\t\tentry.shortestRotation = false;\n\n\t\tentry.eventThreshold = 0;\n\t\tentry.alphaAttachmentThreshold = 0;\n\t\tentry.mixAttachmentThreshold = 0;\n\t\tentry.mixDrawOrderThreshold = 0;\n\n\t\tentry.animationStart = 0;\n\t\tentry.animationEnd = animation.duration;\n\t\tentry.animationLast = -1;\n\t\tentry.nextAnimationLast = -1;\n\n\t\tentry.delay = 0;\n\t\tentry.trackTime = 0;\n\t\tentry.trackLast = -1;\n\t\tentry.nextTrackLast = -1;\n\t\tentry.trackEnd = Number.MAX_VALUE;\n\t\tentry.timeScale = 1;\n\n\t\tentry.alpha = 1;\n\t\tentry.mixTime = 0;\n\t\tentry.mixDuration = !last ? 0 : this.data.getMix(last.animation!, animation);\n\t\tentry.interruptAlpha = 1;\n\t\tentry.totalAlpha = 0;\n\t\tentry.mixBlend = MixBlend.replace;\n\t\treturn entry;\n\t}\n\n\t/** Removes the {@link TrackEntry#getNext() next entry} and all entries after it for the specified entry. */\n\tclearNext (entry: TrackEntry) {\n\t\tlet next = entry.next;\n\t\twhile (next) {\n\t\t\tthis.queue.dispose(next);\n\t\t\tnext = next.next;\n\t\t}\n\t\tentry.next = null;\n\t}\n\n\t_animationsChanged () {\n\t\tthis.animationsChanged = false;\n\n\t\tthis.propertyIDs.clear();\n\t\tlet tracks = this.tracks;\n\t\tfor (let i = 0, n = tracks.length; i < n; i++) {\n\t\t\tlet entry = tracks[i];\n\t\t\tif (!entry) continue;\n\t\t\twhile (entry.mixingFrom)\n\t\t\t\tentry = entry.mixingFrom;\n\t\t\tdo {\n\t\t\t\tif (!entry.mixingTo || entry.mixBlend != MixBlend.add) this.computeHold(entry);\n\t\t\t\tentry = entry.mixingTo;\n\t\t\t} while (entry);\n\t\t}\n\t}\n\n\tcomputeHold (entry: TrackEntry) {\n\t\tlet to = entry.mixingTo;\n\t\tlet timelines = entry.animation!.timelines;\n\t\tlet timelinesCount = entry.animation!.timelines.length;\n\t\tlet timelineMode = entry.timelineMode;\n\t\ttimelineMode.length = timelinesCount;\n\t\tlet timelineHoldMix = entry.timelineHoldMix;\n\t\ttimelineHoldMix.length = 0;\n\t\tlet propertyIDs = this.propertyIDs;\n\n\t\tif (to && to.holdPrevious) {\n\t\t\tfor (let i = 0; i < timelinesCount; i++)\n\t\t\t\ttimelineMode[i] = propertyIDs.addAll(timelines[i].getPropertyIds()) ? HOLD_FIRST : HOLD_SUBSEQUENT;\n\t\t\treturn;\n\t\t}\n\n\t\touter:\n\t\tfor (let i = 0; i < timelinesCount; i++) {\n\t\t\tlet timeline = timelines[i];\n\t\t\tlet ids = timeline.getPropertyIds();\n\t\t\tif (!propertyIDs.addAll(ids))\n\t\t\t\ttimelineMode[i] = SUBSEQUENT;\n\t\t\telse if (!to || timeline instanceof AttachmentTimeline || timeline instanceof DrawOrderTimeline\n\t\t\t\t|| timeline instanceof EventTimeline || !to.animation!.hasTimeline(ids)) {\n\t\t\t\ttimelineMode[i] = FIRST;\n\t\t\t} else {\n\t\t\t\tfor (let next = to.mixingTo; next; next = next!.mixingTo) {\n\t\t\t\t\tif (next.animation!.hasTimeline(ids)) continue;\n\t\t\t\t\tif (entry.mixDuration > 0) {\n\t\t\t\t\t\ttimelineMode[i] = HOLD_MIX;\n\t\t\t\t\t\ttimelineHoldMix[i] = next;\n\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\ttimelineMode[i] = HOLD_FIRST;\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */\n\tgetCurrent (trackIndex: number) {\n\t\tif (trackIndex >= this.tracks.length) return null;\n\t\treturn this.tracks[trackIndex];\n\t}\n\n\t/** Adds a listener to receive events for all track entries. */\n\taddListener (listener: AnimationStateListener) {\n\t\tif (!listener) throw new Error(\"listener cannot be null.\");\n\t\tthis.listeners.push(listener);\n\t}\n\n\t/** Removes the listener added with {@link #addListener()}. */\n\tremoveListener (listener: AnimationStateListener) {\n\t\tlet index = this.listeners.indexOf(listener);\n\t\tif (index >= 0) this.listeners.splice(index, 1);\n\t}\n\n\t/** Removes all listeners added with {@link #addListener()}. */\n\tclearListeners () {\n\t\tthis.listeners.length = 0;\n\t}\n\n\t/** Discards all listener notifications that have not yet been delivered. This can be useful to call from an\n\t * {@link AnimationStateListener} when it is known that further notifications that may have been already queued for delivery\n\t * are not wanted because new animations are being set. */\n\tclearListenerNotifications () {\n\t\tthis.queue.clear();\n\t}\n}\n\n/** Stores settings and other state for the playback of an animation on an {@link AnimationState} track.\n *\n * References to a track entry must not be kept after the {@link AnimationStateListener#dispose()} event occurs. */\nexport class TrackEntry {\n\t/** The animation to apply for this track entry. */\n\tanimation: Animation | null = null;\n\n\tprevious: TrackEntry | null = null;\n\n\t/** The animation queued to start after this animation, or null. `next` makes up a linked list. */\n\tnext: TrackEntry | null = null;\n\n\t/** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no\n\t * mixing is currently occuring. When mixing from multiple animations, `mixingFrom` makes up a linked list. */\n\tmixingFrom: TrackEntry | null = null;\n\n\t/** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is\n\t * currently occuring. When mixing to multiple animations, `mixingTo` makes up a linked list. */\n\tmixingTo: TrackEntry | null = null;\n\n\t/** The listener for events generated by this track entry, or null.\n\t *\n\t * A track entry returned from {@link AnimationState#setAnimation()} is already the current animation\n\t * for the track, so the track entry listener {@link AnimationStateListener#start()} will not be called. */\n\tlistener: AnimationStateListener | null = null;\n\n\t/** The index of the track where this track entry is either current or queued.\n\t *\n\t * See {@link AnimationState#getCurrent()}. */\n\ttrackIndex: number = 0;\n\n\t/** If true, the animation will repeat. If false it will not, instead its last frame is applied if played beyond its\n\t * duration. */\n\tloop: boolean = false;\n\n\t/** If true, when mixing from the previous animation to this animation, the previous animation is applied as normal instead\n\t * of being mixed out.\n\t *\n\t * When mixing between animations that key the same property, if a lower track also keys that property then the value will\n\t * briefly dip toward the lower track value during the mix. This happens because the first animation mixes from 100% to 0%\n\t * while the second animation mixes from 0% to 100%. Setting `holdPrevious` to true applies the first animation\n\t * at 100% during the mix so the lower track value is overwritten. Such dipping does not occur on the lowest track which\n\t * keys the property, only when a higher track also keys the property.\n\t *\n\t * Snapping will occur if `holdPrevious` is true and this animation does not key all the same properties as the\n\t * previous animation. */\n\tholdPrevious: boolean = false;\n\n\treverse: boolean = false;\n\n\tshortestRotation: boolean = false;\n\n\t/** When the mix percentage ({@link #mixTime} / {@link #mixDuration}) is less than the\n\t * `eventThreshold`, event timelines are applied while this animation is being mixed out. Defaults to 0, so event\n\t * timelines are not applied while this animation is being mixed out. */\n\teventThreshold: number = 0;\n\n\t/** When the mix percentage ({@link #mixtime} / {@link #mixDuration}) is less than the\n\t * `attachmentThreshold`, attachment timelines are applied while this animation is being mixed out. Defaults to\n\t * 0, so attachment timelines are not applied while this animation is being mixed out. */\n\tmixAttachmentThreshold: number = 0;\n\n\t/** When {@link #getAlpha()} is greater than alphaAttachmentThreshold, attachment timelines are applied.\n\t * Defaults to 0, so attachment timelines are always applied. */\n\talphaAttachmentThreshold: number = 0;\n\n\t/** When the mix percentage ({@link #getMixTime()} / {@link #getMixDuration()}) is less than the\n\t * mixDrawOrderThreshold, draw order timelines are applied while this animation is being mixed out. Defaults to\n\t * 0, so draw order timelines are not applied while this animation is being mixed out. */\n\tmixDrawOrderThreshold: number = 0;\n\n\t/** Seconds when this animation starts, both initially and after looping. Defaults to 0.\n\t *\n\t * When changing the `animationStart` time, it often makes sense to set {@link #animationLast} to the same\n\t * value to prevent timeline keys before the start time from triggering. */\n\tanimationStart: number = 0;\n\n\t/** Seconds for the last frame of this animation. Non-looping animations won't play past this time. Looping animations will\n\t * loop back to {@link #animationStart} at this time. Defaults to the animation {@link Animation#duration}. */\n\tanimationEnd: number = 0;\n\n\n\t/** The time in seconds this animation was last applied. Some timelines use this for one-time triggers. Eg, when this\n\t * animation is applied, event timelines will fire all events between the `animationLast` time (exclusive) and\n\t * `animationTime` (inclusive). Defaults to -1 to ensure triggers on frame 0 happen the first time this animation\n\t * is applied. */\n\tanimationLast: number = 0;\n\n\tnextAnimationLast: number = 0;\n\n\t/** Seconds to postpone playing the animation. When this track entry is the current track entry, `delay`\n\t * postpones incrementing the {@link #trackTime}. When this track entry is queued, `delay` is the time from\n\t * the start of the previous animation to when this track entry will become the current track entry (ie when the previous\n\t * track entry {@link TrackEntry#trackTime} >= this track entry's `delay`).\n\t *\n\t * {@link #timeScale} affects the delay. */\n\tdelay: number = 0;\n\n\t/** Current time in seconds this track entry has been the current track entry. The track time determines\n\t * {@link #animationTime}. The track time can be set to start the animation at a time other than 0, without affecting\n\t * looping. */\n\ttrackTime: number = 0;\n\n\ttrackLast: number = 0; nextTrackLast: number = 0;\n\n\t/** The track time in seconds when this animation will be removed from the track. Defaults to the highest possible float\n\t * value, meaning the animation will be applied until a new animation is set or the track is cleared. If the track end time\n\t * is reached, no other animations are queued for playback, and mixing from any previous animations is complete, then the\n\t * properties keyed by the animation are set to the setup pose and the track is cleared.\n\t *\n\t * It may be desired to use {@link AnimationState#addEmptyAnimation()} rather than have the animation\n\t * abruptly cease being applied. */\n\ttrackEnd: number = 0;\n\n\t/** Multiplier for the delta time when this track entry is updated, causing time for this animation to pass slower or\n\t * faster. Defaults to 1.\n\t *\n\t * {@link #mixTime} is not affected by track entry time scale, so {@link #mixDuration} may need to be adjusted to\n\t * match the animation speed.\n\t *\n\t * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\n\t * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, assuming time scale to be 1. If\n\t * the time scale is not 1, the delay may need to be adjusted.\n\t *\n\t * See AnimationState {@link AnimationState#timeScale} for affecting all animations. */\n\ttimeScale: number = 0;\n\n\t/** Values < 1 mix this animation with the skeleton's current pose (usually the pose resulting from lower tracks). Defaults\n\t * to 1, which overwrites the skeleton's current pose with this animation.\n\t *\n\t * Typically track 0 is used to completely pose the skeleton, then alpha is used on higher tracks. It doesn't make sense to\n\t * use alpha on track 0 if the skeleton pose is from the last frame render. */\n\talpha: number = 0;\n\n\t/** Seconds from 0 to the {@link #getMixDuration()} when mixing from the previous animation to this animation. May be\n\t * slightly more than `mixDuration` when the mix is complete. */\n\tmixTime: number = 0;\n\n\t/** Seconds for mixing from the previous animation to this animation. Defaults to the value provided by AnimationStateData\n\t * {@link AnimationStateData#getMix()} based on the animation before this animation (if any).\n\t *\n\t * A mix duration of 0 still mixes out over one frame to provide the track entry being mixed out a chance to revert the\n\t * properties it was animating.\n\t *\n\t * The `mixDuration` can be set manually rather than use the value from\n\t * {@link AnimationStateData#getMix()}. In that case, the `mixDuration` can be set for a new\n\t * track entry only before {@link AnimationState#update(float)} is first called.\n\t *\n\t * When using {@link AnimationState#addAnimation()} with a `delay` <= 0, note the\n\t * {@link #delay} is set using the mix duration from the {@link AnimationStateData}, not a mix duration set\n\t * afterward. */\n\t_mixDuration: number = 0; interruptAlpha: number = 0; totalAlpha: number = 0;\n\n\tget mixDuration () {\n\t\treturn this._mixDuration;\n\t}\n\n\tset mixDuration (mixDuration: number) {\n\t\tthis._mixDuration = mixDuration;\n\t}\n\n\tsetMixDurationWithDelay (mixDuration: number, delay: number) {\n\t\tthis._mixDuration = mixDuration;\n\t\tif (this.previous != null && delay <= 0) delay += this.previous.getTrackComplete() - mixDuration;\n\t\tthis.delay = delay;\n\t}\n\n\t/** Controls how properties keyed in the animation are mixed with lower tracks. Defaults to {@link MixBlend#replace}, which\n\t * replaces the values from the lower tracks with the animation values. {@link MixBlend#add} adds the animation values to\n\t * the values from the lower tracks.\n\t *\n\t * The `mixBlend` can be set for a new track entry only before {@link AnimationState#apply()} is first\n\t * called. */\n\tmixBlend = MixBlend.replace;\n\ttimelineMode = new Array();\n\ttimelineHoldMix = new Array();\n\ttimelinesRotation = new Array();\n\n\treset () {\n\t\tthis.next = null;\n\t\tthis.previous = null;\n\t\tthis.mixingFrom = null;\n\t\tthis.mixingTo = null;\n\t\tthis.animation = null;\n\t\tthis.listener = null;\n\t\tthis.timelineMode.length = 0;\n\t\tthis.timelineHoldMix.length = 0;\n\t\tthis.timelinesRotation.length = 0;\n\t}\n\n\t/** Uses {@link #trackTime} to compute the `animationTime`, which is between {@link #animationStart}\n\t * and {@link #animationEnd}. When the `trackTime` is 0, the `animationTime` is equal to the\n\t * `animationStart` time. */\n\tgetAnimationTime () {\n\t\tif (this.loop) {\n\t\t\tlet duration = this.animationEnd - this.animationStart;\n\t\t\tif (duration == 0) return this.animationStart;\n\t\t\treturn (this.trackTime % duration) + this.animationStart;\n\t\t}\n\t\treturn Math.min(this.trackTime + this.animationStart, this.animationEnd);\n\t}\n\n\tsetAnimationLast (animationLast: number) {\n\t\tthis.animationLast = animationLast;\n\t\tthis.nextAnimationLast = animationLast;\n\t}\n\n\t/** Returns true if at least one loop has been completed.\n\t *\n\t * See {@link AnimationStateListener#complete()}. */\n\tisComplete () {\n\t\treturn this.trackTime >= this.animationEnd - this.animationStart;\n\t}\n\n\t/** Resets the rotation directions for mixing this entry's rotate timelines. This can be useful to avoid bones rotating the\n\t * long way around when using {@link #alpha} and starting animations on other tracks.\n\t *\n\t * Mixing with {@link MixBlend#replace} involves finding a rotation between two others, which has two possible solutions:\n\t * the short way or the long way around. The two rotations likely change over time, so which direction is the short or long\n\t * way also changes. If the short way was always chosen, bones would flip to the other side when that direction became the\n\t * long way. TrackEntry chooses the short way the first time it is applied and remembers that direction. */\n\tresetRotationDirections () {\n\t\tthis.timelinesRotation.length = 0;\n\t}\n\n\tgetTrackComplete () {\n\t\tlet duration = this.animationEnd - this.animationStart;\n\t\tif (duration != 0) {\n\t\t\tif (this.loop) return duration * (1 + ((this.trackTime / duration) | 0)); // Completion of next loop.\n\t\t\tif (this.trackTime < duration) return duration; // Before duration.\n\t\t}\n\t\treturn this.trackTime; // Next update.\n\t}\n\n\t/** Returns true if this track entry has been applied at least once.\n\t *

\n\t * See {@link AnimationState#apply(Skeleton)}. */\n\twasApplied () {\n\t\treturn this.nextTrackLast != -1;\n\t}\n\n\t/** Returns true if there is a {@link #getNext()} track entry and it will become the current track entry during the next\n\t * {@link AnimationState#update(float)}. */\n\tisNextReady () {\n\t\treturn this.next != null && this.nextTrackLast - this.next.delay >= 0;\n\t}\n}\n\nexport class EventQueue {\n\tobjects: Array = [];\n\tdrainDisabled = false;\n\tanimState: AnimationState;\n\n\tconstructor (animState: AnimationState) {\n\t\tthis.animState = animState;\n\t}\n\n\tstart (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.start);\n\t\tthis.objects.push(entry);\n\t\tthis.animState.animationsChanged = true;\n\t}\n\n\tinterrupt (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.interrupt);\n\t\tthis.objects.push(entry);\n\t}\n\n\tend (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.end);\n\t\tthis.objects.push(entry);\n\t\tthis.animState.animationsChanged = true;\n\t}\n\n\tdispose (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.dispose);\n\t\tthis.objects.push(entry);\n\t}\n\n\tcomplete (entry: TrackEntry) {\n\t\tthis.objects.push(EventType.complete);\n\t\tthis.objects.push(entry);\n\t}\n\n\tevent (entry: TrackEntry, event: Event) {\n\t\tthis.objects.push(EventType.event);\n\t\tthis.objects.push(entry);\n\t\tthis.objects.push(event);\n\t}\n\n\tdrain () {\n\t\tif (this.drainDisabled) return;\n\t\tthis.drainDisabled = true;\n\n\t\tlet objects = this.objects;\n\t\tlet listeners = this.animState.listeners;\n\n\t\tfor (let i = 0; i < objects.length; i += 2) {\n\t\t\tlet type = objects[i] as EventType;\n\t\t\tlet entry = objects[i + 1] as TrackEntry;\n\t\t\tswitch (type) {\n\t\t\t\tcase EventType.start:\n\t\t\t\t\tif (entry.listener && entry.listener.start) entry.listener.start(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.start) listener.start(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.interrupt:\n\t\t\t\t\tif (entry.listener && entry.listener.interrupt) entry.listener.interrupt(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.interrupt) listener.interrupt(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.end:\n\t\t\t\t\tif (entry.listener && entry.listener.end) entry.listener.end(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.end) listener.end(entry);\n\t\t\t\t\t}\n\t\t\t\t// Fall through.\n\t\t\t\tcase EventType.dispose:\n\t\t\t\t\tif (entry.listener && entry.listener.dispose) entry.listener.dispose(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.dispose) listener.dispose(entry);\n\t\t\t\t\t}\n\t\t\t\t\tthis.animState.trackEntryPool.free(entry);\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.complete:\n\t\t\t\t\tif (entry.listener && entry.listener.complete) entry.listener.complete(entry);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.complete) listener.complete(entry);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase EventType.event:\n\t\t\t\t\tlet event = objects[i++ + 2] as Event;\n\t\t\t\t\tif (entry.listener && entry.listener.event) entry.listener.event(entry, event);\n\t\t\t\t\tfor (let ii = 0; ii < listeners.length; ii++) {\n\t\t\t\t\t\tlet listener = listeners[ii];\n\t\t\t\t\t\tif (listener.event) listener.event(entry, event);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.clear();\n\n\t\tthis.drainDisabled = false;\n\t}\n\n\tclear () {\n\t\tthis.objects.length = 0;\n\t}\n}\n\nexport enum EventType {\n\tstart, interrupt, end, dispose, complete, event\n}\n\n/** The interface to implement for receiving TrackEntry events. It is always safe to call AnimationState methods when receiving\n * events.\n *\n * See TrackEntry {@link TrackEntry#listener} and AnimationState\n * {@link AnimationState#addListener()}. */\nexport interface AnimationStateListener {\n\t/** Invoked when this entry has been set as the current entry. */\n\tstart?: (entry: TrackEntry) => void;\n\n\t/** Invoked when another entry has replaced this entry as the current entry. This entry may continue being applied for\n\t * mixing. */\n\tinterrupt?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry is no longer the current entry and will never be applied again. */\n\tend?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry will be disposed. This may occur without the entry ever being set as the current entry.\n\t * References to the entry should not be kept after dispose is called, as it may be destroyed or reused. */\n\tdispose?: (entry: TrackEntry) => void;\n\n\t/** Invoked every time this entry's animation completes a loop. */\n\tcomplete?: (entry: TrackEntry) => void;\n\n\t/** Invoked when this entry's animation triggers an event. */\n\tevent?: (entry: TrackEntry, event: Event) => void;\n}\n\nexport abstract class AnimationStateAdapter implements AnimationStateListener {\n\tstart (entry: TrackEntry) {\n\t}\n\n\tinterrupt (entry: TrackEntry) {\n\t}\n\n\tend (entry: TrackEntry) {\n\t}\n\n\tdispose (entry: TrackEntry) {\n\t}\n\n\tcomplete (entry: TrackEntry) {\n\t}\n\n\tevent (entry: TrackEntry, event: Event) {\n\t}\n}\n\n/** 1. A previously applied timeline has set this property.\n *\n * Result: Mix from the current pose to the timeline pose. */\nexport const SUBSEQUENT = 0;\n/** 1. This is the first timeline to set this property.\n * 2. The next track entry applied after this one does not have a timeline to set this property.\n *\n * Result: Mix from the setup pose to the timeline pose. */\nexport const FIRST = 1;\n/** 1) A previously applied timeline has set this property.
\n * 2) The next track entry to be applied does have a timeline to set this property.
\n * 3) The next track entry after that one does not have a timeline to set this property.
\n * Result: Mix from the current pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading\n * animations that key the same property. A subsequent timeline will set this property using a mix. */\nexport const HOLD_SUBSEQUENT = 2;\n/** 1) This is the first timeline to set this property.
\n * 2) The next track entry to be applied does have a timeline to set this property.
\n * 3) The next track entry after that one does not have a timeline to set this property.
\n * Result: Mix from the setup pose to the timeline pose, but do not mix out. This avoids \"dipping\" when crossfading animations\n * that key the same property. A subsequent timeline will set this property using a mix. */\nexport const HOLD_FIRST = 3;\n/** 1. This is the first timeline to set this property.\n * 2. The next track entry to be applied does have a timeline to set this property.\n * 3. The next track entry after that one does have a timeline to set this property.\n * 4. timelineHoldMix stores the first subsequent track entry that does not have a timeline to set this property.\n *\n * Result: The same as HOLD except the mix percentage from the timelineHoldMix track entry is used. This handles when more than\n * 2 track entries in a row have a timeline that sets the same property.\n *\n * Eg, A -> B -> C -> D where A, B, and C have a timeline setting same property, but D does not. When A is applied, to avoid\n * \"dipping\" A is not mixed out, however D (the first entry that doesn't set the property) mixing in is used to mix out A\n * (which affects B and C). Without using D to mix out, A would be applied fully until mixing completes, then snap into\n * place. */\nexport const HOLD_MIX = 4;\n\nexport const SETUP = 1;\nexport const CURRENT = 2;\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation } from \"./Animation.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { StringMap } from \"./Utils.js\";\n\n\n/** Stores mix (crossfade) durations to be applied when {@link AnimationState} animations are changed. */\nexport class AnimationStateData {\n\t/** The SkeletonData to look up animations when they are specified by name. */\n\tskeletonData: SkeletonData;\n\n\tanimationToMixTime: StringMap = {};\n\n\t/** The mix duration to use when no mix duration has been defined between two animations. */\n\tdefaultMix = 0;\n\n\tconstructor (skeletonData: SkeletonData) {\n\t\tif (!skeletonData) throw new Error(\"skeletonData cannot be null.\");\n\t\tthis.skeletonData = skeletonData;\n\t}\n\n\t/** Sets a mix duration by animation name.\n\t *\n\t * See {@link #setMixWith()}. */\n\tsetMix (fromName: string, toName: string, duration: number) {\n\t\tlet from = this.skeletonData.findAnimation(fromName);\n\t\tif (!from) throw new Error(\"Animation not found: \" + fromName);\n\t\tlet to = this.skeletonData.findAnimation(toName);\n\t\tif (!to) throw new Error(\"Animation not found: \" + toName);\n\t\tthis.setMixWith(from, to, duration);\n\t}\n\n\t/** Sets the mix duration when changing from the specified animation to the other.\n\t *\n\t * See {@link TrackEntry#mixDuration}. */\n\tsetMixWith (from: Animation, to: Animation, duration: number) {\n\t\tif (!from) throw new Error(\"from cannot be null.\");\n\t\tif (!to) throw new Error(\"to cannot be null.\");\n\t\tlet key = from.name + \".\" + to.name;\n\t\tthis.animationToMixTime[key] = duration;\n\t}\n\n\t/** Returns the mix duration to use when changing from the specified animation to the other, or the {@link #defaultMix} if\n\t * no mix duration has been set. */\n\tgetMix (from: Animation, to: Animation) {\n\t\tlet key = from.name + \".\" + to.name;\n\t\tlet value = this.animationToMixTime[key];\n\t\treturn value === undefined ? this.defaultMix : value;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment with vertices that make up a polygon. Can be used for hit detection, creating physics bodies, spawning particle\n * effects, and more.\n *\n * See {@link SkeletonBounds} and [Bounding Boxes](http://esotericsoftware.com/spine-bounding-boxes) in the Spine User\n * Guide. */\nexport class BoundingBoxAttachment extends VertexAttachment {\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new BoundingBoxAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { SlotData } from \"../SlotData.js\";\nimport { Color } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment with vertices that make up a polygon used for clipping the rendering of other attachments. */\nexport class ClippingAttachment extends VertexAttachment {\n\t/** Clipping is performed between the clipping polygon's slot and the end slot. Returns null if clipping is done until the end of\n\t * the skeleton's rendering. */\n\tendSlot: SlotData | null = null;\n\n\t// Nonessential.\n\t/** The color of the clipping polygon as it was in Spine. Available only when nonessential data was exported. Clipping polygons\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.2275, 0.2275, 0.8078, 1); // ce3a3aff\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new ClippingAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.endSlot = this.endSlot;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport abstract class Texture {\n\tprotected _image: HTMLImageElement | ImageBitmap | any;\n\n\tconstructor (image: HTMLImageElement | ImageBitmap | any) {\n\t\tthis._image = image;\n\t}\n\n\tgetImage (): HTMLImageElement | ImageBitmap | any {\n\t\treturn this._image;\n\t}\n\n\tabstract setFilters (minFilter: TextureFilter, magFilter: TextureFilter): void;\n\tabstract setWraps (uWrap: TextureWrap, vWrap: TextureWrap): void;\n\tabstract dispose (): void;\n}\n\nexport enum TextureFilter {\n\tNearest = 9728, // WebGLRenderingContext.NEAREST\n\tLinear = 9729, // WebGLRenderingContext.LINEAR\n\tMipMap = 9987, // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\n\tMipMapNearestNearest = 9984, // WebGLRenderingContext.NEAREST_MIPMAP_NEAREST\n\tMipMapLinearNearest = 9985, // WebGLRenderingContext.LINEAR_MIPMAP_NEAREST\n\tMipMapNearestLinear = 9986, // WebGLRenderingContext.NEAREST_MIPMAP_LINEAR\n\tMipMapLinearLinear = 9987 // WebGLRenderingContext.LINEAR_MIPMAP_LINEAR\n}\n\nexport enum TextureWrap {\n\tMirroredRepeat = 33648, // WebGLRenderingContext.MIRRORED_REPEAT\n\tClampToEdge = 33071, // WebGLRenderingContext.CLAMP_TO_EDGE\n\tRepeat = 10497 // WebGLRenderingContext.REPEAT\n}\n\nexport class TextureRegion {\n\ttexture: any;\n\tu = 0; v = 0;\n\tu2 = 0; v2 = 0;\n\twidth = 0; height = 0;\n\tdegrees = 0;\n\toffsetX = 0; offsetY = 0;\n\toriginalWidth = 0; originalHeight = 0;\n}\n\nexport class FakeTexture extends Texture {\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) { }\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) { }\n\tdispose () { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AssetManagerBase } from \"./AssetManagerBase.js\";\nimport { TextureFilter, TextureWrap, Texture, TextureRegion } from \"./Texture.js\";\nimport { Disposable, Utils, StringMap } from \"./Utils.js\";\n\nexport class TextureAtlas implements Disposable {\n\tpages = new Array();\n\tregions = new Array();\n\n\tconstructor (atlasText: string) {\n\t\tlet reader = new TextureAtlasReader(atlasText);\n\t\tlet entry = new Array(4);\n\n\t\tlet pageFields: StringMap<(page: TextureAtlasPage) => void> = {};\n\t\tpageFields[\"size\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.width = parseInt(entry[1]);\n\t\t\tpage!.height = parseInt(entry[2]);\n\t\t};\n\t\tpageFields[\"format\"] = () => {\n\t\t\t// page.format = Format[tuple[0]]; we don't need format in WebGL\n\t\t};\n\t\tpageFields[\"filter\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.minFilter = Utils.enumValue(TextureFilter, entry[1]);\n\t\t\tpage!.magFilter = Utils.enumValue(TextureFilter, entry[2]);\n\t\t};\n\t\tpageFields[\"repeat\"] = (page: TextureAtlasPage) => {\n\t\t\tif (entry[1].indexOf('x') != -1) page!.uWrap = TextureWrap.Repeat;\n\t\t\tif (entry[1].indexOf('y') != -1) page!.vWrap = TextureWrap.Repeat;\n\t\t};\n\t\tpageFields[\"pma\"] = (page: TextureAtlasPage) => {\n\t\t\tpage!.pma = entry[1] == \"true\";\n\t\t};\n\n\t\tvar regionFields: StringMap<(region: TextureAtlasRegion) => void> = {};\n\t\tregionFields[\"xy\"] = (region: TextureAtlasRegion) => { // Deprecated, use bounds.\n\t\t\tregion.x = parseInt(entry[1]);\n\t\t\tregion.y = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"size\"] = (region: TextureAtlasRegion) => { // Deprecated, use bounds.\n\t\t\tregion.width = parseInt(entry[1]);\n\t\t\tregion.height = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"bounds\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.x = parseInt(entry[1]);\n\t\t\tregion.y = parseInt(entry[2]);\n\t\t\tregion.width = parseInt(entry[3]);\n\t\t\tregion.height = parseInt(entry[4]);\n\t\t};\n\t\tregionFields[\"offset\"] = (region: TextureAtlasRegion) => { // Deprecated, use offsets.\n\t\t\tregion.offsetX = parseInt(entry[1]);\n\t\t\tregion.offsetY = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"orig\"] = (region: TextureAtlasRegion) => { // Deprecated, use offsets.\n\t\t\tregion.originalWidth = parseInt(entry[1]);\n\t\t\tregion.originalHeight = parseInt(entry[2]);\n\t\t};\n\t\tregionFields[\"offsets\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.offsetX = parseInt(entry[1]);\n\t\t\tregion.offsetY = parseInt(entry[2]);\n\t\t\tregion.originalWidth = parseInt(entry[3]);\n\t\t\tregion.originalHeight = parseInt(entry[4]);\n\t\t};\n\t\tregionFields[\"rotate\"] = (region: TextureAtlasRegion) => {\n\t\t\tlet value = entry[1];\n\t\t\tif (value == \"true\")\n\t\t\t\tregion.degrees = 90;\n\t\t\telse if (value != \"false\")\n\t\t\t\tregion.degrees = parseInt(value);\n\t\t};\n\t\tregionFields[\"index\"] = (region: TextureAtlasRegion) => {\n\t\t\tregion.index = parseInt(entry[1]);\n\t\t};\n\n\t\tlet line = reader.readLine();\n\t\t// Ignore empty lines before first entry.\n\t\twhile (line && line.trim().length == 0)\n\t\t\tline = reader.readLine();\n\t\t// Header entries.\n\t\twhile (true) {\n\t\t\tif (!line || line.trim().length == 0) break;\n\t\t\tif (reader.readEntry(entry, line) == 0) break; // Silently ignore all header fields.\n\t\t\tline = reader.readLine();\n\t\t}\n\n\t\t// Page and region entries.\n\t\tlet page: TextureAtlasPage | null = null;\n\t\tlet names: string[] | null = null;\n\t\tlet values: number[][] | null = null;\n\t\twhile (true) {\n\t\t\tif (line === null) break;\n\t\t\tif (line.trim().length == 0) {\n\t\t\t\tpage = null;\n\t\t\t\tline = reader.readLine();\n\t\t\t} else if (!page) {\n\t\t\t\tpage = new TextureAtlasPage(line.trim());\n\t\t\t\twhile (true) {\n\t\t\t\t\tif (reader.readEntry(entry, line = reader.readLine()) == 0) break;\n\t\t\t\t\tlet field = pageFields[entry[0]];\n\t\t\t\t\tif (field) field(page);\n\t\t\t\t}\n\t\t\t\tthis.pages.push(page);\n\t\t\t} else {\n\t\t\t\tlet region = new TextureAtlasRegion(page, line);\n\n\t\t\t\twhile (true) {\n\t\t\t\t\tlet count = reader.readEntry(entry, line = reader.readLine());\n\t\t\t\t\tif (count == 0) break;\n\t\t\t\t\tlet field = regionFields[entry[0]];\n\t\t\t\t\tif (field)\n\t\t\t\t\t\tfield(region);\n\t\t\t\t\telse {\n\t\t\t\t\t\tif (!names) names = [];\n\t\t\t\t\t\tif (!values) values = [];\n\t\t\t\t\t\tnames.push(entry[0]);\n\t\t\t\t\t\tlet entryValues: number[] = [];\n\t\t\t\t\t\tfor (let i = 0; i < count; i++)\n\t\t\t\t\t\t\tentryValues.push(parseInt(entry[i + 1]));\n\t\t\t\t\t\tvalues.push(entryValues);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (region.originalWidth == 0 && region.originalHeight == 0) {\n\t\t\t\t\tregion.originalWidth = region.width;\n\t\t\t\t\tregion.originalHeight = region.height;\n\t\t\t\t}\n\t\t\t\tif (names && names.length > 0 && values && values.length > 0) {\n\t\t\t\t\tregion.names = names;\n\t\t\t\t\tregion.values = values;\n\t\t\t\t\tnames = null;\n\t\t\t\t\tvalues = null;\n\t\t\t\t}\n\t\t\t\tregion.u = region.x / page.width;\n\t\t\t\tregion.v = region.y / page.height;\n\t\t\t\tif (region.degrees == 90) {\n\t\t\t\t\tregion.u2 = (region.x + region.height) / page.width;\n\t\t\t\t\tregion.v2 = (region.y + region.width) / page.height;\n\t\t\t\t} else {\n\t\t\t\t\tregion.u2 = (region.x + region.width) / page.width;\n\t\t\t\t\tregion.v2 = (region.y + region.height) / page.height;\n\t\t\t\t}\n\t\t\t\tthis.regions.push(region);\n\t\t\t}\n\t\t}\n\t}\n\n\tfindRegion (name: string): TextureAtlasRegion | null {\n\t\tfor (let i = 0; i < this.regions.length; i++) {\n\t\t\tif (this.regions[i].name == name) {\n\t\t\t\treturn this.regions[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tsetTextures (assetManager: AssetManagerBase, pathPrefix: string = \"\") {\n\t\tfor (let page of this.pages)\n\t\t\tpage.setTexture(assetManager.get(pathPrefix + page.name));\n\t}\n\n\tdispose () {\n\t\tfor (let i = 0; i < this.pages.length; i++) {\n\t\t\tthis.pages[i].texture?.dispose();\n\t\t}\n\t}\n}\n\nclass TextureAtlasReader {\n\tlines: Array;\n\tindex: number = 0;\n\n\tconstructor (text: string) {\n\t\tthis.lines = text.split(/\\r\\n|\\r|\\n/);\n\t}\n\n\treadLine (): string | null {\n\t\tif (this.index >= this.lines.length)\n\t\t\treturn null;\n\t\treturn this.lines[this.index++];\n\t}\n\n\treadEntry (entry: string[], line: string | null): number {\n\t\tif (!line) return 0;\n\t\tline = line.trim();\n\t\tif (line.length == 0) return 0;\n\n\t\tlet colon = line.indexOf(':');\n\t\tif (colon == -1) return 0;\n\t\tentry[0] = line.substr(0, colon).trim();\n\t\tfor (let i = 1, lastMatch = colon + 1; ; i++) {\n\t\t\tlet comma = line.indexOf(',', lastMatch);\n\t\t\tif (comma == -1) {\n\t\t\t\tentry[i] = line.substr(lastMatch).trim();\n\t\t\t\treturn i;\n\t\t\t}\n\t\t\tentry[i] = line.substr(lastMatch, comma - lastMatch).trim();\n\t\t\tlastMatch = comma + 1;\n\t\t\tif (i == 4) return 4;\n\t\t}\n\t}\n}\n\nexport class TextureAtlasPage {\n\tname: string;\n\tminFilter: TextureFilter = TextureFilter.Nearest;\n\tmagFilter: TextureFilter = TextureFilter.Nearest;\n\tuWrap: TextureWrap = TextureWrap.ClampToEdge;\n\tvWrap: TextureWrap = TextureWrap.ClampToEdge;\n\ttexture: Texture | null = null;\n\twidth: number = 0;\n\theight: number = 0;\n\tpma: boolean = false;\n\tregions = new Array();\n\n\tconstructor (name: string) {\n\t\tthis.name = name;\n\t}\n\n\tsetTexture (texture: Texture) {\n\t\tthis.texture = texture;\n\t\ttexture.setFilters(this.minFilter, this.magFilter);\n\t\ttexture.setWraps(this.uWrap, this.vWrap);\n\t\tfor (let region of this.regions)\n\t\t\tregion.texture = texture;\n\t}\n}\n\nexport class TextureAtlasRegion extends TextureRegion {\n\tpage: TextureAtlasPage;\n\tname: string;\n\tx: number = 0;\n\ty: number = 0;\n\toffsetX: number = 0;\n\toffsetY: number = 0;\n\toriginalWidth: number = 0;\n\toriginalHeight: number = 0;\n\tindex: number = 0;\n\tdegrees: number = 0;\n\tnames: string[] | null = null;\n\tvalues: number[][] | null = null;\n\n\tconstructor (page: TextureAtlasPage, name: string) {\n\t\tsuper();\n\t\tthis.page = page;\n\t\tthis.name = name;\n\t\tpage.regions.push(this);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TextureRegion } from \"../Texture.js\";\nimport { TextureAtlasRegion } from \"../TextureAtlas.js\";\nimport { Color, NumberArrayLike, Utils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Sequence } from \"./Sequence.js\";\nimport { Slot } from \"../Slot.js\";\n\n/** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not\n * supported. Each vertex has UVs (texture coordinates) and triangles are used to map an image on to the mesh.\n *\n * See [Mesh attachments](http://esotericsoftware.com/spine-meshes) in the Spine User Guide. */\nexport class MeshAttachment extends VertexAttachment implements HasTextureRegion {\n\tregion: TextureRegion | null = null;\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\t/** The UV pair for each vertex, normalized within the texture region. */\n\tregionUVs: NumberArrayLike = [];\n\n\t/** The UV pair for each vertex, normalized within the entire texture.\n\t *\n\t * See {@link #updateUVs}. */\n\tuvs: NumberArrayLike = [];\n\n\t/** Triplets of vertex indices which describe the mesh's triangulation. */\n\ttriangles: Array = [];\n\n\t/** The color to tint the mesh. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The width of the mesh's image. Available only when nonessential data was exported. */\n\twidth: number = 0;\n\n\t/** The height of the mesh's image. Available only when nonessential data was exported. */\n\theight: number = 0;\n\n\t/** The number of entries at the beginning of {@link #vertices} that make up the mesh hull. */\n\thullLength: number = 0;\n\n\t/** Vertex index pairs describing edges for controling triangulation. Mesh triangles will never cross edges. Only available if\n\t * nonessential data was exported. Triangulation is not performed at runtime. */\n\tedges: Array = [];\n\n\tprivate parentMesh: MeshAttachment | null = null;\n\n\tsequence: Sequence | null = null;\n\n\ttempColor = new Color(0, 0, 0, 0);\n\n\tconstructor (name: string, path: string) {\n\t\tsuper(name);\n\t\tthis.path = path;\n\t}\n\n\t/** Calculates {@link #uvs} using the {@link #regionUVs} and region. Must be called if the region, the region's properties, or\n\t * the {@link #regionUVs} are changed. */\n\tupdateRegion () {\n\t\tif (!this.region) throw new Error(\"Region not set.\");\n\t\tlet regionUVs = this.regionUVs;\n\t\tif (!this.uvs || this.uvs.length != regionUVs.length) this.uvs = Utils.newFloatArray(regionUVs.length);\n\t\tlet uvs = this.uvs;\n\t\tlet n = this.uvs.length;\n\t\tlet u = this.region.u, v = this.region.v, width = 0, height = 0;\n\t\tif (this.region instanceof TextureAtlasRegion) {\n\t\t\tlet region = this.region, page = region.page;\n\t\t\tlet textureWidth = page.width, textureHeight = page.height;\n\t\t\tswitch (region.degrees) {\n\t\t\t\tcase 90:\n\t\t\t\t\tu -= (region.originalHeight - region.offsetY - region.height) / textureWidth;\n\t\t\t\t\tv -= (region.originalWidth - region.offsetX - region.width) / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + regionUVs[i + 1] * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 180:\n\t\t\t\t\tu -= (region.originalWidth - region.offsetX - region.width) / textureWidth;\n\t\t\t\t\tv -= region.offsetY / textureHeight;\n\t\t\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\t\t\theight = region.originalHeight / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + (1 - regionUVs[i + 1]) * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\tcase 270:\n\t\t\t\t\tu -= region.offsetY / textureWidth;\n\t\t\t\t\tv -= region.offsetX / textureHeight;\n\t\t\t\t\twidth = region.originalHeight / textureWidth;\n\t\t\t\t\theight = region.originalWidth / textureHeight;\n\t\t\t\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\t\t\t\tuvs[i] = u + (1 - regionUVs[i + 1]) * width;\n\t\t\t\t\t\tuvs[i + 1] = v + regionUVs[i] * height;\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t}\n\t\t\tu -= region.offsetX / textureWidth;\n\t\t\tv -= (region.originalHeight - region.offsetY - region.height) / textureHeight;\n\t\t\twidth = region.originalWidth / textureWidth;\n\t\t\theight = region.originalHeight / textureHeight;\n\t\t} else if (!this.region) {\n\t\t\tu = v = 0;\n\t\t\twidth = height = 1;\n\t\t} else {\n\t\t\twidth = this.region.u2 - u;\n\t\t\theight = this.region.v2 - v;\n\t\t}\n\n\t\tfor (let i = 0; i < n; i += 2) {\n\t\t\tuvs[i] = u + regionUVs[i] * width;\n\t\t\tuvs[i + 1] = v + regionUVs[i + 1] * height;\n\t\t}\n\t}\n\n\t/** The parent mesh if this is a linked mesh, else null. A linked mesh shares the {@link #bones}, {@link #vertices},\n\t * {@link #regionUVs}, {@link #triangles}, {@link #hullLength}, {@link #edges}, {@link #width}, and {@link #height} with the\n\t * parent mesh, but may have a different {@link #name} or {@link #path} (and therefore a different texture). */\n\tgetParentMesh () {\n\t\treturn this.parentMesh;\n\t}\n\n\t/** @param parentMesh May be null. */\n\tsetParentMesh (parentMesh: MeshAttachment) {\n\t\tthis.parentMesh = parentMesh;\n\t\tif (parentMesh) {\n\t\t\tthis.bones = parentMesh.bones;\n\t\t\tthis.vertices = parentMesh.vertices;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength;\n\t\t\tthis.regionUVs = parentMesh.regionUVs;\n\t\t\tthis.triangles = parentMesh.triangles;\n\t\t\tthis.hullLength = parentMesh.hullLength;\n\t\t\tthis.worldVerticesLength = parentMesh.worldVerticesLength\n\t\t}\n\t}\n\n\tcopy (): Attachment {\n\t\tif (this.parentMesh) return this.newLinkedMesh();\n\n\t\tlet copy = new MeshAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.color.setFromColor(this.color);\n\n\t\tthis.copyTo(copy);\n\t\tcopy.regionUVs = new Array(this.regionUVs.length);\n\t\tUtils.arrayCopy(this.regionUVs, 0, copy.regionUVs, 0, this.regionUVs.length);\n\t\tcopy.uvs = new Array(this.uvs.length);\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, this.uvs.length);\n\t\tcopy.triangles = new Array(this.triangles.length);\n\t\tUtils.arrayCopy(this.triangles, 0, copy.triangles, 0, this.triangles.length);\n\t\tcopy.hullLength = this.hullLength;\n\n\t\tcopy.sequence = this.sequence != null ? this.sequence.copy() : null;\n\n\t\t// Nonessential.\n\t\tif (this.edges) {\n\t\t\tcopy.edges = new Array(this.edges.length);\n\t\t\tUtils.arrayCopy(this.edges, 0, copy.edges, 0, this.edges.length);\n\t\t}\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\n\t\treturn copy;\n\t}\n\n\tcomputeWorldVertices (slot: Slot, start: number, count: number, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tif (this.sequence != null) this.sequence.apply(slot, this);\n\t\tsuper.computeWorldVertices(slot, start, count, worldVertices, offset, stride);\n\t}\n\n\t/** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/\n\tnewLinkedMesh (): MeshAttachment {\n\t\tlet copy = new MeshAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.timelineAttachment = this.timelineAttachment;\n\t\tcopy.setParentMesh(this.parentMesh ? this.parentMesh : this);\n\t\tif (copy.region != null) copy.updateRegion();\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color, Utils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment whose vertices make up a composite Bezier curve.\n *\n * See {@link PathConstraint} and [Paths](http://esotericsoftware.com/spine-paths) in the Spine User Guide. */\nexport class PathAttachment extends VertexAttachment {\n\n\t/** The lengths along the path in the setup pose from the start of the path to the end of each Bezier curve. */\n\tlengths: Array = [];\n\n\t/** If true, the start and end knots are connected. */\n\tclosed = false;\n\n\t/** If true, additional calculations are performed to make calculating positions along the path more accurate. If false, fewer\n\t * calculations are performed but calculating positions along the path is less accurate. */\n\tconstantSpeed = false;\n\n\t/** The color of the path as it was in Spine. Available only when nonessential data was exported. Paths are not usually\n\t * rendered at runtime. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new PathAttachment(this.name);\n\t\tthis.copyTo(copy);\n\t\tcopy.lengths = new Array(this.lengths.length);\n\t\tUtils.arrayCopy(this.lengths, 0, copy.lengths, 0, this.lengths.length);\n\t\tcopy.closed = closed;\n\t\tcopy.constantSpeed = this.constantSpeed;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"../Bone.js\";\nimport { Color, Vector2, MathUtils } from \"../Utils.js\";\nimport { VertexAttachment, Attachment } from \"./Attachment.js\";\n\n/** An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be\n * used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a\n * skin.\n *\n * See [Point Attachments](http://esotericsoftware.com/spine-point-attachments) in the Spine User Guide. */\nexport class PointAttachment extends VertexAttachment {\n\tx: number = 0;\n\ty: number = 0;\n\trotation: number = 0;\n\n\t/** The color of the point attachment as it was in Spine. Available only when nonessential data was exported. Point attachments\n\t * are not usually rendered at runtime. */\n\tcolor = new Color(0.38, 0.94, 0, 1);\n\n\tconstructor (name: string) {\n\t\tsuper(name);\n\t}\n\n\tcomputeWorldPosition (bone: Bone, point: Vector2) {\n\t\tpoint.x = this.x * bone.a + this.y * bone.b + bone.worldX;\n\t\tpoint.y = this.x * bone.c + this.y * bone.d + bone.worldY;\n\t\treturn point;\n\t}\n\n\tcomputeWorldRotation (bone: Bone) {\n\t\tconst r = this.rotation * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\tconst x = cos * bone.a + sin * bone.b;\n\t\tconst y = cos * bone.c + sin * bone.d;\n\t\treturn MathUtils.atan2Deg(y, x);\t\t\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new PointAttachment(this.name);\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.color.setFromColor(this.color);\n\t\treturn copy;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"../Bone.js\";\nimport { TextureRegion } from \"../Texture.js\";\nimport { Color, MathUtils, NumberArrayLike, Utils } from \"../Utils.js\";\nimport { Attachment } from \"./Attachment.js\";\nimport { HasTextureRegion } from \"./HasTextureRegion.js\";\nimport { Sequence } from \"./Sequence.js\";\nimport { Slot } from \"../Slot.js\";\n\n/** An attachment that displays a textured quadrilateral.\n *\n * See [Region attachments](http://esotericsoftware.com/spine-regions) in the Spine User Guide. */\nexport class RegionAttachment extends Attachment implements HasTextureRegion {\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 1;\n\n\t/** The local scaleY. */\n\tscaleY = 1;\n\n\t/** The local rotation. */\n\trotation = 0;\n\n\t/** The width of the region attachment in Spine. */\n\twidth = 0;\n\n\t/** The height of the region attachment in Spine. */\n\theight = 0;\n\n\t/** The color to tint the region attachment. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The name of the texture region for this attachment. */\n\tpath: string;\n\n\tregion: TextureRegion | null = null;\n\tsequence: Sequence | null = null;\n\n\t/** For each of the 4 vertices, a pair of x,y values that is the local position of the vertex.\n\t *\n\t * See {@link #updateOffset()}. */\n\toffset = Utils.newFloatArray(8);\n\n\tuvs = Utils.newFloatArray(8);\n\n\ttempColor = new Color(1, 1, 1, 1);\n\n\tconstructor (name: string, path: string) {\n\t\tsuper(name);\n\t\tthis.path = path;\n\t}\n\n\t/** Calculates the {@link #offset} using the region settings. Must be called after changing region settings. */\n\tupdateRegion (): void {\n\t\tif (!this.region) throw new Error(\"Region not set.\");\n\t\tlet region = this.region;\n\t\tlet uvs = this.uvs;\n\n\t\tif (region == null) {\n\t\t\tuvs[0] = 0;\n\t\t\tuvs[1] = 0;\n\t\t\tuvs[2] = 0;\n\t\t\tuvs[3] = 1;\n\t\t\tuvs[4] = 1;\n\t\t\tuvs[5] = 1;\n\t\t\tuvs[6] = 1;\n\t\t\tuvs[7] = 0;\n\t\t\treturn;\n\t\t}\n\n\t\tlet regionScaleX = this.width / this.region.originalWidth * this.scaleX;\n\t\tlet regionScaleY = this.height / this.region.originalHeight * this.scaleY;\n\t\tlet localX = -this.width / 2 * this.scaleX + this.region.offsetX * regionScaleX;\n\t\tlet localY = -this.height / 2 * this.scaleY + this.region.offsetY * regionScaleY;\n\t\tlet localX2 = localX + this.region.width * regionScaleX;\n\t\tlet localY2 = localY + this.region.height * regionScaleY;\n\t\tlet radians = this.rotation * MathUtils.degRad;\n\t\tlet cos = Math.cos(radians);\n\t\tlet sin = Math.sin(radians);\n\t\tlet x = this.x, y = this.y;\n\t\tlet localXCos = localX * cos + x;\n\t\tlet localXSin = localX * sin;\n\t\tlet localYCos = localY * cos + y;\n\t\tlet localYSin = localY * sin;\n\t\tlet localX2Cos = localX2 * cos + x;\n\t\tlet localX2Sin = localX2 * sin;\n\t\tlet localY2Cos = localY2 * cos + y;\n\t\tlet localY2Sin = localY2 * sin;\n\t\tlet offset = this.offset;\n\t\toffset[0] = localXCos - localYSin;\n\t\toffset[1] = localYCos + localXSin;\n\t\toffset[2] = localXCos - localY2Sin;\n\t\toffset[3] = localY2Cos + localXSin;\n\t\toffset[4] = localX2Cos - localY2Sin;\n\t\toffset[5] = localY2Cos + localX2Sin;\n\t\toffset[6] = localX2Cos - localYSin;\n\t\toffset[7] = localYCos + localX2Sin;\n\n\t\tif (region.degrees == 90) {\n\t\t\tuvs[0] = region.u2;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v2;\n\t\t\tuvs[4] = region.u;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v;\n\t\t} else {\n\t\t\tuvs[0] = region.u;\n\t\t\tuvs[1] = region.v2;\n\t\t\tuvs[2] = region.u;\n\t\t\tuvs[3] = region.v;\n\t\t\tuvs[4] = region.u2;\n\t\t\tuvs[5] = region.v;\n\t\t\tuvs[6] = region.u2;\n\t\t\tuvs[7] = region.v2;\n\t\t}\n\t}\n\n\t/** Transforms the attachment's four vertices to world coordinates. If the attachment has a {@link #sequence}, the region may\n\t * be changed.\n\t *

\n\t * See World transforms in the Spine\n\t * Runtimes Guide.\n\t * @param worldVertices The output world vertices. Must have a length >= offset + 8.\n\t * @param offset The worldVertices index to begin writing values.\n\t * @param stride The number of worldVertices entries between the value pairs written. */\n\tcomputeWorldVertices (slot: Slot, worldVertices: NumberArrayLike, offset: number, stride: number) {\n\t\tif (this.sequence != null)\n\t\t\tthis.sequence.apply(slot, this);\n\n\t\tlet bone = slot.bone;\n\t\tlet vertexOffset = this.offset;\n\t\tlet x = bone.worldX, y = bone.worldY;\n\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\tlet offsetX = 0, offsetY = 0;\n\n\t\toffsetX = vertexOffset[0];\n\t\toffsetY = vertexOffset[1];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // br\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[2];\n\t\toffsetY = vertexOffset[3];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // bl\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[4];\n\t\toffsetY = vertexOffset[5];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ul\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t\toffset += stride;\n\n\t\toffsetX = vertexOffset[6];\n\t\toffsetY = vertexOffset[7];\n\t\tworldVertices[offset] = offsetX * a + offsetY * b + x; // ur\n\t\tworldVertices[offset + 1] = offsetX * c + offsetY * d + y;\n\t}\n\n\tcopy (): Attachment {\n\t\tlet copy = new RegionAttachment(this.name, this.path);\n\t\tcopy.region = this.region;\n\t\tcopy.x = this.x;\n\t\tcopy.y = this.y;\n\t\tcopy.scaleX = this.scaleX;\n\t\tcopy.scaleY = this.scaleY;\n\t\tcopy.rotation = this.rotation;\n\t\tcopy.width = this.width;\n\t\tcopy.height = this.height;\n\t\tUtils.arrayCopy(this.uvs, 0, copy.uvs, 0, 8);\n\t\tUtils.arrayCopy(this.offset, 0, copy.offset, 0, 8);\n\t\tcopy.color.setFromColor(this.color);\n\t\tcopy.sequence = this.sequence != null ? this.sequence.copy() : null;\n\t\treturn copy;\n\t}\n\n\tstatic X1 = 0;\n\tstatic Y1 = 1;\n\tstatic C1R = 2;\n\tstatic C1G = 3;\n\tstatic C1B = 4;\n\tstatic C1A = 5;\n\tstatic U1 = 6;\n\tstatic V1 = 7;\n\n\tstatic X2 = 8;\n\tstatic Y2 = 9;\n\tstatic C2R = 10;\n\tstatic C2G = 11;\n\tstatic C2B = 12;\n\tstatic C2A = 13;\n\tstatic U2 = 14;\n\tstatic V2 = 15;\n\n\tstatic X3 = 16;\n\tstatic Y3 = 17;\n\tstatic C3R = 18;\n\tstatic C3G = 19;\n\tstatic C3B = 20;\n\tstatic C3A = 21;\n\tstatic U3 = 22;\n\tstatic V3 = 23;\n\n\tstatic X4 = 24;\n\tstatic Y4 = 25;\n\tstatic C4R = 26;\n\tstatic C4G = 27;\n\tstatic C4B = 28;\n\tstatic C4A = 29;\n\tstatic U4 = 30;\n\tstatic V4 = 31;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { BoundingBoxAttachment } from \"./attachments/BoundingBoxAttachment.js\";\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { PointAttachment } from \"./attachments/PointAttachment.js\";\nimport { RegionAttachment } from \"./attachments/RegionAttachment.js\";\nimport { Skin } from \"./Skin.js\";\nimport { TextureAtlas } from \"./TextureAtlas.js\";\nimport { Sequence } from \"./attachments/Sequence.js\"\n\n/** An {@link AttachmentLoader} that configures attachments using texture regions from an {@link TextureAtlas}.\n *\n * See [Loading skeleton data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the\n * Spine Runtimes Guide. */\nexport class AtlasAttachmentLoader implements AttachmentLoader {\n\tatlas: TextureAtlas;\n\n\tconstructor (atlas: TextureAtlas) {\n\t\tthis.atlas = atlas;\n\t}\n\n\tloadSequence (name: string, basePath: string, sequence: Sequence) {\n\t\tlet regions = sequence.regions;\n\t\tfor (let i = 0, n = regions.length; i < n; i++) {\n\t\t\tlet path = sequence.getPath(basePath, i);\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (region == null) throw new Error(\"Region not found in atlas: \" + path + \" (sequence: \" + name + \")\");\n\t\t\tregions[i] = region;\n\t\t}\n\t}\n\n\tnewRegionAttachment (skin: Skin, name: string, path: string, sequence: Sequence): RegionAttachment {\n\t\tlet attachment = new RegionAttachment(name, path);\n\t\tif (sequence != null) {\n\t\t\tthis.loadSequence(name, path, sequence);\n\t\t} else {\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (!region) throw new Error(\"Region not found in atlas: \" + path + \" (region attachment: \" + name + \")\");\n\t\t\tattachment.region = region;\n\t\t}\n\t\treturn attachment;\n\t}\n\n\tnewMeshAttachment (skin: Skin, name: string, path: string, sequence: Sequence): MeshAttachment {\n\t\tlet attachment = new MeshAttachment(name, path);\n\t\tif (sequence != null) {\n\t\t\tthis.loadSequence(name, path, sequence);\n\t\t} else {\n\t\t\tlet region = this.atlas.findRegion(path);\n\t\t\tif (!region) throw new Error(\"Region not found in atlas: \" + path + \" (mesh attachment: \" + name + \")\");\n\t\t\tattachment.region = region;\n\t\t}\n\t\treturn attachment;\n\t}\n\n\tnewBoundingBoxAttachment (skin: Skin, name: string): BoundingBoxAttachment {\n\t\treturn new BoundingBoxAttachment(name);\n\t}\n\n\tnewPathAttachment (skin: Skin, name: string): PathAttachment {\n\t\treturn new PathAttachment(name);\n\t}\n\n\tnewPointAttachment (skin: Skin, name: string): PointAttachment {\n\t\treturn new PointAttachment(name);\n\t}\n\n\tnewClippingAttachment (skin: Skin, name: string): ClippingAttachment {\n\t\treturn new ClippingAttachment(name);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color } from \"./Utils.js\";\n\n/** Stores the setup pose for a {@link Bone}. */\nexport class BoneData {\n\t/** The index of the bone in {@link Skeleton#getBones()}. */\n\tindex: number = 0;\n\n\t/** The name of the bone, which is unique across all bones in the skeleton. */\n\tname: string;\n\n\t/** @returns May be null. */\n\tparent: BoneData | null = null;\n\n\t/** The bone's length. */\n\tlength: number = 0;\n\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local rotation in degrees, counter clockwise. */\n\trotation = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 1;\n\n\t/** The local scaleY. */\n\tscaleY = 1;\n\n\t/** The local shearX. */\n\tshearX = 0;\n\n\t/** The local shearX. */\n\tshearY = 0;\n\n\t/** The transform mode for how parent world transforms affect this bone. */\n\tinherit = Inherit.Normal;\n\n\t/** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#skin} contains this\n\t * bone.\n\t * @see Skin#bones */\n\tskinRequired = false;\n\n\t/** The color of the bone as it was in Spine. Available only when nonessential data was exported. Bones are not usually\n\t * rendered at runtime. */\n\tcolor = new Color();\n\n\t/** The bone icon as it was in Spine, or null if nonessential data was not exported. */\n\ticon?: string;\n\n\t/** False if the bone was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */\n\tvisible = false;\n\n\tconstructor (index: number, name: string, parent: BoneData | null) {\n\t\tif (index < 0) throw new Error(\"index must be >= 0.\");\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.index = index;\n\t\tthis.name = name;\n\t\tthis.parent = parent;\n\t}\n}\n\n/** Determines how a bone inherits world transforms from parent bones. */\nexport enum Inherit { Normal, OnlyTranslation, NoRotationOrReflection, NoScale, NoScaleOrReflection }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData, Inherit } from \"./BoneData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils, Vector2 } from \"./Utils.js\";\n\n/** Stores a bone's current pose.\n *\n * A bone has a local transform which is used to compute its world transform. A bone also has an applied transform, which is a\n * local transform that can be applied to compute the world transform. The local transform and applied transform may differ if a\n * constraint or application code modifies the world transform after it was computed from the local transform. */\nexport class Bone implements Updatable {\n\t/** The bone's setup pose data. */\n\tdata: BoneData;\n\n\t/** The skeleton this bone belongs to. */\n\tskeleton: Skeleton;\n\n\t/** The parent bone, or null if this is the root bone. */\n\tparent: Bone | null = null;\n\n\t/** The immediate children of this bone. */\n\tchildren = new Array();\n\n\t/** The local x translation. */\n\tx = 0;\n\n\t/** The local y translation. */\n\ty = 0;\n\n\t/** The local rotation in degrees, counter clockwise. */\n\trotation = 0;\n\n\t/** The local scaleX. */\n\tscaleX = 0;\n\n\t/** The local scaleY. */\n\tscaleY = 0;\n\n\t/** The local shearX. */\n\tshearX = 0;\n\n\t/** The local shearY. */\n\tshearY = 0;\n\n\t/** The applied local x translation. */\n\tax = 0;\n\n\t/** The applied local y translation. */\n\tay = 0;\n\n\t/** The applied local rotation in degrees, counter clockwise. */\n\tarotation = 0;\n\n\t/** The applied local scaleX. */\n\tascaleX = 0;\n\n\t/** The applied local scaleY. */\n\tascaleY = 0;\n\n\t/** The applied local shearX. */\n\tashearX = 0;\n\n\t/** The applied local shearY. */\n\tashearY = 0;\n\n\t/** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\ta = 0;\n\n\t/** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\tb = 0;\n\n\t/** Part of the world transform matrix for the X axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\tc = 0;\n\n\t/** Part of the world transform matrix for the Y axis. If changed, {@link #updateAppliedTransform()} should be called. */\n\td = 0;\n\n\t/** The world X position. If changed, {@link #updateAppliedTransform()} should be called. */\n\tworldY = 0;\n\n\t/** The world Y position. If changed, {@link #updateAppliedTransform()} should be called. */\n\tworldX = 0;\n\n\tinherit: Inherit = Inherit.Normal;\n\n\tsorted = false;\n\tactive = false;\n\n\t/** @param parent May be null. */\n\tconstructor (data: BoneData, skeleton: Skeleton, parent: Bone | null) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\t\tthis.skeleton = skeleton;\n\t\tthis.parent = parent;\n\t\tthis.setToSetupPose();\n\t}\n\n\t/** Returns false when the bone has not been computed because {@link BoneData#skinRequired} is true and the\n\t * {@link Skeleton#skin active skin} does not {@link Skin#bones contain} this bone. */\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\t/** Computes the world transform using the parent bone and this bone's local applied transform. */\n\tupdate (physics: Physics) {\n\t\tthis.updateWorldTransformWith(this.ax, this.ay, this.arotation, this.ascaleX, this.ascaleY, this.ashearX, this.ashearY);\n\t}\n\n\t/** Computes the world transform using the parent bone and this bone's local transform.\n\t *\n\t * See {@link #updateWorldTransformWith()}. */\n\tupdateWorldTransform () {\n\t\tthis.updateWorldTransformWith(this.x, this.y, this.rotation, this.scaleX, this.scaleY, this.shearX, this.shearY);\n\t}\n\n\t/** Computes the world transform using the parent bone and the specified local transform. The applied transform is set to the\n\t * specified local transform. Child bones are not updated.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide. */\n\tupdateWorldTransformWith (x: number, y: number, rotation: number, scaleX: number, scaleY: number, shearX: number, shearY: number) {\n\t\tthis.ax = x;\n\t\tthis.ay = y;\n\t\tthis.arotation = rotation;\n\t\tthis.ascaleX = scaleX;\n\t\tthis.ascaleY = scaleY;\n\t\tthis.ashearX = shearX;\n\t\tthis.ashearY = shearY;\n\n\t\tlet parent = this.parent;\n\t\tif (!parent) { // Root bone.\n\t\t\tlet skeleton = this.skeleton;\n\t\t\tconst sx = skeleton.scaleX, sy = skeleton.scaleY;\n\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\tthis.a = Math.cos(rx) * scaleX * sx;\n\t\t\tthis.b = Math.cos(ry) * scaleY * sx;\n\t\t\tthis.c = Math.sin(rx) * scaleX * sy;\n\t\t\tthis.d = Math.sin(ry) * scaleY * sy;\n\t\t\tthis.worldX = x * sx + skeleton.x;\n\t\t\tthis.worldY = y * sy + skeleton.y;\n\t\t\treturn;\n\t\t}\n\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\tthis.worldX = pa * x + pb * y + parent.worldX;\n\t\tthis.worldY = pc * x + pd * y + parent.worldY;\n\n\t\tswitch (this.inherit) {\n\t\t\tcase Inherit.Normal: {\n\t\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = pa * la + pb * lc;\n\t\t\t\tthis.b = pa * lb + pb * ld;\n\t\t\t\tthis.c = pc * la + pd * lc;\n\t\t\t\tthis.d = pc * lb + pd * ld;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcase Inherit.OnlyTranslation: {\n\t\t\t\tconst rx = (rotation + shearX) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + 90 + shearY) * MathUtils.degRad;\n\t\t\t\tthis.a = Math.cos(rx) * scaleX;\n\t\t\t\tthis.b = Math.cos(ry) * scaleY;\n\t\t\t\tthis.c = Math.sin(rx) * scaleX;\n\t\t\t\tthis.d = Math.sin(ry) * scaleY;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\tlet sx = 1 / this.skeleton.scaleX, sy = 1 / this.skeleton.scaleY;\n\t\t\t\tpa *= sx;\n\t\t\t\tpc *= sy;\n\t\t\t\tlet s = pa * pa + pc * pc;\n\t\t\t\tlet prx = 0;\n\t\t\t\tif (s > 0.0001) {\n\t\t\t\t\ts = Math.abs(pa * pd * sy - pb * sx * pc) / s;\n\t\t\t\t\tpb = pc * s;\n\t\t\t\t\tpd = pa * s;\n\t\t\t\t\tprx = Math.atan2(pc, pa) * MathUtils.radDeg;\n\t\t\t\t} else {\n\t\t\t\t\tpa = 0;\n\t\t\t\t\tpc = 0;\n\t\t\t\t\tprx = 90 - Math.atan2(pd, pb) * MathUtils.radDeg;\n\t\t\t\t}\n\t\t\t\tconst rx = (rotation + shearX - prx) * MathUtils.degRad;\n\t\t\t\tconst ry = (rotation + shearY - prx + 90) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(rx) * scaleX;\n\t\t\t\tconst lb = Math.cos(ry) * scaleY;\n\t\t\t\tconst lc = Math.sin(rx) * scaleX;\n\t\t\t\tconst ld = Math.sin(ry) * scaleY;\n\t\t\t\tthis.a = pa * la - pb * lc;\n\t\t\t\tthis.b = pa * lb - pb * ld;\n\t\t\t\tthis.c = pc * la + pd * lc;\n\t\t\t\tthis.d = pc * lb + pd * ld;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tcase Inherit.NoScale:\n\t\t\tcase Inherit.NoScaleOrReflection: {\n\t\t\t\trotation *= MathUtils.degRad;\n\t\t\t\tconst cos = Math.cos(rotation), sin = Math.sin(rotation);\n\t\t\t\tlet za = (pa * cos + pb * sin) / this.skeleton.scaleX;\n\t\t\t\tlet zc = (pc * cos + pd * sin) / this.skeleton.scaleY;\n\t\t\t\tlet s = Math.sqrt(za * za + zc * zc);\n\t\t\t\tif (s > 0.00001) s = 1 / s;\n\t\t\t\tza *= s;\n\t\t\t\tzc *= s;\n\t\t\t\ts = Math.sqrt(za * za + zc * zc);\n\t\t\t\tif (this.inherit == Inherit.NoScale\n\t\t\t\t\t&& (pa * pd - pb * pc < 0) != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) s = -s;\n\t\t\t\trotation = Math.PI / 2 + Math.atan2(zc, za);\n\t\t\t\tconst zb = Math.cos(rotation) * s;\n\t\t\t\tconst zd = Math.sin(rotation) * s;\n\t\t\t\tshearX *= MathUtils.degRad;\n\t\t\t\tshearY = (90 + shearY) * MathUtils.degRad;\n\t\t\t\tconst la = Math.cos(shearX) * scaleX;\n\t\t\t\tconst lb = Math.cos(shearY) * scaleY;\n\t\t\t\tconst lc = Math.sin(shearX) * scaleX;\n\t\t\t\tconst ld = Math.sin(shearY) * scaleY;\n\t\t\t\tthis.a = za * la + zb * lc;\n\t\t\t\tthis.b = za * lb + zb * ld;\n\t\t\t\tthis.c = zc * la + zd * lc;\n\t\t\t\tthis.d = zc * lb + zd * ld;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis.a *= this.skeleton.scaleX;\n\t\tthis.b *= this.skeleton.scaleX;\n\t\tthis.c *= this.skeleton.scaleY;\n\t\tthis.d *= this.skeleton.scaleY;\n\t}\n\n\t/** Sets this bone's local transform to the setup pose. */\n\tsetToSetupPose () {\n\t\tlet data = this.data;\n\t\tthis.x = data.x;\n\t\tthis.y = data.y;\n\t\tthis.rotation = data.rotation;\n\t\tthis.scaleX = data.scaleX;\n\t\tthis.scaleY = data.scaleY;\n\t\tthis.shearX = data.shearX;\n\t\tthis.shearY = data.shearY;\n\t\tthis.inherit = data.inherit;\n\t}\n\n\t/** Computes the applied transform values from the world transform.\n\t *\n\t * If the world transform is modified (by a constraint, {@link #rotateWorld(float)}, etc) then this method should be called so\n\t * the applied transform matches the world transform. The applied transform may be needed by other code (eg to apply other\n\t * constraints).\n\t *\n\t * Some information is ambiguous in the world transform, such as -1,-1 scale versus 180 rotation. The applied transform after\n\t * calling this method is equivalent to the local transform used to compute the world transform, but may not be identical. */\n\tupdateAppliedTransform () {\n\t\tlet parent = this.parent;\n\t\tif (!parent) {\n\t\t\tthis.ax = this.worldX - this.skeleton.x;\n\t\t\tthis.ay = this.worldY - this.skeleton.y;\n\t\t\tthis.arotation = Math.atan2(this.c, this.a) * MathUtils.radDeg;\n\t\t\tthis.ascaleX = Math.sqrt(this.a * this.a + this.c * this.c);\n\t\t\tthis.ascaleY = Math.sqrt(this.b * this.b + this.d * this.d);\n\t\t\tthis.ashearX = 0;\n\t\t\tthis.ashearY = Math.atan2(this.a * this.b + this.c * this.d, this.a * this.d - this.b * this.c) * MathUtils.radDeg;\n\t\t\treturn;\n\t\t}\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\tlet pid = 1 / (pa * pd - pb * pc);\n\t\tlet ia = pd * pid, ib = pb * pid, ic = pc * pid, id = pa * pid;\n\t\tlet dx = this.worldX - parent.worldX, dy = this.worldY - parent.worldY;\n\t\tthis.ax = (dx * ia - dy * ib);\n\t\tthis.ay = (dy * id - dx * ic);\n\n\t\tlet ra, rb, rc, rd;\n\t\tif (this.inherit == Inherit.OnlyTranslation) {\n\t\t\tra = this.a;\n\t\t\trb = this.b;\n\t\t\trc = this.c;\n\t\t\trd = this.d;\n\t\t} else {\n\t\t\tswitch (this.inherit) {\n\t\t\t\tcase Inherit.NoRotationOrReflection: {\n\t\t\t\t\tlet s = Math.abs(pa * pd - pb * pc) / (pa * pa + pc * pc);\n\t\t\t\t\tpb = -pc * this.skeleton.scaleX * s / this.skeleton.scaleY;\n\t\t\t\t\tpd = pa * this.skeleton.scaleY * s / this.skeleton.scaleX;\n\t\t\t\t\tpid = 1 / (pa * pd - pb * pc);\n\t\t\t\t\tia = pd * pid;\n\t\t\t\t\tib = pb * pid;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase Inherit.NoScale:\n\t\t\t\tcase Inherit.NoScaleOrReflection:\n\t\t\t\t\tlet cos = MathUtils.cosDeg(this.rotation), sin = MathUtils.sinDeg(this.rotation);\n\t\t\t\t\tpa = (pa * cos + pb * sin) / this.skeleton.scaleX;\n\t\t\t\t\tpc = (pc * cos + pd * sin) / this.skeleton.scaleY;\n\t\t\t\t\tlet s = Math.sqrt(pa * pa + pc * pc);\n\t\t\t\t\tif (s > 0.00001) s = 1 / s;\n\t\t\t\t\tpa *= s;\n\t\t\t\t\tpc *= s;\n\t\t\t\t\ts = Math.sqrt(pa * pa + pc * pc);\n\t\t\t\t\tif (this.inherit == Inherit.NoScale && pid < 0 != (this.skeleton.scaleX < 0 != this.skeleton.scaleY < 0)) s = -s;\n\t\t\t\t\tlet r = MathUtils.PI / 2 + Math.atan2(pc, pa);\n\t\t\t\t\tpb = Math.cos(r) * s;\n\t\t\t\t\tpd = Math.sin(r) * s;\n\t\t\t\t\tpid = 1 / (pa * pd - pb * pc);\n\t\t\t\t\tia = pd * pid;\n\t\t\t\t\tib = pb * pid;\n\t\t\t\t\tic = pc * pid;\n\t\t\t\t\tid = pa * pid;\n\t\t\t}\n\t\t\tra = ia * this.a - ib * this.c;\n\t\t\trb = ia * this.b - ib * this.d;\n\t\t\trc = id * this.c - ic * this.a;\n\t\t\trd = id * this.d - ic * this.b;\n\t\t}\n\n\t\tthis.ashearX = 0;\n\t\tthis.ascaleX = Math.sqrt(ra * ra + rc * rc);\n\t\tif (this.ascaleX > 0.0001) {\n\t\t\tlet det = ra * rd - rb * rc;\n\t\t\tthis.ascaleY = det / this.ascaleX;\n\t\t\tthis.ashearY = -Math.atan2(ra * rb + rc * rd, det) * MathUtils.radDeg;\n\t\t\tthis.arotation = Math.atan2(rc, ra) * MathUtils.radDeg;\n\t\t} else {\n\t\t\tthis.ascaleX = 0;\n\t\t\tthis.ascaleY = Math.sqrt(rb * rb + rd * rd);\n\t\t\tthis.ashearY = 0;\n\t\t\tthis.arotation = 90 - Math.atan2(rd, rb) * MathUtils.radDeg;\n\t\t}\n\t}\n\n\n\t/** The world rotation for the X axis, calculated using {@link #a} and {@link #c}. */\n\tgetWorldRotationX () {\n\t\treturn Math.atan2(this.c, this.a) * MathUtils.radDeg;\n\t}\n\n\t/** The world rotation for the Y axis, calculated using {@link #b} and {@link #d}. */\n\tgetWorldRotationY () {\n\t\treturn Math.atan2(this.d, this.b) * MathUtils.radDeg;\n\t}\n\n\t/** The magnitude (always positive) of the world scale X, calculated using {@link #a} and {@link #c}. */\n\tgetWorldScaleX () {\n\t\treturn Math.sqrt(this.a * this.a + this.c * this.c);\n\t}\n\n\t/** The magnitude (always positive) of the world scale Y, calculated using {@link #b} and {@link #d}. */\n\tgetWorldScaleY () {\n\t\treturn Math.sqrt(this.b * this.b + this.d * this.d);\n\t}\n\n\t/** Transforms a point from world coordinates to the bone's local coordinates. */\n\tworldToLocal (world: Vector2) {\n\t\tlet invDet = 1 / (this.a * this.d - this.b * this.c);\n\t\tlet x = world.x - this.worldX, y = world.y - this.worldY;\n\t\tworld.x = x * this.d * invDet - y * this.b * invDet;\n\t\tworld.y = y * this.a * invDet - x * this.c * invDet;\n\t\treturn world;\n\t}\n\n\t/** Transforms a point from the bone's local coordinates to world coordinates. */\n\tlocalToWorld (local: Vector2) {\n\t\tlet x = local.x, y = local.y;\n\t\tlocal.x = x * this.a + y * this.b + this.worldX;\n\t\tlocal.y = x * this.c + y * this.d + this.worldY;\n\t\treturn local;\n\t}\n\n\t/** Transforms a point from world coordinates to the parent bone's local coordinates. */\n\tworldToParent (world: Vector2) {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\treturn this.parent == null ? world : this.parent.worldToLocal(world);\n\t}\n\n\t/** Transforms a point from the parent bone's coordinates to world coordinates. */\n\tparentToWorld (world: Vector2) {\n\t\tif (world == null) throw new Error(\"world cannot be null.\");\n\t\treturn this.parent == null ? world : this.parent.localToWorld(world);\n\t}\n\n\t/** Transforms a world rotation to a local rotation. */\n\tworldToLocalRotation (worldRotation: number) {\n\t\tlet sin = MathUtils.sinDeg(worldRotation), cos = MathUtils.cosDeg(worldRotation);\n\t\treturn Math.atan2(this.a * sin - this.c * cos, this.d * cos - this.b * sin) * MathUtils.radDeg + this.rotation - this.shearX;\n\t}\n\n\t/** Transforms a local rotation to a world rotation. */\n\tlocalToWorldRotation (localRotation: number) {\n\t\tlocalRotation -= this.rotation - this.shearX;\n\t\tlet sin = MathUtils.sinDeg(localRotation), cos = MathUtils.cosDeg(localRotation);\n\t\treturn Math.atan2(cos * this.c + sin * this.d, cos * this.a + sin * this.b) * MathUtils.radDeg;\n\t}\n\n\t/** Rotates the world transform the specified amount.\n\t *

\n\t * After changes are made to the world transform, {@link #updateAppliedTransform()} should be called and\n\t * {@link #update(Physics)} will need to be called on any child bones, recursively. */\n\trotateWorld (degrees: number) {\n\t\tdegrees *= MathUtils.degRad;\n\t\tconst sin = Math.sin(degrees), cos = Math.cos(degrees);\n\t\tconst ra = this.a, rb = this.b;\n\t\tthis.a = cos * ra - sin * this.c;\n\t\tthis.b = cos * rb - sin * this.d;\n\t\tthis.c = sin * ra + cos * this.c;\n\t\tthis.d = sin * rb + cos * this.d;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** The base class for all constraint datas. */\nexport abstract class ConstraintData {\n\tconstructor (public name: string, public order: number, public skinRequired: boolean) { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture } from \"./Texture.js\";\nimport { TextureAtlas } from \"./TextureAtlas.js\";\nimport { Disposable, StringMap } from \"./Utils.js\";\n\nexport class AssetManagerBase implements Disposable {\n\tprivate pathPrefix: string = \"\";\n\tprivate textureLoader: (image: HTMLImageElement | ImageBitmap) => Texture;\n\tprivate downloader: Downloader;\n\tprivate assets: StringMap = {};\n\tprivate errors: StringMap = {};\n\tprivate toLoad = 0;\n\tprivate loaded = 0;\n\n\tconstructor (textureLoader: (image: HTMLImageElement | ImageBitmap) => Texture, pathPrefix: string = \"\", downloader: Downloader = new Downloader()) {\n\t\tthis.textureLoader = textureLoader;\n\t\tthis.pathPrefix = pathPrefix;\n\t\tthis.downloader = downloader;\n\t}\n\n\tprivate start (path: string): string {\n\t\tthis.toLoad++;\n\t\treturn this.pathPrefix + path;\n\t}\n\n\tprivate success (callback: (path: string, data: any) => void, path: string, asset: any) {\n\t\tthis.toLoad--;\n\t\tthis.loaded++;\n\t\tthis.assets[path] = asset;\n\t\tif (callback) callback(path, asset);\n\t}\n\n\tprivate error (callback: (path: string, message: string) => void, path: string, message: string) {\n\t\tthis.toLoad--;\n\t\tthis.loaded++;\n\t\tthis.errors[path] = message;\n\t\tif (callback) callback(path, message);\n\t}\n\n\tloadAll () {\n\t\tlet promise = new Promise((resolve: (assetManager: AssetManagerBase) => void, reject: (errors: StringMap) => void) => {\n\t\t\tlet check = () => {\n\t\t\t\tif (this.isLoadingComplete()) {\n\t\t\t\t\tif (this.hasErrors()) reject(this.errors);\n\t\t\t\t\telse resolve(this);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\trequestAnimationFrame(check);\n\t\t\t}\n\t\t\trequestAnimationFrame(check);\n\t\t});\n\t\treturn promise;\n\t}\n\n\tsetRawDataURI (path: string, data: string) {\n\t\tthis.downloader.rawDataUris[this.pathPrefix + path] = data;\n\t}\n\n\tloadBinary (path: string,\n\t\tsuccess: (path: string, binary: Uint8Array) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadBinary(path, (data: Uint8Array): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load binary ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadText (path: string,\n\t\tsuccess: (path: string, text: string) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadText(path, (data: string): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load text ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadJson (path: string,\n\t\tsuccess: (path: string, object: object) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadJson(path, (data: object): void => {\n\t\t\tthis.success(success, path, data);\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load JSON ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tloadTexture (path: string,\n\t\tsuccess: (path: string, texture: Texture) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { }) {\n\t\tpath = this.start(path);\n\n\t\tlet isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document);\n\t\tlet isWebWorker = !isBrowser; // && typeof importScripts !== 'undefined';\n\t\tif (isWebWorker) {\n\t\t\tfetch(path, { mode: \"cors\" }).then((response) => {\n\t\t\t\tif (response.ok) return response.blob();\n\t\t\t\tthis.error(error, path, `Couldn't load image: ${path}`);\n\t\t\t\treturn null;\n\t\t\t}).then((blob) => {\n\t\t\t\treturn blob ? createImageBitmap(blob, { premultiplyAlpha: \"none\", colorSpaceConversion: \"none\" }) : null;\n\t\t\t}).then((bitmap) => {\n\t\t\t\tif (bitmap) this.success(success, path, this.textureLoader(bitmap));\n\t\t\t});\n\t\t} else {\n\t\t\tlet image = new Image();\n\t\t\timage.crossOrigin = \"anonymous\";\n\t\t\timage.onload = () => {\n\t\t\t\tthis.success(success, path, this.textureLoader(image));\n\t\t\t};\n\t\t\timage.onerror = () => {\n\t\t\t\tthis.error(error, path, `Couldn't load image: ${path}`);\n\t\t\t};\n\t\t\tif (this.downloader.rawDataUris[path]) path = this.downloader.rawDataUris[path];\n\t\t\timage.src = path;\n\t\t}\n\t}\n\n\tloadTextureAtlas (path: string,\n\t\tsuccess: (path: string, atlas: TextureAtlas) => void = () => { },\n\t\terror: (path: string, message: string) => void = () => { },\n\t\tfileAlias?: { [keyword: string]: string }\n\t) {\n\t\tlet index = path.lastIndexOf(\"/\");\n\t\tlet parent = index >= 0 ? path.substring(0, index + 1) : \"\";\n\t\tpath = this.start(path);\n\n\t\tthis.downloader.downloadText(path, (atlasText: string): void => {\n\t\t\ttry {\n\t\t\t\tlet atlas = new TextureAtlas(atlasText);\n\t\t\t\tlet toLoad = atlas.pages.length, abort = false;\n\t\t\t\tfor (let page of atlas.pages) {\n\t\t\t\t\tthis.loadTexture(!fileAlias ? parent + page.name : fileAlias[page.name!],\n\t\t\t\t\t\t(imagePath: string, texture: Texture) => {\n\t\t\t\t\t\t\tif (!abort) {\n\t\t\t\t\t\t\t\tpage.setTexture(texture);\n\t\t\t\t\t\t\t\tif (--toLoad == 0) this.success(success, path, atlas);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t(imagePath: string, message: string) => {\n\t\t\t\t\t\t\tif (!abort) this.error(error, path, `Couldn't load texture atlas ${path} page image: ${imagePath}`);\n\t\t\t\t\t\t\tabort = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\tthis.error(error, path, `Couldn't parse texture atlas ${path}: ${(e as any).message}`);\n\t\t\t}\n\t\t}, (status: number, responseText: string): void => {\n\t\t\tthis.error(error, path, `Couldn't load texture atlas ${path}: status ${status}, ${responseText}`);\n\t\t});\n\t}\n\n\tget (path: string) {\n\t\treturn this.assets[this.pathPrefix + path];\n\t}\n\n\trequire (path: string) {\n\t\tpath = this.pathPrefix + path;\n\t\tlet asset = this.assets[path];\n\t\tif (asset) return asset;\n\t\tlet error = this.errors[path];\n\t\tthrow Error(\"Asset not found: \" + path + (error ? \"\\n\" + error : \"\"));\n\t}\n\n\tremove (path: string) {\n\t\tpath = this.pathPrefix + path;\n\t\tlet asset = this.assets[path];\n\t\tif ((asset).dispose) (asset).dispose();\n\t\tdelete this.assets[path];\n\t\treturn asset;\n\t}\n\n\tremoveAll () {\n\t\tfor (let key in this.assets) {\n\t\t\tlet asset = this.assets[key];\n\t\t\tif ((asset).dispose) (asset).dispose();\n\t\t}\n\t\tthis.assets = {};\n\t}\n\n\tisLoadingComplete (): boolean {\n\t\treturn this.toLoad == 0;\n\t}\n\n\tgetToLoad (): number {\n\t\treturn this.toLoad;\n\t}\n\n\tgetLoaded (): number {\n\t\treturn this.loaded;\n\t}\n\n\tdispose () {\n\t\tthis.removeAll();\n\t}\n\n\thasErrors () {\n\t\treturn Object.keys(this.errors).length > 0;\n\t}\n\n\tgetErrors () {\n\t\treturn this.errors;\n\t}\n}\n\nexport class Downloader {\n\tprivate callbacks: StringMap> = {};\n\trawDataUris: StringMap = {};\n\n\tdataUriToString (dataUri: string) {\n\t\tif (!dataUri.startsWith(\"data:\")) {\n\t\t\tthrow new Error(\"Not a data URI.\");\n\t\t}\n\n\t\tlet base64Idx = dataUri.indexOf(\"base64,\");\n\t\tif (base64Idx != -1) {\n\t\t\tbase64Idx += \"base64,\".length;\n\t\t\treturn atob(dataUri.substr(base64Idx));\n\t\t} else {\n\t\t\treturn dataUri.substr(dataUri.indexOf(\",\") + 1);\n\t\t}\n\t}\n\n\tbase64ToUint8Array (base64: string) {\n\t\tvar binary_string = window.atob(base64);\n\t\tvar len = binary_string.length;\n\t\tvar bytes = new Uint8Array(len);\n\t\tfor (var i = 0; i < len; i++) {\n\t\t\tbytes[i] = binary_string.charCodeAt(i);\n\t\t}\n\t\treturn bytes;\n\t}\n\n\tdataUriToUint8Array (dataUri: string) {\n\t\tif (!dataUri.startsWith(\"data:\")) {\n\t\t\tthrow new Error(\"Not a data URI.\");\n\t\t}\n\n\t\tlet base64Idx = dataUri.indexOf(\"base64,\");\n\t\tif (base64Idx == -1) throw new Error(\"Not a binary data URI.\");\n\t\tbase64Idx += \"base64,\".length;\n\t\treturn this.base64ToUint8Array(dataUri.substr(base64Idx));\n\t}\n\n\tdownloadText (url: string, success: (data: string) => void, error: (status: number, responseText: string) => void) {\n\t\tif (this.start(url, success, error)) return;\n\t\tif (this.rawDataUris[url]) {\n\t\t\ttry {\n\t\t\t\tlet dataUri = this.rawDataUris[url];\n\t\t\t\tthis.finish(url, 200, this.dataUriToString(dataUri));\n\t\t\t} catch (e) {\n\t\t\t\tthis.finish(url, 400, JSON.stringify(e));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet request = new XMLHttpRequest();\n\t\trequest.overrideMimeType(\"text/html\");\n\t\trequest.open(\"GET\", url, true);\n\t\tlet done = () => {\n\t\t\tthis.finish(url, request.status, request.responseText);\n\t\t};\n\t\trequest.onload = done;\n\t\trequest.onerror = done;\n\t\trequest.send();\n\t}\n\n\tdownloadJson (url: string, success: (data: object) => void, error: (status: number, responseText: string) => void) {\n\t\tthis.downloadText(url, (data: string): void => {\n\t\t\tsuccess(JSON.parse(data));\n\t\t}, error);\n\t}\n\n\tdownloadBinary (url: string, success: (data: Uint8Array) => void, error: (status: number, responseText: string) => void) {\n\t\tif (this.start(url, success, error)) return;\n\t\tif (this.rawDataUris[url]) {\n\t\t\ttry {\n\t\t\t\tlet dataUri = this.rawDataUris[url];\n\t\t\t\tthis.finish(url, 200, this.dataUriToUint8Array(dataUri));\n\t\t\t} catch (e) {\n\t\t\t\tthis.finish(url, 400, JSON.stringify(e));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tlet request = new XMLHttpRequest();\n\t\trequest.open(\"GET\", url, true);\n\t\trequest.responseType = \"arraybuffer\";\n\t\tlet onerror = () => {\n\t\t\tthis.finish(url, request.status, request.response);\n\t\t};\n\t\trequest.onload = () => {\n\t\t\tif (request.status == 200 || request.status == 0)\n\t\t\t\tthis.finish(url, 200, new Uint8Array(request.response as ArrayBuffer));\n\t\t\telse\n\t\t\t\tonerror();\n\t\t};\n\t\trequest.onerror = onerror;\n\t\trequest.send();\n\t}\n\n\tprivate start (url: string, success: any, error: any) {\n\t\tlet callbacks = this.callbacks[url];\n\t\ttry {\n\t\t\tif (callbacks) return true;\n\t\t\tthis.callbacks[url] = callbacks = [];\n\t\t} finally {\n\t\t\tcallbacks.push(success, error);\n\t\t}\n\t}\n\n\tprivate finish (url: string, status: number, data: any) {\n\t\tlet callbacks = this.callbacks[url];\n\t\tdelete this.callbacks[url];\n\t\tlet args = status == 200 || status == 0 ? [data] : [status, data];\n\t\tfor (let i = args.length - 1, n = callbacks.length; i < n; i += 2)\n\t\t\tcallbacks[i].apply(null, args);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { EventData } from \"./EventData.js\";\n\n/** Stores the current pose values for an {@link Event}.\n *\n * See Timeline {@link Timeline#apply()},\n * AnimationStateListener {@link AnimationStateListener#event()}, and\n * [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */\nexport class Event {\n\tdata: EventData;\n\tintValue: number = 0;\n\tfloatValue: number = 0;\n\tstringValue: string | null = null;\n\ttime: number = 0;\n\tvolume: number = 0;\n\tbalance: number = 0;\n\n\tconstructor (time: number, data: EventData) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tthis.time = time;\n\t\tthis.data = data;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n/** Stores the setup pose values for an {@link Event}.\n *\n * See [Events](http://esotericsoftware.com/spine-events) in the Spine User Guide. */\nexport class EventData {\n\tname: string;\n\tintValue: number = 0;\n\tfloatValue: number = 0;\n\tstringValue: string | null = null;\n\taudioPath: string | null = null;\n\tvolume: number = 0;\n\tbalance: number = 0;\n\n\tconstructor (name: string) {\n\t\tthis.name = name;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { Inherit } from \"./BoneData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n/** Stores the current pose for an IK constraint. An IK constraint adjusts the rotation of 1 or 2 constrained bones so the tip of\n * the last bone is as close to the target bone as possible.\n *\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide. */\nexport class IkConstraint implements Updatable {\n\t/** The IK constraint's setup pose data. */\n\tdata: IkConstraintData;\n\n\t/** The bones that will be modified by this IK constraint. */\n\tbones: Array;\n\n\t/** The bone that is the IK target. */\n\ttarget: Bone;\n\n\t/** Controls the bend direction of the IK bones, either 1 or -1. */\n\tbendDirection = 0;\n\n\t/** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\n\tcompress = false;\n\n\t/** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\n\t * and the parent bone has local nonuniform scale, stretch is not applied. */\n\tstretch = false;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\n\tmix = 1;\n\n\t/** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\n\tsoftness = 0;\n\tactive = false;\n\n\tconstructor (data: IkConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findBone(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find bone ${data.target.name}`);\n\n\t\tthis.target = target;\n\t\tthis.mix = data.mix;\n\t\tthis.softness = data.softness;\n\t\tthis.bendDirection = data.bendDirection;\n\t\tthis.compress = data.compress;\n\t\tthis.stretch = data.stretch;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.mix = data.mix;\n\t\tthis.softness = data.softness;\n\t\tthis.bendDirection = data.bendDirection;\n\t\tthis.compress = data.compress;\n\t\tthis.stretch = data.stretch;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tif (this.mix == 0) return;\n\t\tlet target = this.target;\n\t\tlet bones = this.bones;\n\t\tswitch (bones.length) {\n\t\t\tcase 1:\n\t\t\t\tthis.apply1(bones[0], target.worldX, target.worldY, this.compress, this.stretch, this.data.uniform, this.mix);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tthis.apply2(bones[0], bones[1], target.worldX, target.worldY, this.bendDirection, this.stretch, this.data.uniform, this.softness, this.mix);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/** Applies 1 bone IK. The target is specified in the world coordinate system. */\n\tapply1 (bone: Bone, targetX: number, targetY: number, compress: boolean, stretch: boolean, uniform: boolean, alpha: number) {\n\t\tlet p = bone.parent;\n\t\tif (!p) throw new Error(\"IK bone must have parent.\");\n\t\tlet pa = p.a, pb = p.b, pc = p.c, pd = p.d;\n\t\tlet rotationIK = -bone.ashearX - bone.arotation, tx = 0, ty = 0;\n\n\t\tswitch (bone.inherit) {\n\t\t\tcase Inherit.OnlyTranslation:\n\t\t\t\ttx = (targetX - bone.worldX) * MathUtils.signum(bone.skeleton.scaleX);\n\t\t\t\tty = (targetY - bone.worldY) * MathUtils.signum(bone.skeleton.scaleY);\n\t\t\t\tbreak;\n\t\t\tcase Inherit.NoRotationOrReflection:\n\t\t\t\tlet s = Math.abs(pa * pd - pb * pc) / Math.max(0.0001, pa * pa + pc * pc);\n\t\t\t\tlet sa = pa / bone.skeleton.scaleX;\n\t\t\t\tlet sc = pc / bone.skeleton.scaleY;\n\t\t\t\tpb = -sc * s * bone.skeleton.scaleX;\n\t\t\t\tpd = sa * s * bone.skeleton.scaleY;\n\t\t\t\trotationIK += Math.atan2(sc, sa) * MathUtils.radDeg;\n\t\t\t// Fall through\n\t\t\tdefault:\n\t\t\t\tlet x = targetX - p.worldX, y = targetY - p.worldY;\n\t\t\t\tlet d = pa * pd - pb * pc;\n\t\t\t\tif (Math.abs(d) <= 0.0001) {\n\t\t\t\t\ttx = 0;\n\t\t\t\t\tty = 0;\n\t\t\t\t} else {\n\t\t\t\t\ttx = (x * pd - y * pb) / d - bone.ax;\n\t\t\t\t\tty = (y * pa - x * pc) / d - bone.ay;\n\t\t\t\t}\n\t\t}\n\t\trotationIK += Math.atan2(ty, tx) * MathUtils.radDeg;\n\t\tif (bone.ascaleX < 0) rotationIK += 180;\n\t\tif (rotationIK > 180)\n\t\t\trotationIK -= 360;\n\t\telse if (rotationIK < -180)\n\t\t\trotationIK += 360;\n\t\tlet sx = bone.ascaleX, sy = bone.ascaleY;\n\t\tif (compress || stretch) {\n\t\t\tswitch (bone.inherit) {\n\t\t\t\tcase Inherit.NoScale:\n\t\t\t\tcase Inherit.NoScaleOrReflection:\n\t\t\t\t\ttx = targetX - bone.worldX;\n\t\t\t\t\tty = targetY - bone.worldY;\n\t\t\t}\n\t\t\tconst b = bone.data.length * sx;\n\t\t\tif (b > 0.0001) {\n\t\t\t\tconst dd = tx * tx + ty * ty;\n\t\t\t\tif ((compress && dd < b * b) || (stretch && dd > b * b)) {\n\t\t\t\t\tconst s = (Math.sqrt(dd) / b - 1) * alpha + 1;\n\t\t\t\t\tsx *= s;\n\t\t\t\t\tif (uniform) sy *= s;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tbone.updateWorldTransformWith(bone.ax, bone.ay, bone.arotation + rotationIK * alpha, sx, sy, bone.ashearX,\n\t\t\tbone.ashearY);\n\t}\n\n\t/** Applies 2 bone IK. The target is specified in the world coordinate system.\n\t * @param child A direct descendant of the parent bone. */\n\tapply2 (parent: Bone, child: Bone, targetX: number, targetY: number, bendDir: number, stretch: boolean, uniform: boolean, softness: number, alpha: number) {\n\t\tif (parent.inherit != Inherit.Normal || child.inherit != Inherit.Normal) return;\n\t\tlet px = parent.ax, py = parent.ay, psx = parent.ascaleX, psy = parent.ascaleY, sx = psx, sy = psy, csx = child.ascaleX;\n\t\tlet os1 = 0, os2 = 0, s2 = 0;\n\t\tif (psx < 0) {\n\t\t\tpsx = -psx;\n\t\t\tos1 = 180;\n\t\t\ts2 = -1;\n\t\t} else {\n\t\t\tos1 = 0;\n\t\t\ts2 = 1;\n\t\t}\n\t\tif (psy < 0) {\n\t\t\tpsy = -psy;\n\t\t\ts2 = -s2;\n\t\t}\n\t\tif (csx < 0) {\n\t\t\tcsx = -csx;\n\t\t\tos2 = 180;\n\t\t} else\n\t\t\tos2 = 0;\n\t\tlet cx = child.ax, cy = 0, cwx = 0, cwy = 0, a = parent.a, b = parent.b, c = parent.c, d = parent.d;\n\t\tlet u = Math.abs(psx - psy) <= 0.0001;\n\t\tif (!u || stretch) {\n\t\t\tcy = 0;\n\t\t\tcwx = a * cx + parent.worldX;\n\t\t\tcwy = c * cx + parent.worldY;\n\t\t} else {\n\t\t\tcy = child.ay;\n\t\t\tcwx = a * cx + b * cy + parent.worldX;\n\t\t\tcwy = c * cx + d * cy + parent.worldY;\n\t\t}\n\t\tlet pp = parent.parent;\n\t\tif (!pp) throw new Error(\"IK parent must itself have a parent.\");\n\t\ta = pp.a;\n\t\tb = pp.b;\n\t\tc = pp.c;\n\t\td = pp.d;\n\t\tlet id = a * d - b * c, x = cwx - pp.worldX, y = cwy - pp.worldY;\n\t\tid = Math.abs(id) <= 0.0001 ? 0 : 1 / id;\n\t\tlet dx = (x * d - y * b) * id - px, dy = (y * a - x * c) * id - py;\n\t\tlet l1 = Math.sqrt(dx * dx + dy * dy), l2 = child.data.length * csx, a1, a2;\n\t\tif (l1 < 0.0001) {\n\t\t\tthis.apply1(parent, targetX, targetY, false, stretch, false, alpha);\n\t\t\tchild.updateWorldTransformWith(cx, cy, 0, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n\t\t\treturn;\n\t\t}\n\t\tx = targetX - pp.worldX;\n\t\ty = targetY - pp.worldY;\n\t\tlet tx = (x * d - y * b) * id - px, ty = (y * a - x * c) * id - py;\n\t\tlet dd = tx * tx + ty * ty;\n\t\tif (softness != 0) {\n\t\t\tsoftness *= psx * (csx + 1) * 0.5;\n\t\t\tlet td = Math.sqrt(dd), sd = td - l1 - l2 * psx + softness;\n\t\t\tif (sd > 0) {\n\t\t\t\tlet p = Math.min(1, sd / (softness * 2)) - 1;\n\t\t\t\tp = (sd - softness * (1 - p * p)) / td;\n\t\t\t\ttx -= p * tx;\n\t\t\t\tty -= p * ty;\n\t\t\t\tdd = tx * tx + ty * ty;\n\t\t\t}\n\t\t}\n\t\touter:\n\t\tif (u) {\n\t\t\tl2 *= psx;\n\t\t\tlet cos = (dd - l1 * l1 - l2 * l2) / (2 * l1 * l2);\n\t\t\tif (cos < -1) {\n\t\t\t\tcos = -1;\n\t\t\t\ta2 = Math.PI * bendDir;\n\t\t\t} else if (cos > 1) {\n\t\t\t\tcos = 1;\n\t\t\t\ta2 = 0;\n\t\t\t\tif (stretch) {\n\t\t\t\t\ta = (Math.sqrt(dd) / (l1 + l2) - 1) * alpha + 1;\n\t\t\t\t\tsx *= a;\n\t\t\t\t\tif (uniform) sy *= a;\n\t\t\t\t}\n\t\t\t} else\n\t\t\t\ta2 = Math.acos(cos) * bendDir;\n\t\t\ta = l1 + l2 * cos;\n\t\t\tb = l2 * Math.sin(a2);\n\t\t\ta1 = Math.atan2(ty * a - tx * b, tx * a + ty * b);\n\t\t} else {\n\t\t\ta = psx * l2;\n\t\t\tb = psy * l2;\n\t\t\tlet aa = a * a, bb = b * b, ta = Math.atan2(ty, tx);\n\t\t\tc = bb * l1 * l1 + aa * dd - aa * bb;\n\t\t\tlet c1 = -2 * bb * l1, c2 = bb - aa;\n\t\t\td = c1 * c1 - 4 * c2 * c;\n\t\t\tif (d >= 0) {\n\t\t\t\tlet q = Math.sqrt(d);\n\t\t\t\tif (c1 < 0) q = -q;\n\t\t\t\tq = -(c1 + q) * 0.5;\n\t\t\t\tlet r0 = q / c2, r1 = c / q;\n\t\t\t\tlet r = Math.abs(r0) < Math.abs(r1) ? r0 : r1;\n\t\t\t\tr0 = dd - r * r;\n\t\t\t\tif (r0 >= 0) {\n\t\t\t\t\ty = Math.sqrt(r0) * bendDir;\n\t\t\t\t\ta1 = ta - Math.atan2(y, r);\n\t\t\t\t\ta2 = Math.atan2(y / psy, (r - l1) / psx);\n\t\t\t\t\tbreak outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet minAngle = MathUtils.PI, minX = l1 - a, minDist = minX * minX, minY = 0;\n\t\t\tlet maxAngle = 0, maxX = l1 + a, maxDist = maxX * maxX, maxY = 0;\n\t\t\tc = -a * l1 / (aa - bb);\n\t\t\tif (c >= -1 && c <= 1) {\n\t\t\t\tc = Math.acos(c);\n\t\t\t\tx = a * Math.cos(c) + l1;\n\t\t\t\ty = b * Math.sin(c);\n\t\t\t\td = x * x + y * y;\n\t\t\t\tif (d < minDist) {\n\t\t\t\t\tminAngle = c;\n\t\t\t\t\tminDist = d;\n\t\t\t\t\tminX = x;\n\t\t\t\t\tminY = y;\n\t\t\t\t}\n\t\t\t\tif (d > maxDist) {\n\t\t\t\t\tmaxAngle = c;\n\t\t\t\t\tmaxDist = d;\n\t\t\t\t\tmaxX = x;\n\t\t\t\t\tmaxY = y;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (dd <= (minDist + maxDist) * 0.5) {\n\t\t\t\ta1 = ta - Math.atan2(minY * bendDir, minX);\n\t\t\t\ta2 = minAngle * bendDir;\n\t\t\t} else {\n\t\t\t\ta1 = ta - Math.atan2(maxY * bendDir, maxX);\n\t\t\t\ta2 = maxAngle * bendDir;\n\t\t\t}\n\t\t}\n\t\tlet os = Math.atan2(cy, cx) * s2;\n\t\tlet rotation = parent.arotation;\n\t\ta1 = (a1 - os) * MathUtils.radDeg + os1 - rotation;\n\t\tif (a1 > 180)\n\t\t\ta1 -= 360;\n\t\telse if (a1 < -180) //\n\t\t\ta1 += 360;\n\t\tparent.updateWorldTransformWith(px, py, rotation + a1 * alpha, sx, sy, 0, 0);\n\t\trotation = child.arotation;\n\t\ta2 = ((a2 + os) * MathUtils.radDeg - child.ashearX) * s2 + os2 - rotation;\n\t\tif (a2 > 180)\n\t\t\ta2 -= 360;\n\t\telse if (a2 < -180) //\n\t\t\ta2 += 360;\n\t\tchild.updateWorldTransformWith(cx, cy, rotation + a2 * alpha, child.ascaleX, child.ascaleY, child.ashearX, child.ashearY);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\n\n\n/** Stores the setup pose for an {@link IkConstraint}.\n *

\n * See [IK constraints](http://esotericsoftware.com/spine-ik-constraints) in the Spine User Guide. */\nexport class IkConstraintData extends ConstraintData {\n\t/** The bones that are constrained by this IK constraint. */\n\tbones = new Array();\n\n\t/** The bone that is the IK target. */\n\tprivate _target: BoneData | null = null;\n\tpublic set target (boneData: BoneData) { this._target = boneData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"BoneData not set.\")\n\t\telse return this._target;\n\t}\n\n\t/** Controls the bend direction of the IK bones, either 1 or -1. */\n\tbendDirection = 0;\n\n\t/** When true and only a single bone is being constrained, if the target is too close, the bone is scaled to reach it. */\n\tcompress = false;\n\n\t/** When true, if the target is out of range, the parent bone is scaled to reach it. If more than one bone is being constrained\n\t * and the parent bone has local nonuniform scale, stretch is not applied. */\n\tstretch = false;\n\n\t/** When true, only a single bone is being constrained, and {@link #getCompress()} or {@link #getStretch()} is used, the bone\n\t * is scaled on both the X and Y axes. */\n\tuniform = false;\n\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained rotations. */\n\tmix = 0;\n\n\t/** For two bone IK, the distance from the maximum reach of the bones that rotation will slow. */\n\tsoftness = 0;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { SlotData } from \"./SlotData.js\";\n\n\n/** Stores the setup pose for a {@link PathConstraint}.\n *\n * See [path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide. */\nexport class PathConstraintData extends ConstraintData {\n\n\t/** The bones that will be modified by this path constraint. */\n\tbones = new Array();\n\n\t/** The slot whose path attachment will be used to constrained the bones. */\n\tprivate _target: SlotData | null = null;\n\tpublic set target (slotData: SlotData) { this._target = slotData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"SlotData not set.\")\n\t\telse return this._target;\n\t}\n\n\t/** The mode for positioning the first bone on the path. */\n\tpositionMode: PositionMode = PositionMode.Fixed;\n\n\t/** The mode for positioning the bones after the first bone on the path. */\n\tspacingMode: SpacingMode = SpacingMode.Fixed;\n\n\t/** The mode for adjusting the rotation of the bones. */\n\trotateMode: RotateMode = RotateMode.Chain;\n\n\t/** An offset added to the constrained bone rotation. */\n\toffsetRotation: number = 0;\n\n\t/** The position along the path. */\n\tposition: number = 0;\n\n\t/** The spacing between bones. */\n\tspacing: number = 0;\n\n\tmixRotate = 0;\n\tmixX = 0;\n\tmixY = 0;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n\n/** Controls how the first bone is positioned along the path.\n *\n * See [position](http://esotericsoftware.com/spine-path-constraints#Position) in the Spine User Guide. */\nexport enum PositionMode { Fixed, Percent }\n\n/** Controls how bones after the first bone are positioned along the path.\n *\n * See [spacing](http://esotericsoftware.com/spine-path-constraints#Spacing) in the Spine User Guide. */\nexport enum SpacingMode { Length, Fixed, Percent, Proportional }\n\n/** Controls how bones are rotated, translated, and scaled to match the path.\n *\n * See [rotate mix](http://esotericsoftware.com/spine-path-constraints#Rotate-mix) in the Spine User Guide. */\nexport enum RotateMode { Tangent, Chain, ChainScale }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { PathConstraintData, RotateMode, SpacingMode, PositionMode } from \"./PathConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Slot } from \"./Slot.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Utils, MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a path constraint. A path constraint adjusts the rotation, translation, and scale of the\n * constrained bones so they follow a {@link PathAttachment}.\n *\n * See [Path constraints](http://esotericsoftware.com/spine-path-constraints) in the Spine User Guide. */\nexport class PathConstraint implements Updatable {\n\tstatic NONE = -1; static BEFORE = -2; static AFTER = -3;\n\tstatic epsilon = 0.00001;\n\n\t/** The path constraint's setup pose data. */\n\tdata: PathConstraintData;\n\n\t/** The bones that will be modified by this path constraint. */\n\tbones: Array;\n\n\t/** The slot whose path attachment will be used to constrained the bones. */\n\ttarget: Slot;\n\n\t/** The position along the path. */\n\tposition = 0;\n\n\t/** The spacing between bones. */\n\tspacing = 0;\n\n\tmixRotate = 0;\n\n\tmixX = 0;\n\n\tmixY = 0;\n\n\tspaces = new Array(); positions = new Array();\n\tworld = new Array(); curves = new Array(); lengths = new Array();\n\tsegments = new Array();\n\n\tactive = false;\n\n\tconstructor (data: PathConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array();\n\t\tfor (let i = 0, n = data.bones.length; i < n; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}.`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findSlot(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find target bone ${data.target.name}`);\n\t\tthis.target = target;\n\n\t\tthis.position = data.position;\n\t\tthis.spacing = data.spacing;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.position = data.position;\n\t\tthis.spacing = data.spacing;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tlet attachment = this.target.getAttachment();\n\t\tif (!(attachment instanceof PathAttachment)) return;\n\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY;\n\t\tif (mixRotate == 0 && mixX == 0 && mixY == 0) return;\n\n\t\tlet data = this.data;\n\t\tlet tangents = data.rotateMode == RotateMode.Tangent, scale = data.rotateMode == RotateMode.ChainScale;\n\n\t\tlet bones = this.bones;\n\t\tlet boneCount = bones.length, spacesCount = tangents ? boneCount : boneCount + 1;\n\t\tlet spaces = Utils.setArraySize(this.spaces, spacesCount), lengths: Array = scale ? this.lengths = Utils.setArraySize(this.lengths, boneCount) : [];\n\t\tlet spacing = this.spacing;\n\n\t\tswitch (data.spacingMode) {\n\t\t\tcase SpacingMode.Percent:\n\t\t\t\tif (scale) {\n\t\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n; i++) {\n\t\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlengths[i] = Math.sqrt(x * x + y * y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tUtils.arrayFill(spaces, 1, spacesCount, spacing);\n\t\t\t\tbreak;\n\t\t\tcase SpacingMode.Proportional:\n\t\t\t\tlet sum = 0;\n\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n;) {\n\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\n\t\t\t\t\t\tif (scale) lengths[i] = 0;\n\t\t\t\t\t\tspaces[++i] = spacing;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlet length = Math.sqrt(x * x + y * y);\n\t\t\t\t\t\tif (scale) lengths[i] = length;\n\t\t\t\t\t\tspaces[++i] = length;\n\t\t\t\t\t\tsum += length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (sum > 0) {\n\t\t\t\t\tsum = spacesCount / sum * spacing;\n\t\t\t\t\tfor (let i = 1; i < spacesCount; i++)\n\t\t\t\t\t\tspaces[i] *= sum;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlet lengthSpacing = data.spacingMode == SpacingMode.Length;\n\t\t\t\tfor (let i = 0, n = spacesCount - 1; i < n;) {\n\t\t\t\t\tlet bone = bones[i];\n\t\t\t\t\tlet setupLength = bone.data.length;\n\t\t\t\t\tif (setupLength < PathConstraint.epsilon) {\n\t\t\t\t\t\tif (scale) lengths[i] = 0;\n\t\t\t\t\t\tspaces[++i] = spacing;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet x = setupLength * bone.a, y = setupLength * bone.c;\n\t\t\t\t\t\tlet length = Math.sqrt(x * x + y * y);\n\t\t\t\t\t\tif (scale) lengths[i] = length;\n\t\t\t\t\t\tspaces[++i] = (lengthSpacing ? setupLength + spacing : spacing) * length / setupLength;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\t\tlet positions = this.computeWorldPositions(attachment, spacesCount, tangents);\n\t\tlet boneX = positions[0], boneY = positions[1], offsetRotation = data.offsetRotation;\n\t\tlet tip = false;\n\t\tif (offsetRotation == 0)\n\t\t\ttip = data.rotateMode == RotateMode.Chain;\n\t\telse {\n\t\t\ttip = false;\n\t\t\tlet p = this.target.bone;\n\t\t\toffsetRotation *= p.a * p.d - p.b * p.c > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\t}\n\t\tfor (let i = 0, p = 3; i < boneCount; i++, p += 3) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.worldX += (boneX - bone.worldX) * mixX;\n\t\t\tbone.worldY += (boneY - bone.worldY) * mixY;\n\t\t\tlet x = positions[p], y = positions[p + 1], dx = x - boneX, dy = y - boneY;\n\t\t\tif (scale) {\n\t\t\t\tlet length = lengths[i];\n\t\t\t\tif (length != 0) {\n\t\t\t\t\tlet s = (Math.sqrt(dx * dx + dy * dy) / length - 1) * mixRotate + 1;\n\t\t\t\t\tbone.a *= s;\n\t\t\t\t\tbone.c *= s;\n\t\t\t\t}\n\t\t\t}\n\t\t\tboneX = x;\n\t\t\tboneY = y;\n\t\t\tif (mixRotate > 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d, r = 0, cos = 0, sin = 0;\n\t\t\t\tif (tangents)\n\t\t\t\t\tr = positions[p - 1];\n\t\t\t\telse if (spaces[i + 1] == 0)\n\t\t\t\t\tr = positions[p + 2];\n\t\t\t\telse\n\t\t\t\t\tr = Math.atan2(dy, dx);\n\t\t\t\tr -= Math.atan2(c, a);\n\t\t\t\tif (tip) {\n\t\t\t\t\tcos = Math.cos(r);\n\t\t\t\t\tsin = Math.sin(r);\n\t\t\t\t\tlet length = bone.data.length;\n\t\t\t\t\tboneX += (length * (cos * a - sin * c) - dx) * mixRotate;\n\t\t\t\t\tboneY += (length * (sin * a + cos * c) - dy) * mixRotate;\n\t\t\t\t} else {\n\t\t\t\t\tr += offsetRotation;\n\t\t\t\t}\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tcos = Math.cos(r);\n\t\t\t\tsin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tcomputeWorldPositions (path: PathAttachment, spacesCount: number, tangents: boolean) {\n\t\tlet target = this.target;\n\t\tlet position = this.position;\n\t\tlet spaces = this.spaces, out = Utils.setArraySize(this.positions, spacesCount * 3 + 2), world: Array = this.world;\n\t\tlet closed = path.closed;\n\t\tlet verticesLength = path.worldVerticesLength, curveCount = verticesLength / 6, prevCurve = PathConstraint.NONE;\n\n\t\tif (!path.constantSpeed) {\n\t\t\tlet lengths = path.lengths;\n\t\t\tcurveCount -= closed ? 1 : 2;\n\t\t\tlet pathLength = lengths[curveCount];\n\t\t\tif (this.data.positionMode == PositionMode.Percent) position *= pathLength;\n\n\t\t\tlet multiplier;\n\t\t\tswitch (this.data.spacingMode) {\n\t\t\t\tcase SpacingMode.Percent:\n\t\t\t\t\tmultiplier = pathLength;\n\t\t\t\t\tbreak;\n\t\t\t\tcase SpacingMode.Proportional:\n\t\t\t\t\tmultiplier = pathLength / spacesCount;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tmultiplier = 1;\n\t\t\t}\n\t\t\tworld = Utils.setArraySize(this.world, 8);\n\t\t\tfor (let i = 0, o = 0, curve = 0; i < spacesCount; i++, o += 3) {\n\t\t\t\tlet space = spaces[i] * multiplier;\n\t\t\t\tposition += space;\n\t\t\t\tlet p = position;\n\n\t\t\t\tif (closed) {\n\t\t\t\t\tp %= pathLength;\n\t\t\t\t\tif (p < 0) p += pathLength;\n\t\t\t\t\tcurve = 0;\n\t\t\t\t} else if (p < 0) {\n\t\t\t\t\tif (prevCurve != PathConstraint.BEFORE) {\n\t\t\t\t\t\tprevCurve = PathConstraint.BEFORE;\n\t\t\t\t\t\tpath.computeWorldVertices(target, 2, 4, world, 0, 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (p > pathLength) {\n\t\t\t\t\tif (prevCurve != PathConstraint.AFTER) {\n\t\t\t\t\t\tprevCurve = PathConstraint.AFTER;\n\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 6, 4, world, 0, 2);\n\t\t\t\t\t}\n\t\t\t\t\tthis.addAfterPosition(p - pathLength, world, 0, out, o);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Determine curve containing position.\n\t\t\t\tfor (; ; curve++) {\n\t\t\t\t\tlet length = lengths[curve];\n\t\t\t\t\tif (p > length) continue;\n\t\t\t\t\tif (curve == 0)\n\t\t\t\t\t\tp /= length;\n\t\t\t\t\telse {\n\t\t\t\t\t\tlet prev = lengths[curve - 1];\n\t\t\t\t\t\tp = (p - prev) / (length - prev);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (curve != prevCurve) {\n\t\t\t\t\tprevCurve = curve;\n\t\t\t\t\tif (closed && curve == curveCount) {\n\t\t\t\t\t\tpath.computeWorldVertices(target, verticesLength - 4, 4, world, 0, 2);\n\t\t\t\t\t\tpath.computeWorldVertices(target, 0, 4, world, 4, 2);\n\t\t\t\t\t} else\n\t\t\t\t\t\tpath.computeWorldVertices(target, curve * 6 + 2, 8, world, 0, 2);\n\t\t\t\t}\n\t\t\t\tthis.addCurvePosition(p, world[0], world[1], world[2], world[3], world[4], world[5], world[6], world[7], out, o,\n\t\t\t\t\ttangents || (i > 0 && space == 0));\n\t\t\t}\n\t\t\treturn out;\n\t\t}\n\n\t\t// World vertices.\n\t\tif (closed) {\n\t\t\tverticesLength += 2;\n\t\t\tworld = Utils.setArraySize(this.world, verticesLength);\n\t\t\tpath.computeWorldVertices(target, 2, verticesLength - 4, world, 0, 2);\n\t\t\tpath.computeWorldVertices(target, 0, 2, world, verticesLength - 4, 2);\n\t\t\tworld[verticesLength - 2] = world[0];\n\t\t\tworld[verticesLength - 1] = world[1];\n\t\t} else {\n\t\t\tcurveCount--;\n\t\t\tverticesLength -= 4;\n\t\t\tworld = Utils.setArraySize(this.world, verticesLength);\n\t\t\tpath.computeWorldVertices(target, 2, verticesLength, world, 0, 2);\n\t\t}\n\n\t\t// Curve lengths.\n\t\tlet curves = Utils.setArraySize(this.curves, curveCount);\n\t\tlet pathLength = 0;\n\t\tlet x1 = world[0], y1 = world[1], cx1 = 0, cy1 = 0, cx2 = 0, cy2 = 0, x2 = 0, y2 = 0;\n\t\tlet tmpx = 0, tmpy = 0, dddfx = 0, dddfy = 0, ddfx = 0, ddfy = 0, dfx = 0, dfy = 0;\n\t\tfor (let i = 0, w = 2; i < curveCount; i++, w += 6) {\n\t\t\tcx1 = world[w];\n\t\t\tcy1 = world[w + 1];\n\t\t\tcx2 = world[w + 2];\n\t\t\tcy2 = world[w + 3];\n\t\t\tx2 = world[w + 4];\n\t\t\ty2 = world[w + 5];\n\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.1875;\n\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.1875;\n\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.09375;\n\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.09375;\n\t\t\tddfx = tmpx * 2 + dddfx;\n\t\t\tddfy = tmpy * 2 + dddfy;\n\t\t\tdfx = (cx1 - x1) * 0.75 + tmpx + dddfx * 0.16666667;\n\t\t\tdfy = (cy1 - y1) * 0.75 + tmpy + dddfy * 0.16666667;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tddfx += dddfx;\n\t\t\tddfy += dddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tdfx += ddfx + dddfx;\n\t\t\tdfy += ddfy + dddfy;\n\t\t\tpathLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\tcurves[i] = pathLength;\n\t\t\tx1 = x2;\n\t\t\ty1 = y2;\n\t\t}\n\n\t\tif (this.data.positionMode == PositionMode.Percent) position *= pathLength;\n\n\t\tlet multiplier;\n\t\tswitch (this.data.spacingMode) {\n\t\t\tcase SpacingMode.Percent:\n\t\t\t\tmultiplier = pathLength;\n\t\t\t\tbreak;\n\t\t\tcase SpacingMode.Proportional:\n\t\t\t\tmultiplier = pathLength / spacesCount;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tmultiplier = 1;\n\t\t}\n\n\t\tlet segments = this.segments;\n\t\tlet curveLength = 0;\n\t\tfor (let i = 0, o = 0, curve = 0, segment = 0; i < spacesCount; i++, o += 3) {\n\t\t\tlet space = spaces[i] * multiplier;\n\t\t\tposition += space;\n\t\t\tlet p = position;\n\n\t\t\tif (closed) {\n\t\t\t\tp %= pathLength;\n\t\t\t\tif (p < 0) p += pathLength;\n\t\t\t\tcurve = 0;\n\t\t\t} else if (p < 0) {\n\t\t\t\tthis.addBeforePosition(p, world, 0, out, o);\n\t\t\t\tcontinue;\n\t\t\t} else if (p > pathLength) {\n\t\t\t\tthis.addAfterPosition(p - pathLength, world, verticesLength - 4, out, o);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Determine curve containing position.\n\t\t\tfor (; ; curve++) {\n\t\t\t\tlet length = curves[curve];\n\t\t\t\tif (p > length) continue;\n\t\t\t\tif (curve == 0)\n\t\t\t\t\tp /= length;\n\t\t\t\telse {\n\t\t\t\t\tlet prev = curves[curve - 1];\n\t\t\t\t\tp = (p - prev) / (length - prev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Curve segment lengths.\n\t\t\tif (curve != prevCurve) {\n\t\t\t\tprevCurve = curve;\n\t\t\t\tlet ii = curve * 6;\n\t\t\t\tx1 = world[ii];\n\t\t\t\ty1 = world[ii + 1];\n\t\t\t\tcx1 = world[ii + 2];\n\t\t\t\tcy1 = world[ii + 3];\n\t\t\t\tcx2 = world[ii + 4];\n\t\t\t\tcy2 = world[ii + 5];\n\t\t\t\tx2 = world[ii + 6];\n\t\t\t\ty2 = world[ii + 7];\n\t\t\t\ttmpx = (x1 - cx1 * 2 + cx2) * 0.03;\n\t\t\t\ttmpy = (y1 - cy1 * 2 + cy2) * 0.03;\n\t\t\t\tdddfx = ((cx1 - cx2) * 3 - x1 + x2) * 0.006;\n\t\t\t\tdddfy = ((cy1 - cy2) * 3 - y1 + y2) * 0.006;\n\t\t\t\tddfx = tmpx * 2 + dddfx;\n\t\t\t\tddfy = tmpy * 2 + dddfy;\n\t\t\t\tdfx = (cx1 - x1) * 0.3 + tmpx + dddfx * 0.16666667;\n\t\t\t\tdfy = (cy1 - y1) * 0.3 + tmpy + dddfy * 0.16666667;\n\t\t\t\tcurveLength = Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[0] = curveLength;\n\t\t\t\tfor (ii = 1; ii < 8; ii++) {\n\t\t\t\t\tdfx += ddfx;\n\t\t\t\t\tdfy += ddfy;\n\t\t\t\t\tddfx += dddfx;\n\t\t\t\t\tddfy += dddfy;\n\t\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\t\tsegments[ii] = curveLength;\n\t\t\t\t}\n\t\t\t\tdfx += ddfx;\n\t\t\t\tdfy += ddfy;\n\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[8] = curveLength;\n\t\t\t\tdfx += ddfx + dddfx;\n\t\t\t\tdfy += ddfy + dddfy;\n\t\t\t\tcurveLength += Math.sqrt(dfx * dfx + dfy * dfy);\n\t\t\t\tsegments[9] = curveLength;\n\t\t\t\tsegment = 0;\n\t\t\t}\n\n\t\t\t// Weight by segment length.\n\t\t\tp *= curveLength;\n\t\t\tfor (; ; segment++) {\n\t\t\t\tlet length = segments[segment];\n\t\t\t\tif (p > length) continue;\n\t\t\t\tif (segment == 0)\n\t\t\t\t\tp /= length;\n\t\t\t\telse {\n\t\t\t\t\tlet prev = segments[segment - 1];\n\t\t\t\t\tp = segment + (p - prev) / (length - prev);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tthis.addCurvePosition(p * 0.1, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, o, tangents || (i > 0 && space == 0));\n\t\t}\n\t\treturn out;\n\t}\n\n\taddBeforePosition (p: number, temp: Array, i: number, out: Array, o: number) {\n\t\tlet x1 = temp[i], y1 = temp[i + 1], dx = temp[i + 2] - x1, dy = temp[i + 3] - y1, r = Math.atan2(dy, dx);\n\t\tout[o] = x1 + p * Math.cos(r);\n\t\tout[o + 1] = y1 + p * Math.sin(r);\n\t\tout[o + 2] = r;\n\t}\n\n\taddAfterPosition (p: number, temp: Array, i: number, out: Array, o: number) {\n\t\tlet x1 = temp[i + 2], y1 = temp[i + 3], dx = x1 - temp[i], dy = y1 - temp[i + 1], r = Math.atan2(dy, dx);\n\t\tout[o] = x1 + p * Math.cos(r);\n\t\tout[o + 1] = y1 + p * Math.sin(r);\n\t\tout[o + 2] = r;\n\t}\n\n\taddCurvePosition (p: number, x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number,\n\t\tout: Array, o: number, tangents: boolean) {\n\t\tif (p == 0 || isNaN(p)) {\n\t\t\tout[o] = x1;\n\t\t\tout[o + 1] = y1;\n\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n\t\t\treturn;\n\t\t}\n\t\tlet tt = p * p, ttt = tt * p, u = 1 - p, uu = u * u, uuu = uu * u;\n\t\tlet ut = u * p, ut3 = ut * 3, uut3 = u * ut3, utt3 = ut3 * p;\n\t\tlet x = x1 * uuu + cx1 * uut3 + cx2 * utt3 + x2 * ttt, y = y1 * uuu + cy1 * uut3 + cy2 * utt3 + y2 * ttt;\n\t\tout[o] = x;\n\t\tout[o + 1] = y;\n\t\tif (tangents) {\n\t\t\tif (p < 0.001)\n\t\t\t\tout[o + 2] = Math.atan2(cy1 - y1, cx1 - x1);\n\t\t\telse\n\t\t\t\tout[o + 2] = Math.atan2(y - (y1 * uu + cy1 * ut * 2 + cy2 * tt), x - (x1 * uu + cx1 * ut * 2 + cx2 * tt));\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a physics constraint. A physics constraint applies physics to bones.\n *

\n * See Physics constraints in the Spine User Guide. */\nexport class PhysicsConstraint implements Updatable {\n\treadonly data: PhysicsConstraintData;\n\tprivate _bone: Bone | null = null;\n\t/** The bone constrained by this physics constraint. */\n\tpublic set bone (bone: Bone) { this._bone = bone; }\n\tpublic get bone () {\n\t\tif (!this._bone) throw new Error(\"Bone not set.\")\n\t\telse return this._bone;\n\t}\n\tinertia = 0;\n\tstrength = 0;\n\tdamping = 0;\n\tmassInverse = 0;\n\twind = 0;\n\tgravity = 0;\n\tmix = 0;\n\n\t_reset = true;\n\tux = 0;\n\tuy = 0;\n\tcx = 0;\n\tcy = 0;\n\ttx = 0;\n\tty = 0;\n\txOffset = 0;\n\txVelocity = 0;\n\tyOffset = 0;\n\tyVelocity = 0;\n\trotateOffset = 0;\n\trotateVelocity = 0;\n\tscaleOffset = 0\n\tscaleVelocity = 0;\n\n\tactive = false;\n\n\treadonly skeleton: Skeleton;\n\tremaining = 0;\n\tlastTime = 0;\n\n\tconstructor (data: PhysicsConstraintData, skeleton: Skeleton) {\n\t\tthis.data = data;\n\t\tthis.skeleton = skeleton;\n\n\t\tthis.bone = skeleton.bones[data.bone.index];\n\n\t\tthis.inertia = data.inertia;\n\t\tthis.strength = data.strength;\n\t\tthis.damping = data.damping;\n\t\tthis.massInverse = data.massInverse;\n\t\tthis.wind = data.wind;\n\t\tthis.gravity = data.gravity;\n\t\tthis.mix = data.mix;\n\t}\n\n\treset () {\n\t\tthis.remaining = 0;\n\t\tthis.lastTime = this.skeleton.time;\n\t\tthis._reset = true;\n\t\tthis.xOffset = 0;\n\t\tthis.xVelocity = 0;\n\t\tthis.yOffset = 0;\n\t\tthis.yVelocity = 0;\n\t\tthis.rotateOffset = 0;\n\t\tthis.rotateVelocity = 0;\n\t\tthis.scaleOffset = 0;\n\t\tthis.scaleVelocity = 0;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.inertia = data.inertia;\n\t\tthis.strength = data.strength;\n\t\tthis.damping = data.damping;\n\t\tthis.massInverse = data.massInverse;\n\t\tthis.wind = data.wind;\n\t\tthis.gravity = data.gravity;\n\t\tthis.mix = data.mix;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\t/** Applies the constraint to the constrained bones. */\n\tupdate (physics: Physics) {\n\t\tconst mix = this.mix;\n\t\tif (mix == 0) return;\n\n\t\tconst x = this.data.x > 0, y = this.data.y > 0, rotateOrShearX = this.data.rotate > 0 || this.data.shearX > 0, scaleX = this.data.scaleX > 0;\n\t\tconst bone = this.bone;\n\t\tconst l = bone.data.length;\n\n\t\tswitch (physics) {\n\t\t\tcase Physics.none:\n\t\t\t\treturn;\n\t\t\tcase Physics.reset:\n\t\t\t\tthis.reset();\n\t\t\t// Fall through.\n\t\t\tcase Physics.update:\n\t\t\t\tconst skeleton = this.skeleton;\n\t\t\t\tconst delta = Math.max(this.skeleton.time - this.lastTime, 0);\n\t\t\t\tthis.remaining += delta;\n\t\t\t\tthis.lastTime = skeleton.time;\n\n\t\t\t\tconst bx = bone.worldX, by = bone.worldY;\n\t\t\t\tif (this._reset) {\n\t\t\t\t\tthis._reset = false;\n\t\t\t\t\tthis.ux = bx;\n\t\t\t\t\tthis.uy = by;\n\t\t\t\t} else {\n\t\t\t\t\tlet a = this.remaining, i = this.inertia, t = this.data.step, f = this.skeleton.data.referenceScale, d = -1;\n\t\t\t\t\tlet qx = this.data.limit * delta, qy = qx * Math.abs(skeleton.scaleY);\n\t\t\t\t\tqx *= Math.abs(skeleton.scaleX);\n\t\t\t\t\tif (x || y) {\n\t\t\t\t\t\tif (x) {\n\t\t\t\t\t\t\tconst u = (this.ux - bx) * i;\n\t\t\t\t\t\t\tthis.xOffset += u > qx ? qx : u < -qx ? -qx : u;\n\t\t\t\t\t\t\tthis.ux = bx;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (y) {\n\t\t\t\t\t\t\tconst u = (this.uy - by) * i;\n\t\t\t\t\t\t\tthis.yOffset += u > qy ? qy : u < -qy ? -qy : u;\n\t\t\t\t\t\t\tthis.uy = by;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (a >= t) {\n\t\t\t\t\t\t\td = Math.pow(this.damping, 60 * t);\n\t\t\t\t\t\t\tconst m = this.massInverse * t, e = this.strength, w = this.wind * f * skeleton.scaleX, g = this.gravity * f * skeleton.scaleY;\n\t\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t\tif (x) {\n\t\t\t\t\t\t\t\t\tthis.xVelocity += (w - this.xOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.xOffset += this.xVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.xVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (y) {\n\t\t\t\t\t\t\t\t\tthis.yVelocity -= (g + this.yOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.yOffset += this.yVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.yVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ta -= t;\n\t\t\t\t\t\t\t} while (a >= t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (x) bone.worldX += this.xOffset * mix * this.data.x;\n\t\t\t\t\t\tif (y) bone.worldY += this.yOffset * mix * this.data.y;\n\t\t\t\t\t}\n\t\t\t\t\tif (rotateOrShearX || scaleX) {\n\t\t\t\t\t\tlet ca = Math.atan2(bone.c, bone.a), c = 0, s = 0, mr = 0;\n\t\t\t\t\t\tlet dx = this.cx - bone.worldX, dy = this.cy - bone.worldY;\n\t\t\t\t\t\tif (dx > qx)\n\t\t\t\t\t\t\tdx = qx;\n\t\t\t\t\t\telse if (dx < -qx) //\n\t\t\t\t\t\t\tdx = -qx;\n\t\t\t\t\t\tif (dy > qy)\n\t\t\t\t\t\t\tdy = qy;\n\t\t\t\t\t\telse if (dy < -qy) //\n\t\t\t\t\t\t\tdy = -qy;\n\t\t\t\t\t\tif (rotateOrShearX) {\n\t\t\t\t\t\t\tmr = (this.data.rotate + this.data.shearX) * mix;\n\t\t\t\t\t\t\tlet r = Math.atan2(dy + this.ty, dx + this.tx) - ca - this.rotateOffset * mr;\n\t\t\t\t\t\t\tthis.rotateOffset += (r - Math.ceil(r * MathUtils.invPI2 - 0.5) * MathUtils.PI2) * i;\n\t\t\t\t\t\t\tr = this.rotateOffset * mr + ca;\n\t\t\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\t\t\tif (scaleX) {\n\t\t\t\t\t\t\t\tr = l * bone.getWorldScaleX();\n\t\t\t\t\t\t\t\tif (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tc = Math.cos(ca);\n\t\t\t\t\t\t\ts = Math.sin(ca);\n\t\t\t\t\t\t\tconst r = l * bone.getWorldScaleX();\n\t\t\t\t\t\t\tif (r > 0) this.scaleOffset += (dx * c + dy * s) * i / r;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ta = this.remaining;\n\t\t\t\t\t\tif (a >= t) {\n\t\t\t\t\t\t\tif (d == -1) d = Math.pow(this.damping, 60 * t);\n\t\t\t\t\t\t\tconst m = this.massInverse * t, e = this.strength, w = this.wind, g = (Skeleton.yDown ? -this.gravity : this.gravity), h = l / f;\n\t\t\t\t\t\t\twhile (true) {\n\t\t\t\t\t\t\t\ta -= t;\n\t\t\t\t\t\t\t\tif (scaleX) {\n\t\t\t\t\t\t\t\t\tthis.scaleVelocity += (w * c - g * s - this.scaleOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.scaleOffset += this.scaleVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.scaleVelocity *= d;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif (rotateOrShearX) {\n\t\t\t\t\t\t\t\t\tthis.rotateVelocity -= ((w * s + g * c) * h + this.rotateOffset * e) * m;\n\t\t\t\t\t\t\t\t\tthis.rotateOffset += this.rotateVelocity * t;\n\t\t\t\t\t\t\t\t\tthis.rotateVelocity *= d;\n\t\t\t\t\t\t\t\t\tif (a < t) break;\n\t\t\t\t\t\t\t\t\tconst r = this.rotateOffset * mr + ca;\n\t\t\t\t\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\t\t\t\t} else if (a < t) //\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tthis.remaining = a;\n\t\t\t\t}\n\t\t\t\tthis.cx = bone.worldX;\n\t\t\t\tthis.cy = bone.worldY;\n\t\t\t\tbreak;\n\t\t\tcase Physics.pose:\n\t\t\t\tif (x) bone.worldX += this.xOffset * mix * this.data.x;\n\t\t\t\tif (y) bone.worldY += this.yOffset * mix * this.data.y;\n\t\t}\n\n\t\tif (rotateOrShearX) {\n\t\t\tlet o = this.rotateOffset * mix, s = 0, c = 0, a = 0;\n\t\t\tif (this.data.shearX > 0) {\n\t\t\t\tlet r = 0;\n\t\t\t\tif (this.data.rotate > 0) {\n\t\t\t\t\tr = o * this.data.rotate;\n\t\t\t\t\ts = Math.sin(r);\n\t\t\t\t\tc = Math.cos(r);\n\t\t\t\t\ta = bone.b;\n\t\t\t\t\tbone.b = c * a - s * bone.d;\n\t\t\t\t\tbone.d = s * a + c * bone.d;\n\t\t\t\t}\n\t\t\t\tr += o * this.data.shearX;\n\t\t\t\ts = Math.sin(r);\n\t\t\t\tc = Math.cos(r);\n\t\t\t\ta = bone.a;\n\t\t\t\tbone.a = c * a - s * bone.c;\n\t\t\t\tbone.c = s * a + c * bone.c;\n\t\t\t} else {\n\t\t\t\to *= this.data.rotate;\n\t\t\t\ts = Math.sin(o);\n\t\t\t\tc = Math.cos(o);\n\t\t\t\ta = bone.a;\n\t\t\t\tbone.a = c * a - s * bone.c;\n\t\t\t\tbone.c = s * a + c * bone.c;\n\t\t\t\ta = bone.b;\n\t\t\t\tbone.b = c * a - s * bone.d;\n\t\t\t\tbone.d = s * a + c * bone.d;\n\t\t\t}\n\t\t}\n\t\tif (scaleX) {\n\t\t\tconst s = 1 + this.scaleOffset * mix * this.data.scaleX;\n\t\t\tbone.a *= s;\n\t\t\tbone.c *= s;\n\t\t}\n\t\tif (physics != Physics.pose) {\n\t\t\tthis.tx = l * bone.a;\n\t\t\tthis.ty = l * bone.c;\n\t\t}\n\t\tbone.updateAppliedTransform();\n\t}\n\n\t/** Translates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone moved an additional\n\t * amount in world space. */\n\ttranslate (x: number, y: number) {\n\t\tthis.ux -= x;\n\t\tthis.uy -= y;\n\t\tthis.cx -= x;\n\t\tthis.cy -= y;\n\t}\n\n\t/** Rotates the physics constraint so next {@link #update(Physics)} forces are applied as if the bone rotated around the\n\t * specified point in world space. */\n\trotate (x: number, y: number, degrees: number) {\n\t\tconst r = degrees * MathUtils.degRad, cos = Math.cos(r), sin = Math.sin(r);\n\t\tconst dx = this.cx - x, dy = this.cy - y;\n\t\tthis.translate(dx * cos - dy * sin - dx, dx * sin + dy * cos - dy);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment, VertexAttachment } from \"./attachments/Attachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { Color } from \"./Utils.js\";\n\n/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store\n * state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared\n * across multiple skeletons. */\nexport class Slot {\n\t/** The slot's setup pose data. */\n\tdata: SlotData;\n\n\t/** The bone this slot belongs to. */\n\tbone: Bone;\n\n\t/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two\n\t * color tinting. */\n\tcolor: Color;\n\n\t/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\n\t * color's alpha is not used. */\n\tdarkColor: Color | null = null;\n\n\tattachment: Attachment | null = null;\n\n\tattachmentState: number = 0;\n\n\t/** The index of the texture region to display when the slot's attachment has a {@link Sequence}. -1 represents the\n\t * {@link Sequence#getSetupIndex()}. */\n\tsequenceIndex: number = -1;\n\n\t/** Values to deform the slot's attachment. For an unweighted mesh, the entries are local positions for each vertex. For a\n\t * weighted mesh, the entries are an offset for each vertex which will be added to the mesh's local vertex positions.\n\t *\n\t * See {@link VertexAttachment#computeWorldVertices()} and {@link DeformTimeline}. */\n\tdeform = new Array();\n\n\tconstructor (data: SlotData, bone: Bone) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!bone) throw new Error(\"bone cannot be null.\");\n\t\tthis.data = data;\n\t\tthis.bone = bone;\n\t\tthis.color = new Color();\n\t\tthis.darkColor = !data.darkColor ? null : new Color();\n\t\tthis.setToSetupPose();\n\t}\n\n\t/** The skeleton this slot belongs to. */\n\tgetSkeleton (): Skeleton {\n\t\treturn this.bone.skeleton;\n\t}\n\n\t/** The current attachment for the slot, or null if the slot has no attachment. */\n\tgetAttachment (): Attachment | null {\n\t\treturn this.attachment;\n\t}\n\n\t/** Sets the slot's attachment and, if the attachment changed, resets {@link #sequenceIndex} and clears the {@link #deform}.\n\t * The deform is not cleared if the old attachment has the same {@link VertexAttachment#getTimelineAttachment()} as the\n\t * specified attachment. */\n\tsetAttachment (attachment: Attachment | null) {\n\t\tif (this.attachment == attachment) return;\n\t\tif (!(attachment instanceof VertexAttachment) || !(this.attachment instanceof VertexAttachment)\n\t\t\t|| (attachment).timelineAttachment != (this.attachment).timelineAttachment) {\n\t\t\tthis.deform.length = 0;\n\t\t}\n\t\tthis.attachment = attachment;\n\t\tthis.sequenceIndex = -1;\n\t}\n\n\t/** Sets this slot to the setup pose. */\n\tsetToSetupPose () {\n\t\tthis.color.setFromColor(this.data.color);\n\t\tif (this.darkColor) this.darkColor.setFromColor(this.data.darkColor!);\n\t\tif (!this.data.attachmentName)\n\t\t\tthis.attachment = null;\n\t\telse {\n\t\t\tthis.attachment = null;\n\t\t\tthis.setAttachment(this.bone.skeleton.getAttachment(this.data.index, this.data.attachmentName));\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Bone } from \"./Bone.js\";\nimport { Physics, Skeleton } from \"./Skeleton.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Vector2, MathUtils } from \"./Utils.js\";\n\n\n/** Stores the current pose for a transform constraint. A transform constraint adjusts the world transform of the constrained\n * bones to match that of the target bone.\n *\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */\nexport class TransformConstraint implements Updatable {\n\n\t/** The transform constraint's setup pose data. */\n\tdata: TransformConstraintData;\n\n\t/** The bones that will be modified by this transform constraint. */\n\tbones: Array;\n\n\t/** The target bone whose world transform will be copied to the constrained bones. */\n\ttarget: Bone;\n\n\tmixRotate = 0; mixX = 0; mixY = 0; mixScaleX = 0; mixScaleY = 0; mixShearY = 0;\n\n\ttemp = new Vector2();\n\tactive = false;\n\n\tconstructor (data: TransformConstraintData, skeleton: Skeleton) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet bone = skeleton.findBone(data.bones[i].name);\n\t\t\tif (!bone) throw new Error(`Couldn't find bone ${data.bones[i].name}.`);\n\t\t\tthis.bones.push(bone);\n\t\t}\n\t\tlet target = skeleton.findBone(data.target.name);\n\t\tif (!target) throw new Error(`Couldn't find target bone ${data.target.name}.`);\n\t\tthis.target = target;\n\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t\tthis.mixScaleX = data.mixScaleX;\n\t\tthis.mixScaleY = data.mixScaleY;\n\t\tthis.mixShearY = data.mixShearY;\n\t}\n\n\tisActive () {\n\t\treturn this.active;\n\t}\n\n\tsetToSetupPose () {\n\t\tconst data = this.data;\n\t\tthis.mixRotate = data.mixRotate;\n\t\tthis.mixX = data.mixX;\n\t\tthis.mixY = data.mixY;\n\t\tthis.mixScaleX = data.mixScaleX;\n\t\tthis.mixScaleY = data.mixScaleY;\n\t\tthis.mixShearY = data.mixShearY;\n\t}\n\n\tupdate (physics: Physics) {\n\t\tif (this.mixRotate == 0 && this.mixX == 0 && this.mixY == 0 && this.mixScaleX == 0 && this.mixScaleY == 0 && this.mixShearY == 0) return;\n\n\t\tif (this.data.local) {\n\t\t\tif (this.data.relative)\n\t\t\t\tthis.applyRelativeLocal();\n\t\t\telse\n\t\t\t\tthis.applyAbsoluteLocal();\n\t\t} else {\n\t\t\tif (this.data.relative)\n\t\t\t\tthis.applyRelativeWorld();\n\t\t\telse\n\t\t\t\tthis.applyAbsoluteWorld();\n\t\t}\n\t}\n\n\tapplyAbsoluteWorld () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\t\tlet translate = mixX != 0 || mixY != 0;\n\n\t\tlet target = this.target;\n\t\tlet ta = target.a, tb = target.b, tc = target.c, td = target.d;\n\t\tlet degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\tlet offsetRotation = this.data.offsetRotation * degRadReflect;\n\t\tlet offsetShearY = this.data.offsetShearY * degRadReflect;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tif (mixRotate != 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\t\tlet r = Math.atan2(tc, ta) - Math.atan2(c, a) + offsetRotation;\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tlet cos = Math.cos(r), sin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\n\t\t\tif (translate) {\n\t\t\t\tlet temp = this.temp;\n\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n\t\t\t\tbone.worldX += (temp.x - bone.worldX) * mixX;\n\t\t\t\tbone.worldY += (temp.y - bone.worldY) * mixY;\n\t\t\t}\n\n\t\t\tif (mixScaleX != 0) {\n\t\t\t\tlet s = Math.sqrt(bone.a * bone.a + bone.c * bone.c);\n\t\t\t\tif (s != 0) s = (s + (Math.sqrt(ta * ta + tc * tc) - s + this.data.offsetScaleX) * mixScaleX) / s;\n\t\t\t\tbone.a *= s;\n\t\t\t\tbone.c *= s;\n\t\t\t}\n\t\t\tif (mixScaleY != 0) {\n\t\t\t\tlet s = Math.sqrt(bone.b * bone.b + bone.d * bone.d);\n\t\t\t\tif (s != 0) s = (s + (Math.sqrt(tb * tb + td * td) - s + this.data.offsetScaleY) * mixScaleY) / s;\n\t\t\t\tbone.b *= s;\n\t\t\t\tbone.d *= s;\n\t\t\t}\n\n\t\t\tif (mixShearY > 0) {\n\t\t\t\tlet b = bone.b, d = bone.d;\n\t\t\t\tlet by = Math.atan2(d, b);\n\t\t\t\tlet r = Math.atan2(td, tb) - Math.atan2(tc, ta) - (by - Math.atan2(bone.c, bone.a));\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr = by + (r + offsetShearY) * mixShearY;\n\t\t\t\tlet s = Math.sqrt(b * b + d * d);\n\t\t\t\tbone.b = Math.cos(r) * s;\n\t\t\t\tbone.d = Math.sin(r) * s;\n\t\t\t}\n\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tapplyRelativeWorld () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\t\tlet translate = mixX != 0 || mixY != 0;\n\n\t\tlet target = this.target;\n\t\tlet ta = target.a, tb = target.b, tc = target.c, td = target.d;\n\t\tlet degRadReflect = ta * td - tb * tc > 0 ? MathUtils.degRad : -MathUtils.degRad;\n\t\tlet offsetRotation = this.data.offsetRotation * degRadReflect, offsetShearY = this.data.offsetShearY * degRadReflect;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tif (mixRotate != 0) {\n\t\t\t\tlet a = bone.a, b = bone.b, c = bone.c, d = bone.d;\n\t\t\t\tlet r = Math.atan2(tc, ta) + offsetRotation;\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tr *= mixRotate;\n\t\t\t\tlet cos = Math.cos(r), sin = Math.sin(r);\n\t\t\t\tbone.a = cos * a - sin * c;\n\t\t\t\tbone.b = cos * b - sin * d;\n\t\t\t\tbone.c = sin * a + cos * c;\n\t\t\t\tbone.d = sin * b + cos * d;\n\t\t\t}\n\n\t\t\tif (translate) {\n\t\t\t\tlet temp = this.temp;\n\t\t\t\ttarget.localToWorld(temp.set(this.data.offsetX, this.data.offsetY));\n\t\t\t\tbone.worldX += temp.x * mixX;\n\t\t\t\tbone.worldY += temp.y * mixY;\n\t\t\t}\n\n\t\t\tif (mixScaleX != 0) {\n\t\t\t\tlet s = (Math.sqrt(ta * ta + tc * tc) - 1 + this.data.offsetScaleX) * mixScaleX + 1;\n\t\t\t\tbone.a *= s;\n\t\t\t\tbone.c *= s;\n\t\t\t}\n\t\t\tif (mixScaleY != 0) {\n\t\t\t\tlet s = (Math.sqrt(tb * tb + td * td) - 1 + this.data.offsetScaleY) * mixScaleY + 1;\n\t\t\t\tbone.b *= s;\n\t\t\t\tbone.d *= s;\n\t\t\t}\n\n\t\t\tif (mixShearY > 0) {\n\t\t\t\tlet r = Math.atan2(td, tb) - Math.atan2(tc, ta);\n\t\t\t\tif (r > MathUtils.PI)\n\t\t\t\t\tr -= MathUtils.PI2;\n\t\t\t\telse if (r < -MathUtils.PI) //\n\t\t\t\t\tr += MathUtils.PI2;\n\t\t\t\tlet b = bone.b, d = bone.d;\n\t\t\t\tr = Math.atan2(d, b) + (r - MathUtils.PI / 2 + offsetShearY) * mixShearY;\n\t\t\t\tlet s = Math.sqrt(b * b + d * d);\n\t\t\t\tbone.b = Math.cos(r) * s;\n\t\t\t\tbone.d = Math.sin(r) * s;\n\t\t\t}\n\n\t\t\tbone.updateAppliedTransform();\n\t\t}\n\t}\n\n\tapplyAbsoluteLocal () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\n\t\tlet target = this.target;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tlet rotation = bone.arotation;\n\t\t\tif (mixRotate != 0) rotation += (target.arotation - rotation + this.data.offsetRotation) * mixRotate;\n\n\t\t\tlet x = bone.ax, y = bone.ay;\n\t\t\tx += (target.ax - x + this.data.offsetX) * mixX;\n\t\t\ty += (target.ay - y + this.data.offsetY) * mixY;\n\n\t\t\tlet scaleX = bone.ascaleX, scaleY = bone.ascaleY;\n\t\t\tif (mixScaleX != 0 && scaleX != 0)\n\t\t\t\tscaleX = (scaleX + (target.ascaleX - scaleX + this.data.offsetScaleX) * mixScaleX) / scaleX;\n\t\t\tif (mixScaleY != 0 && scaleY != 0)\n\t\t\t\tscaleY = (scaleY + (target.ascaleY - scaleY + this.data.offsetScaleY) * mixScaleY) / scaleY;\n\n\t\t\tlet shearY = bone.ashearY;\n\t\t\tif (mixShearY != 0) shearY += (target.ashearY - shearY + this.data.offsetShearY) * mixShearY;\n\n\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\n\t\t}\n\t}\n\n\tapplyRelativeLocal () {\n\t\tlet mixRotate = this.mixRotate, mixX = this.mixX, mixY = this.mixY, mixScaleX = this.mixScaleX,\n\t\t\tmixScaleY = this.mixScaleY, mixShearY = this.mixShearY;\n\n\t\tlet target = this.target;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\n\t\t\tlet rotation = bone.arotation + (target.arotation + this.data.offsetRotation) * mixRotate;\n\t\t\tlet x = bone.ax + (target.ax + this.data.offsetX) * mixX;\n\t\t\tlet y = bone.ay + (target.ay + this.data.offsetY) * mixY;\n\t\t\tlet scaleX = bone.ascaleX * (((target.ascaleX - 1 + this.data.offsetScaleX) * mixScaleX) + 1);\n\t\t\tlet scaleY = bone.ascaleY * (((target.ascaleY - 1 + this.data.offsetScaleY) * mixScaleY) + 1);\n\t\t\tlet shearY = bone.ashearY + (target.ashearY + this.data.offsetShearY) * mixShearY;\n\n\t\t\tbone.updateWorldTransformWith(x, y, rotation, scaleX, scaleY, bone.ashearX, shearY);\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment } from \"./attachments/Attachment.js\";\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { PathAttachment } from \"./attachments/PathAttachment.js\";\nimport { RegionAttachment } from \"./attachments/RegionAttachment.js\";\nimport { Bone } from \"./Bone.js\";\nimport { IkConstraint } from \"./IkConstraint.js\";\nimport { PathConstraint } from \"./PathConstraint.js\";\nimport { PhysicsConstraint } from \"./PhysicsConstraint.js\";\nimport { SkeletonClipping } from \"./SkeletonClipping.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { Slot } from \"./Slot.js\";\nimport { TransformConstraint } from \"./TransformConstraint.js\";\nimport { Updatable } from \"./Updatable.js\";\nimport { Color, Utils, MathUtils, Vector2, NumberArrayLike } from \"./Utils.js\";\n\n/** Stores the current pose for a skeleton.\n *\n * See [Instance objects](http://esotericsoftware.com/spine-runtime-architecture#Instance-objects) in the Spine Runtimes Guide. */\nexport class Skeleton {\n\tprivate static quadTriangles = [0, 1, 2, 2, 3, 0];\n\tstatic yDown = false;\n\n\t/** The skeleton's setup pose data. */\n\tdata: SkeletonData;\n\n\t/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\n\tbones: Array;\n\n\t/** The skeleton's slots in the setup pose draw order. */\n\tslots: Array;\n\n\t/** The skeleton's slots in the order they should be drawn. The returned array may be modified to change the draw order. */\n\tdrawOrder: Array;\n\n\t/** The skeleton's IK constraints. */\n\tikConstraints: Array;\n\n\t/** The skeleton's transform constraints. */\n\ttransformConstraints: Array;\n\n\t/** The skeleton's path constraints. */\n\tpathConstraints: Array;\n\n\n\t/** The skeleton's physics constraints. */\n\tphysicsConstraints: Array;\n\n\t/** The list of bones and constraints, sorted in the order they should be updated, as computed by {@link #updateCache()}. */\n\t_updateCache = new Array();\n\n\t/** The skeleton's current skin. May be null. */\n\tskin: Skin | null = null;\n\n\t/** The color to tint all the skeleton's attachments. */\n\tcolor: Color;\n\n\t/** Scales the entire skeleton on the X axis. This affects all bones, even if the bone's transform mode disallows scale\n\t * inheritance. */\n\tscaleX = 1;\n\n\t/** Scales the entire skeleton on the Y axis. This affects all bones, even if the bone's transform mode disallows scale\n\t * inheritance. */\n\tprivate _scaleY = 1;\n\n\tpublic get scaleY () {\n\t\treturn Skeleton.yDown ? -this._scaleY : this._scaleY;\n\t}\n\n\tpublic set scaleY (scaleY: number) {\n\t\tthis._scaleY = scaleY;\n\t}\n\n\t/** Sets the skeleton X position, which is added to the root bone worldX position. */\n\tx = 0;\n\n\t/** Sets the skeleton Y position, which is added to the root bone worldY position. */\n\ty = 0;\n\n\t/** Returns the skeleton's time. This is used for time-based manipulations, such as {@link PhysicsConstraint}.\n\t *

\n\t * See {@link #update(float)}. */\n\ttime = 0;\n\n\tconstructor (data: SkeletonData) {\n\t\tif (!data) throw new Error(\"data cannot be null.\");\n\t\tthis.data = data;\n\n\t\tthis.bones = new Array();\n\t\tfor (let i = 0; i < data.bones.length; i++) {\n\t\t\tlet boneData = data.bones[i];\n\t\t\tlet bone: Bone;\n\t\t\tif (!boneData.parent)\n\t\t\t\tbone = new Bone(boneData, this, null);\n\t\t\telse {\n\t\t\t\tlet parent = this.bones[boneData.parent.index];\n\t\t\t\tbone = new Bone(boneData, this, parent);\n\t\t\t\tparent.children.push(bone);\n\t\t\t}\n\t\t\tthis.bones.push(bone);\n\t\t}\n\n\t\tthis.slots = new Array();\n\t\tthis.drawOrder = new Array();\n\t\tfor (let i = 0; i < data.slots.length; i++) {\n\t\t\tlet slotData = data.slots[i];\n\t\t\tlet bone = this.bones[slotData.boneData.index];\n\t\t\tlet slot = new Slot(slotData, bone);\n\t\t\tthis.slots.push(slot);\n\t\t\tthis.drawOrder.push(slot);\n\t\t}\n\n\t\tthis.ikConstraints = new Array();\n\t\tfor (let i = 0; i < data.ikConstraints.length; i++) {\n\t\t\tlet ikConstraintData = data.ikConstraints[i];\n\t\t\tthis.ikConstraints.push(new IkConstraint(ikConstraintData, this));\n\t\t}\n\n\t\tthis.transformConstraints = new Array();\n\t\tfor (let i = 0; i < data.transformConstraints.length; i++) {\n\t\t\tlet transformConstraintData = data.transformConstraints[i];\n\t\t\tthis.transformConstraints.push(new TransformConstraint(transformConstraintData, this));\n\t\t}\n\n\t\tthis.pathConstraints = new Array();\n\t\tfor (let i = 0; i < data.pathConstraints.length; i++) {\n\t\t\tlet pathConstraintData = data.pathConstraints[i];\n\t\t\tthis.pathConstraints.push(new PathConstraint(pathConstraintData, this));\n\t\t}\n\n\t\tthis.physicsConstraints = new Array();\n\t\tfor (let i = 0; i < data.physicsConstraints.length; i++) {\n\t\t\tlet physicsConstraintData = data.physicsConstraints[i];\n\t\t\tthis.physicsConstraints.push(new PhysicsConstraint(physicsConstraintData, this));\n\t\t}\n\n\t\tthis.color = new Color(1, 1, 1, 1);\n\t\tthis.updateCache();\n\t}\n\n\t/** Caches information about bones and constraints. Must be called if the {@link #getSkin()} is modified or if bones,\n\t * constraints, or weighted path attachments are added or removed. */\n\tupdateCache () {\n\t\tlet updateCache = this._updateCache;\n\t\tupdateCache.length = 0;\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.sorted = bone.data.skinRequired;\n\t\t\tbone.active = !bone.sorted;\n\t\t}\n\n\t\tif (this.skin) {\n\t\t\tlet skinBones = this.skin.bones;\n\t\t\tfor (let i = 0, n = this.skin.bones.length; i < n; i++) {\n\t\t\t\tlet bone: Bone | null = this.bones[skinBones[i].index];\n\t\t\t\tdo {\n\t\t\t\t\tbone.sorted = false;\n\t\t\t\t\tbone.active = true;\n\t\t\t\t\tbone = bone.parent;\n\t\t\t\t} while (bone);\n\t\t\t}\n\t\t}\n\n\t\t// IK first, lowest hierarchy depth first.\n\t\tlet ikConstraints = this.ikConstraints;\n\t\tlet transformConstraints = this.transformConstraints;\n\t\tlet pathConstraints = this.pathConstraints;\n\t\tlet physicsConstraints = this.physicsConstraints;\n\t\tlet ikCount = ikConstraints.length, transformCount = transformConstraints.length, pathCount = pathConstraints.length, physicsCount = this.physicsConstraints.length;\n\t\tlet constraintCount = ikCount + transformCount + pathCount + physicsCount;\n\n\t\touter:\n\t\tfor (let i = 0; i < constraintCount; i++) {\n\t\t\tfor (let ii = 0; ii < ikCount; ii++) {\n\t\t\t\tlet constraint = ikConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortIkConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < transformCount; ii++) {\n\t\t\t\tlet constraint = transformConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortTransformConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < pathCount; ii++) {\n\t\t\t\tlet constraint = pathConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortPathConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (let ii = 0; ii < physicsCount; ii++) {\n\t\t\t\tconst constraint = physicsConstraints[ii];\n\t\t\t\tif (constraint.data.order == i) {\n\t\t\t\t\tthis.sortPhysicsConstraint(constraint);\n\t\t\t\t\tcontinue outer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (let i = 0, n = bones.length; i < n; i++)\n\t\t\tthis.sortBone(bones[i]);\n\t}\n\n\tsortIkConstraint (constraint: IkConstraint) {\n\t\tconstraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tlet target = constraint.target;\n\t\tthis.sortBone(target);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet parent = constrained[0];\n\t\tthis.sortBone(parent);\n\n\t\tif (constrained.length == 1) {\n\t\t\tthis._updateCache.push(constraint);\n\t\t\tthis.sortReset(parent.children);\n\t\t} else {\n\t\t\tlet child = constrained[constrained.length - 1];\n\t\t\tthis.sortBone(child);\n\n\t\t\tthis._updateCache.push(constraint);\n\n\t\t\tthis.sortReset(parent.children);\n\t\t\tchild.sorted = true;\n\t\t}\n\t}\n\n\tsortPathConstraint (constraint: PathConstraint) {\n\t\tconstraint.active = constraint.target.bone.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tlet slot = constraint.target;\n\t\tlet slotIndex = slot.data.index;\n\t\tlet slotBone = slot.bone;\n\t\tif (this.skin) this.sortPathConstraintAttachment(this.skin, slotIndex, slotBone);\n\t\tif (this.data.defaultSkin && this.data.defaultSkin != this.skin)\n\t\t\tthis.sortPathConstraintAttachment(this.data.defaultSkin, slotIndex, slotBone);\n\t\tfor (let i = 0, n = this.data.skins.length; i < n; i++)\n\t\t\tthis.sortPathConstraintAttachment(this.data.skins[i], slotIndex, slotBone);\n\n\t\tlet attachment = slot.getAttachment();\n\t\tif (attachment instanceof PathAttachment) this.sortPathConstraintAttachmentWith(attachment, slotBone);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet boneCount = constrained.length;\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortBone(constrained[i]);\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortReset(constrained[i].children);\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tconstrained[i].sorted = true;\n\t}\n\n\tsortTransformConstraint (constraint: TransformConstraint) {\n\t\tconstraint.active = constraint.target.isActive() && (!constraint.data.skinRequired || (this.skin && Utils.contains(this.skin.constraints, constraint.data, true)))!;\n\t\tif (!constraint.active) return;\n\n\t\tthis.sortBone(constraint.target);\n\n\t\tlet constrained = constraint.bones;\n\t\tlet boneCount = constrained.length;\n\t\tif (constraint.data.local) {\n\t\t\tfor (let i = 0; i < boneCount; i++) {\n\t\t\t\tlet child = constrained[i];\n\t\t\t\tthis.sortBone(child.parent!);\n\t\t\t\tthis.sortBone(child);\n\t\t\t}\n\t\t} else {\n\t\t\tfor (let i = 0; i < boneCount; i++) {\n\t\t\t\tthis.sortBone(constrained[i]);\n\t\t\t}\n\t\t}\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tthis.sortReset(constrained[i].children);\n\t\tfor (let i = 0; i < boneCount; i++)\n\t\t\tconstrained[i].sorted = true;\n\t}\n\n\tsortPathConstraintAttachment (skin: Skin, slotIndex: number, slotBone: Bone) {\n\t\tlet attachments = skin.attachments[slotIndex];\n\t\tif (!attachments) return;\n\t\tfor (let key in attachments) {\n\t\t\tthis.sortPathConstraintAttachmentWith(attachments[key], slotBone);\n\t\t}\n\t}\n\n\tsortPathConstraintAttachmentWith (attachment: Attachment, slotBone: Bone) {\n\t\tif (!(attachment instanceof PathAttachment)) return;\n\t\tlet pathBones = (attachment).bones;\n\t\tif (!pathBones)\n\t\t\tthis.sortBone(slotBone);\n\t\telse {\n\t\t\tlet bones = this.bones;\n\t\t\tfor (let i = 0, n = pathBones.length; i < n;) {\n\t\t\t\tlet nn = pathBones[i++];\n\t\t\t\tnn += i;\n\t\t\t\twhile (i < nn)\n\t\t\t\t\tthis.sortBone(bones[pathBones[i++]]);\n\t\t\t}\n\t\t}\n\t}\n\n\tsortPhysicsConstraint (constraint: PhysicsConstraint) {\n\t\tconst bone = constraint.bone;\n\t\tconstraint.active = bone.active && (!constraint.data.skinRequired || (this.skin != null && Utils.contains(this.skin.constraints, constraint.data, true)));\n\t\tif (!constraint.active) return;\n\n\t\tthis.sortBone(bone);\n\n\t\tthis._updateCache.push(constraint);\n\n\t\tthis.sortReset(bone.children);\n\t\tbone.sorted = true;\n\t}\n\n\tsortBone (bone: Bone) {\n\t\tif (!bone) return;\n\t\tif (bone.sorted) return;\n\t\tlet parent = bone.parent;\n\t\tif (parent) this.sortBone(parent);\n\t\tbone.sorted = true;\n\t\tthis._updateCache.push(bone);\n\t}\n\n\tsortReset (bones: Array) {\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (!bone.active) continue;\n\t\t\tif (bone.sorted) this.sortReset(bone.children);\n\t\t\tbone.sorted = false;\n\t\t}\n\t}\n\n\t/** Updates the world transform for each bone and applies all constraints.\n\t *\n\t * See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine\n\t * Runtimes Guide. */\n\tupdateWorldTransform (physics: Physics) {\n\t\tif (physics === undefined || physics === null) throw new Error(\"physics is undefined\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tbone.ax = bone.x;\n\t\t\tbone.ay = bone.y;\n\t\t\tbone.arotation = bone.rotation;\n\t\t\tbone.ascaleX = bone.scaleX;\n\t\t\tbone.ascaleY = bone.scaleY;\n\t\t\tbone.ashearX = bone.shearX;\n\t\t\tbone.ashearY = bone.shearY;\n\t\t}\n\n\t\tlet updateCache = this._updateCache;\n\t\tfor (let i = 0, n = updateCache.length; i < n; i++)\n\t\t\tupdateCache[i].update(physics);\n\t}\n\n\tupdateWorldTransformWith (physics: Physics, parent: Bone) {\n\t\tif (!parent) throw new Error(\"parent cannot be null.\");\n\n\t\tlet bones = this.bones;\n\t\tfor (let i = 1, n = bones.length; i < n; i++) { // Skip root bone.\n\t\t\tlet bone = bones[i];\n\t\t\tbone.ax = bone.x;\n\t\t\tbone.ay = bone.y;\n\t\t\tbone.arotation = bone.rotation;\n\t\t\tbone.ascaleX = bone.scaleX;\n\t\t\tbone.ascaleY = bone.scaleY;\n\t\t\tbone.ashearX = bone.shearX;\n\t\t\tbone.ashearY = bone.shearY;\n\t\t}\n\n\t\t// Apply the parent bone transform to the root bone. The root bone always inherits scale, rotation and reflection.\n\t\tlet rootBone = this.getRootBone();\n\t\tif (!rootBone) throw new Error(\"Root bone must not be null.\");\n\t\tlet pa = parent.a, pb = parent.b, pc = parent.c, pd = parent.d;\n\t\trootBone.worldX = pa * this.x + pb * this.y + parent.worldX;\n\t\trootBone.worldY = pc * this.x + pd * this.y + parent.worldY;\n\n\t\tconst rx = (rootBone.rotation + rootBone.shearX) * MathUtils.degRad;\n\t\tconst ry = (rootBone.rotation + 90 + rootBone.shearY) * MathUtils.degRad;\n\t\tconst la = Math.cos(rx) * rootBone.scaleX;\n\t\tconst lb = Math.cos(ry) * rootBone.scaleY;\n\t\tconst lc = Math.sin(rx) * rootBone.scaleX;\n\t\tconst ld = Math.sin(ry) * rootBone.scaleY;\n\t\trootBone.a = (pa * la + pb * lc) * this.scaleX;\n\t\trootBone.b = (pa * lb + pb * ld) * this.scaleX;\n\t\trootBone.c = (pc * la + pd * lc) * this.scaleY;\n\t\trootBone.d = (pc * lb + pd * ld) * this.scaleY;\n\n\t\t// Update everything except root bone.\n\t\tlet updateCache = this._updateCache;\n\t\tfor (let i = 0, n = updateCache.length; i < n; i++) {\n\t\t\tlet updatable = updateCache[i];\n\t\t\tif (updatable != rootBone) updatable.update(physics);\n\t\t}\n\t}\n\n\t/** Sets the bones, constraints, and slots to their setup pose values. */\n\tsetToSetupPose () {\n\t\tthis.setBonesToSetupPose();\n\t\tthis.setSlotsToSetupPose();\n\t}\n\n\t/** Sets the bones and constraints to their setup pose values. */\n\tsetBonesToSetupPose () {\n\t\tfor (const bone of this.bones) bone.setToSetupPose();\n\t\tfor (const constraint of this.ikConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.transformConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.pathConstraints) constraint.setToSetupPose();\n\t\tfor (const constraint of this.physicsConstraints) constraint.setToSetupPose();\n\t}\n\n\t/** Sets the slots and draw order to their setup pose values. */\n\tsetSlotsToSetupPose () {\n\t\tlet slots = this.slots;\n\t\tUtils.arrayCopy(slots, 0, this.drawOrder, 0, slots.length);\n\t\tfor (let i = 0, n = slots.length; i < n; i++)\n\t\t\tslots[i].setToSetupPose();\n\t}\n\n\t/** @returns May return null. */\n\tgetRootBone () {\n\t\tif (this.bones.length == 0) return null;\n\t\treturn this.bones[0];\n\t}\n\n\t/** @returns May be null. */\n\tfindBone (boneName: string) {\n\t\tif (!boneName) throw new Error(\"boneName cannot be null.\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (bone.data.name == boneName) return bone;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\n\t * repeatedly.\n\t * @returns May be null. */\n\tfindSlot (slotName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.data.name == slotName) return slot;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Sets a skin by name.\n\t *\n\t * See {@link #setSkin()}. */\n\tsetSkinByName (skinName: string) {\n\t\tlet skin = this.data.findSkin(skinName);\n\t\tif (!skin) throw new Error(\"Skin not found: \" + skinName);\n\t\tthis.setSkin(skin);\n\t}\n\n\t/** Sets the skin used to look up attachments before looking in the {@link SkeletonData#defaultSkin default skin}. If the\n\t * skin is changed, {@link #updateCache()} is called.\n\t *\n\t * Attachments from the new skin are attached if the corresponding attachment from the old skin was attached. If there was no\n\t * old skin, each slot's setup mode attachment is attached from the new skin.\n\t *\n\t * After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling\n\t * {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply()} is called before the next time the\n\t * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.\n\t * @param newSkin May be null. */\n\tsetSkin (newSkin: Skin) {\n\t\tif (newSkin == this.skin) return;\n\t\tif (newSkin) {\n\t\t\tif (this.skin)\n\t\t\t\tnewSkin.attachAll(this, this.skin);\n\t\t\telse {\n\t\t\t\tlet slots = this.slots;\n\t\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\t\tlet slot = slots[i];\n\t\t\t\t\tlet name = slot.data.attachmentName;\n\t\t\t\t\tif (name) {\n\t\t\t\t\t\tlet attachment = newSkin.getAttachment(i, name);\n\t\t\t\t\t\tif (attachment) slot.setAttachment(attachment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis.skin = newSkin;\n\t\tthis.updateCache();\n\t}\n\n\n\t/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment\n\t * name.\n\t *\n\t * See {@link #getAttachment()}.\n\t * @returns May be null. */\n\tgetAttachmentByName (slotName: string, attachmentName: string): Attachment | null {\n\t\tlet slot = this.data.findSlot(slotName);\n\t\tif (!slot) throw new Error(`Can't find slot with name ${slotName}`);\n\t\treturn this.getAttachment(slot.index, attachmentName);\n\t}\n\n\t/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and\n\t * attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.\n\t *\n\t * See [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide.\n\t * @returns May be null. */\n\tgetAttachment (slotIndex: number, attachmentName: string): Attachment | null {\n\t\tif (!attachmentName) throw new Error(\"attachmentName cannot be null.\");\n\t\tif (this.skin) {\n\t\t\tlet attachment = this.skin.getAttachment(slotIndex, attachmentName);\n\t\t\tif (attachment) return attachment;\n\t\t}\n\t\tif (this.data.defaultSkin) return this.data.defaultSkin.getAttachment(slotIndex, attachmentName);\n\t\treturn null;\n\t}\n\n\t/** A convenience method to set an attachment by finding the slot with {@link #findSlot()}, finding the attachment with\n\t * {@link #getAttachment()}, then setting the slot's {@link Slot#attachment}.\n\t * @param attachmentName May be null to clear the slot's attachment. */\n\tsetAttachment (slotName: string, attachmentName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.data.name == slotName) {\n\t\t\t\tlet attachment: Attachment | null = null;\n\t\t\t\tif (attachmentName) {\n\t\t\t\t\tattachment = this.getAttachment(i, attachmentName);\n\t\t\t\t\tif (!attachment) throw new Error(\"Attachment not found: \" + attachmentName + \", for slot: \" + slotName);\n\t\t\t\t}\n\t\t\t\tslot.setAttachment(attachment);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tthrow new Error(\"Slot not found: \" + slotName);\n\t}\n\n\n\t/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\n\t * than to call it repeatedly.\n\t * @return May be null. */\n\tfindIkConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.ikConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\n\t * this method than to call it repeatedly.\n\t * @return May be null. */\n\tfindTransformConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.transformConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\n\t * than to call it repeatedly.\n\t * @return May be null. */\n\tfindPathConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.pathConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this\n\t * method than to call it repeatedly. */\n\tfindPhysicsConstraint (constraintName: string) {\n\t\tif (constraintName == null) throw new Error(\"constraintName cannot be null.\");\n\t\treturn this.physicsConstraints.find((constraint) => constraint.data.name == constraintName) ?? null;\n\t}\n\n\t/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose as `{ x: number, y: number, width: number, height: number }`.\n\t * Note that this method will create temporary objects which can add to garbage collection pressure. Use `getBounds()` if garbage collection is a concern. */\n\tgetBoundsRect (clipper?: SkeletonClipping) {\n\t\tlet offset = new Vector2();\n\t\tlet size = new Vector2();\n\t\tthis.getBounds(offset, size, undefined, clipper);\n\t\treturn { x: offset.x, y: offset.y, width: size.x, height: size.y };\n\t}\n\n\t/** Returns the axis aligned bounding box (AABB) of the region and mesh attachments for the current pose.\n\t * @param offset An output value, the distance from the skeleton origin to the bottom left corner of the AABB.\n\t * @param size An output value, the width and height of the AABB.\n\t * @param temp Working memory to temporarily store attachments' computed world vertices.\n\t * @param clipper {@link SkeletonClipping} to use. If null, no clipping is applied. */\n\tgetBounds (offset: Vector2, size: Vector2, temp: Array = new Array(2), clipper: SkeletonClipping | null = null) {\n\t\tif (!offset) throw new Error(\"offset cannot be null.\");\n\t\tif (!size) throw new Error(\"size cannot be null.\");\n\t\tlet drawOrder = this.drawOrder;\n\t\tlet minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tif (!slot.bone.active) continue;\n\t\t\tlet verticesLength = 0;\n\t\t\tlet vertices: NumberArrayLike | null = null;\n\t\t\tlet triangles: NumberArrayLike | null = null;\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tverticesLength = 8;\n\t\t\t\tvertices = Utils.setArraySize(temp, verticesLength, 0);\n\t\t\t\tattachment.computeWorldVertices(slot, vertices, 0, 2);\n\t\t\t\ttriangles = Skeleton.quadTriangles;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = (attachment);\n\t\t\t\tverticesLength = mesh.worldVerticesLength;\n\t\t\t\tvertices = Utils.setArraySize(temp, verticesLength, 0);\n\t\t\t\tmesh.computeWorldVertices(slot, 0, verticesLength, vertices, 0, 2);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t} else if (attachment instanceof ClippingAttachment && clipper != null) {\n\t\t\t\tclipper.clipStart(slot, attachment);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (vertices && triangles) {\n\t\t\t\tif (clipper != null && clipper.isClipping()) {\n\t\t\t\t\tclipper.clipTriangles(vertices, triangles, triangles.length);\n\t\t\t\t\tvertices = clipper.clippedVertices;\n\t\t\t\t\tverticesLength = clipper.clippedVertices.length;\n\t\t\t\t}\n\t\t\t\tfor (let ii = 0, nn = vertices.length; ii < nn; ii += 2) {\n\t\t\t\t\tlet x = vertices[ii], y = vertices[ii + 1];\n\t\t\t\t\tminX = Math.min(minX, x);\n\t\t\t\t\tminY = Math.min(minY, y);\n\t\t\t\t\tmaxX = Math.max(maxX, x);\n\t\t\t\t\tmaxY = Math.max(maxY, y);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (clipper != null) clipper.clipEndWithSlot(slot);\n\t\t}\n\t\tif (clipper != null) clipper.clipEnd();\n\t\toffset.set(minX, minY);\n\t\tsize.set(maxX - minX, maxY - minY);\n\t}\n\n\t/** Increments the skeleton's {@link #time}. */\n\tupdate (delta: number) {\n\t\tthis.time += delta;\n\t}\n\n\tphysicsTranslate (x: number, y: number) {\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++)\n\t\t\tphysicsConstraints[i].translate(x, y);\n\t}\n\n\t/** Calls {@link PhysicsConstraint#rotate(float, float, float)} for each physics constraint. */\n\tphysicsRotate (x: number, y: number, degrees: number) {\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++)\n\t\t\tphysicsConstraints[i].rotate(x, y, degrees);\n\t}\n}\n\n/** Determines how physics and other non-deterministic updates are applied. */\nexport enum Physics {\n\t/** Physics are not updated or applied. */\n\tnone,\n\n\t/** Physics are reset to the current pose. */\n\treset,\n\n\t/** Physics are updated and the pose from physics is applied. */\n\tupdate,\n\n\t/** Physics are not updated but the pose from physics is applied. */\n\tpose\n}", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\n\n\n/** Stores the setup pose for a {@link PhysicsConstraint}.\n *

\n * See Physics constraints in the Spine User Guide. */\nexport class PhysicsConstraintData extends ConstraintData {\n\tprivate _bone: BoneData | null = null;\n\t/** The bone constrained by this physics constraint. */\n\tpublic set bone (boneData: BoneData) { this._bone = boneData; }\n\tpublic get bone () {\n\t\tif (!this._bone) throw new Error(\"BoneData not set.\")\n\t\telse return this._bone;\n\t}\n\n\tx = 0;\n\ty = 0;\n\trotate = 0;\n\tscaleX = 0;\n\tshearX = 0;\n\tlimit = 0;\n\tstep = 0;\n\tinertia = 0;\n\tstrength = 0;\n\tdamping = 0;\n\tmassInverse = 0;\n\twind = 0;\n\tgravity = 0;\n\t/** A percentage (0-1) that controls the mix between the constrained and unconstrained poses. */\n\tmix = 0;\n\tinertiaGlobal = false;\n\tstrengthGlobal = false;\n\tdampingGlobal = false;\n\tmassGlobal = false;\n\twindGlobal = false;\n\tgravityGlobal = false;\n\tmixGlobal = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation } from \"./Animation\"\nimport { BoneData } from \"./BoneData.js\";\nimport { EventData } from \"./EventData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData } from \"./PathConstraintData.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\n\n/** Stores the setup pose and all of the stateless data for a skeleton.\n *\n * See [Data objects](http://esotericsoftware.com/spine-runtime-architecture#Data-objects) in the Spine Runtimes\n * Guide. */\nexport class SkeletonData {\n\n\t/** The skeleton's name, which by default is the name of the skeleton data file, if possible. May be null. */\n\tname: string | null = null;\n\n\t/** The skeleton's bones, sorted parent first. The root bone is always the first bone. */\n\tbones = new Array(); // Ordered parents first.\n\n\t/** The skeleton's slots in the setup pose draw order. */\n\tslots = new Array(); // Setup pose draw order.\n\n\tskins = new Array();\n\n\t/** The skeleton's default skin. By default this skin contains all attachments that were not in a skin in Spine.\n\t *\n\t * See {@link Skeleton#getAttachmentByName()}.\n\t * May be null. */\n\tdefaultSkin: Skin | null = null;\n\n\t/** The skeleton's events. */\n\tevents = new Array();\n\n\t/** The skeleton's animations. */\n\tanimations = new Array();\n\n\t/** The skeleton's IK constraints. */\n\tikConstraints = new Array();\n\n\t/** The skeleton's transform constraints. */\n\ttransformConstraints = new Array();\n\n\t/** The skeleton's path constraints. */\n\tpathConstraints = new Array();\n\n\t/** The skeleton's physics constraints. */\n\tphysicsConstraints = new Array();\n\n\t/** The X coordinate of the skeleton's axis aligned bounding box in the setup pose. */\n\tx: number = 0;\n\n\t/** The Y coordinate of the skeleton's axis aligned bounding box in the setup pose. */\n\ty: number = 0;\n\n\t/** The width of the skeleton's axis aligned bounding box in the setup pose. */\n\twidth: number = 0;\n\n\t/** The height of the skeleton's axis aligned bounding box in the setup pose. */\n\theight: number = 0;\n\n\t/** Baseline scale factor for applying distance-dependent effects on non-scalable properties, such as angle or scale. Default\n\t * is 100. */\n\treferenceScale = 100;\n\n\t/** The Spine version used to export the skeleton data, or null. */\n\tversion: string | null = null;\n\n\t/** The skeleton data hash. This value will change if any of the skeleton data has changed. May be null. */\n\thash: string | null = null;\n\n\t// Nonessential\n\t/** The dopesheet FPS in Spine. Available only when nonessential data was exported. */\n\tfps = 0;\n\n\t/** The path to the images directory as defined in Spine. Available only when nonessential data was exported. May be null. */\n\timagesPath: string | null = null;\n\n\t/** The path to the audio directory as defined in Spine. Available only when nonessential data was exported. May be null. */\n\taudioPath: string | null = null;\n\n\t/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindBone (boneName: string) {\n\t\tif (!boneName) throw new Error(\"boneName cannot be null.\");\n\t\tlet bones = this.bones;\n\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\tlet bone = bones[i];\n\t\t\tif (bone.name == boneName) return bone;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a slot by comparing each slot's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindSlot (slotName: string) {\n\t\tif (!slotName) throw new Error(\"slotName cannot be null.\");\n\t\tlet slots = this.slots;\n\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (slot.name == slotName) return slot;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindSkin (skinName: string) {\n\t\tif (!skinName) throw new Error(\"skinName cannot be null.\");\n\t\tlet skins = this.skins;\n\t\tfor (let i = 0, n = skins.length; i < n; i++) {\n\t\t\tlet skin = skins[i];\n\t\t\tif (skin.name == skinName) return skin;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it\n\t * multiple times.\n\t * @returns May be null. */\n\tfindEvent (eventDataName: string) {\n\t\tif (!eventDataName) throw new Error(\"eventDataName cannot be null.\");\n\t\tlet events = this.events;\n\t\tfor (let i = 0, n = events.length; i < n; i++) {\n\t\t\tlet event = events[i];\n\t\t\tif (event.name == eventDataName) return event;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to\n\t * call it multiple times.\n\t * @returns May be null. */\n\tfindAnimation (animationName: string) {\n\t\tif (!animationName) throw new Error(\"animationName cannot be null.\");\n\t\tlet animations = this.animations;\n\t\tfor (let i = 0, n = animations.length; i < n; i++) {\n\t\t\tlet animation = animations[i];\n\t\t\tif (animation.name == animationName) return animation;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindIkConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst ikConstraints = this.ikConstraints;\n\t\tfor (let i = 0, n = ikConstraints.length; i < n; i++) {\n\t\t\tconst constraint = ikConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a transform constraint by comparing each transform constraint's name. It is more efficient to cache the results of\n\t * this method than to call it multiple times.\n\t * @return May be null. */\n\tfindTransformConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst transformConstraints = this.transformConstraints;\n\t\tfor (let i = 0, n = transformConstraints.length; i < n; i++) {\n\t\t\tconst constraint = transformConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a path constraint by comparing each path constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindPathConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst pathConstraints = this.pathConstraints;\n\t\tfor (let i = 0, n = pathConstraints.length; i < n; i++) {\n\t\t\tconst constraint = pathConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n\n\t/** Finds a physics constraint by comparing each physics constraint's name. It is more efficient to cache the results of this method\n\t * than to call it multiple times.\n\t * @return May be null. */\n\tfindPhysicsConstraint (constraintName: string) {\n\t\tif (!constraintName) throw new Error(\"constraintName cannot be null.\");\n\t\tconst physicsConstraints = this.physicsConstraints;\n\t\tfor (let i = 0, n = physicsConstraints.length; i < n; i++) {\n\t\t\tconst constraint = physicsConstraints[i];\n\t\t\tif (constraint.name == constraintName) return constraint;\n\t\t}\n\t\treturn null;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Attachment } from \"./attachments/Attachment.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { BoneData } from \"./BoneData.js\";\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { Color, StringMap } from \"./Utils.js\";\n\n/** Stores an entry in the skin consisting of the slot index, name, and attachment **/\nexport class SkinEntry {\n\tconstructor (public slotIndex: number = 0, public name: string, public attachment: Attachment) { }\n}\n\n/** Stores attachments by slot index and attachment name.\n *\n * See SkeletonData {@link SkeletonData#defaultSkin}, Skeleton {@link Skeleton#skin}, and\n * [Runtime skins](http://esotericsoftware.com/spine-runtime-skins) in the Spine Runtimes Guide. */\nexport class Skin {\n\t/** The skin's name, which is unique across all skins in the skeleton. */\n\tname: string;\n\n\tattachments = new Array>();\n\tbones = Array();\n\tconstraints = new Array();\n\n\t/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */\n\tcolor = new Color(0.99607843, 0.61960787, 0.30980393, 1); // fe9e4fff\n\n\tconstructor (name: string) {\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tthis.name = name;\n\t}\n\n\t/** Adds an attachment to the skin for the specified slot index and name. */\n\tsetAttachment (slotIndex: number, name: string, attachment: Attachment) {\n\t\tif (!attachment) throw new Error(\"attachment cannot be null.\");\n\t\tlet attachments = this.attachments;\n\t\tif (slotIndex >= attachments.length) attachments.length = slotIndex + 1;\n\t\tif (!attachments[slotIndex]) attachments[slotIndex] = {};\n\t\tattachments[slotIndex][name] = attachment;\n\t}\n\n\t/** Adds all attachments, bones, and constraints from the specified skin to this skin. */\n\taddSkin (skin: Skin) {\n\t\tfor (let i = 0; i < skin.bones.length; i++) {\n\t\t\tlet bone = skin.bones[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.bones.length; ii++) {\n\t\t\t\tif (this.bones[ii] == bone) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.bones.push(bone);\n\t\t}\n\n\t\tfor (let i = 0; i < skin.constraints.length; i++) {\n\t\t\tlet constraint = skin.constraints[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.constraints.length; ii++) {\n\t\t\t\tif (this.constraints[ii] == constraint) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.constraints.push(constraint);\n\t\t}\n\n\t\tlet attachments = skin.getAttachments();\n\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\tvar attachment = attachments[i];\n\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t}\n\t}\n\n\t/** Adds all bones and constraints and copies of all attachments from the specified skin to this skin. Mesh attachments are not\n\t * copied, instead a new linked mesh is created. The attachment copies can be modified without affecting the originals. */\n\tcopySkin (skin: Skin) {\n\t\tfor (let i = 0; i < skin.bones.length; i++) {\n\t\t\tlet bone = skin.bones[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.bones.length; ii++) {\n\t\t\t\tif (this.bones[ii] == bone) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.bones.push(bone);\n\t\t}\n\n\t\tfor (let i = 0; i < skin.constraints.length; i++) {\n\t\t\tlet constraint = skin.constraints[i];\n\t\t\tlet contained = false;\n\t\t\tfor (let ii = 0; ii < this.constraints.length; ii++) {\n\t\t\t\tif (this.constraints[ii] == constraint) {\n\t\t\t\t\tcontained = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!contained) this.constraints.push(constraint);\n\t\t}\n\n\t\tlet attachments = skin.getAttachments();\n\t\tfor (let i = 0; i < attachments.length; i++) {\n\t\t\tvar attachment = attachments[i];\n\t\t\tif (!attachment.attachment) continue;\n\t\t\tif (attachment.attachment instanceof MeshAttachment) {\n\t\t\t\tattachment.attachment = attachment.attachment.newLinkedMesh();\n\t\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t\t} else {\n\t\t\t\tattachment.attachment = attachment.attachment.copy();\n\t\t\t\tthis.setAttachment(attachment.slotIndex, attachment.name, attachment.attachment);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Returns the attachment for the specified slot index and name, or null. */\n\tgetAttachment (slotIndex: number, name: string): Attachment | null {\n\t\tlet dictionary = this.attachments[slotIndex];\n\t\treturn dictionary ? dictionary[name] : null;\n\t}\n\n\t/** Removes the attachment in the skin for the specified slot index and name, if any. */\n\tremoveAttachment (slotIndex: number, name: string) {\n\t\tlet dictionary = this.attachments[slotIndex];\n\t\tif (dictionary) delete dictionary[name];\n\t}\n\n\t/** Returns all attachments in this skin. */\n\tgetAttachments (): Array {\n\t\tlet entries = new Array();\n\t\tfor (var i = 0; i < this.attachments.length; i++) {\n\t\t\tlet slotAttachments = this.attachments[i];\n\t\t\tif (slotAttachments) {\n\t\t\t\tfor (let name in slotAttachments) {\n\t\t\t\t\tlet attachment = slotAttachments[name];\n\t\t\t\t\tif (attachment) entries.push(new SkinEntry(i, name, attachment));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn entries;\n\t}\n\n\t/** Returns all attachments in this skin for the specified slot index. */\n\tgetAttachmentsForSlot (slotIndex: number, attachments: Array) {\n\t\tlet slotAttachments = this.attachments[slotIndex];\n\t\tif (slotAttachments) {\n\t\t\tfor (let name in slotAttachments) {\n\t\t\t\tlet attachment = slotAttachments[name];\n\t\t\t\tif (attachment) attachments.push(new SkinEntry(slotIndex, name, attachment));\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Clears all attachments, bones, and constraints. */\n\tclear () {\n\t\tthis.attachments.length = 0;\n\t\tthis.bones.length = 0;\n\t\tthis.constraints.length = 0;\n\t}\n\n\t/** Attach each attachment in this skin if the corresponding attachment in the old skin is currently attached. */\n\tattachAll (skeleton: Skeleton, oldSkin: Skin) {\n\t\tlet slotIndex = 0;\n\t\tfor (let i = 0; i < skeleton.slots.length; i++) {\n\t\t\tlet slot = skeleton.slots[i];\n\t\t\tlet slotAttachment = slot.getAttachment();\n\t\t\tif (slotAttachment && slotIndex < oldSkin.attachments.length) {\n\t\t\t\tlet dictionary = oldSkin.attachments[slotIndex];\n\t\t\t\tfor (let key in dictionary) {\n\t\t\t\t\tlet skinAttachment: Attachment = dictionary[key];\n\t\t\t\t\tif (slotAttachment == skinAttachment) {\n\t\t\t\t\t\tlet attachment = this.getAttachment(slotIndex, key);\n\t\t\t\t\t\tif (attachment) slot.setAttachment(attachment);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tslotIndex++;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoneData } from \"./BoneData.js\";\nimport { Color } from \"./Utils.js\";\n\n/** Stores the setup pose for a {@link Slot}. */\nexport class SlotData {\n\t/** The index of the slot in {@link Skeleton#getSlots()}. */\n\tindex: number = 0;\n\n\t/** The name of the slot, which is unique across all slots in the skeleton. */\n\tname: string;\n\n\t/** The bone this slot belongs to. */\n\tboneData: BoneData;\n\n\t/** The color used to tint the slot's attachment. If {@link #getDarkColor()} is set, this is used as the light color for two\n\t * color tinting. */\n\tcolor = new Color(1, 1, 1, 1);\n\n\t/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark\n\t * color's alpha is not used. */\n\tdarkColor: Color | null = null;\n\n\t/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */\n\tattachmentName: string | null = null;\n\n\t/** The blend mode for drawing the slot's attachment. */\n\tblendMode: BlendMode = BlendMode.Normal;\n\n\t/** False if the slot was hidden in Spine and nonessential data was exported. Does not affect runtime rendering. */\n\tvisible = true;\n\n\tconstructor (index: number, name: string, boneData: BoneData) {\n\t\tif (index < 0) throw new Error(\"index must be >= 0.\");\n\t\tif (!name) throw new Error(\"name cannot be null.\");\n\t\tif (!boneData) throw new Error(\"boneData cannot be null.\");\n\t\tthis.index = index;\n\t\tthis.name = name;\n\t\tthis.boneData = boneData;\n\t}\n}\n\n/** Determines how images are blended with existing pixels when drawn. */\nexport enum BlendMode { Normal, Additive, Multiply, Screen }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { ConstraintData } from \"./ConstraintData.js\";\nimport { BoneData } from \"./BoneData.js\";\n\n/** Stores the setup pose for a {@link TransformConstraint}.\n *\n * See [Transform constraints](http://esotericsoftware.com/spine-transform-constraints) in the Spine User Guide. */\nexport class TransformConstraintData extends ConstraintData {\n\n\t/** The bones that will be modified by this transform constraint. */\n\tbones = new Array();\n\n\t/** The target bone whose world transform will be copied to the constrained bones. */\n\tprivate _target: BoneData | null = null;\n\tpublic set target (boneData: BoneData) { this._target = boneData; }\n\tpublic get target () {\n\t\tif (!this._target) throw new Error(\"BoneData not set.\")\n\t\telse return this._target;\n\t}\n\n\tmixRotate = 0;\n\tmixX = 0;\n\tmixY = 0;\n\tmixScaleX = 0;\n\tmixScaleY = 0;\n\tmixShearY = 0;\n\n\t/** An offset added to the constrained bone rotation. */\n\toffsetRotation = 0;\n\n\t/** An offset added to the constrained bone X translation. */\n\toffsetX = 0;\n\n\t/** An offset added to the constrained bone Y translation. */\n\toffsetY = 0;\n\n\t/** An offset added to the constrained bone scaleX. */\n\toffsetScaleX = 0;\n\n\t/** An offset added to the constrained bone scaleY. */\n\toffsetScaleY = 0;\n\n\t/** An offset added to the constrained bone shearY. */\n\toffsetShearY = 0;\n\n\trelative = false;\n\tlocal = false;\n\n\tconstructor (name: string) {\n\t\tsuper(name, 0, false);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, Timeline, InheritTimeline, AttachmentTimeline, RGBATimeline, RGBTimeline, RGBA2Timeline, RGB2Timeline, AlphaTimeline, RotateTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline, CurveTimeline1, CurveTimeline2, CurveTimeline, SequenceTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintDampingTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintWindTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintMixTimeline } from \"./Animation.js\";\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { Sequence, SequenceModeValues } from \"./attachments/Sequence.js\";\nimport { BoneData } from \"./BoneData.js\";\nimport { Event } from \"./Event.js\";\nimport { EventData } from \"./EventData.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData, PositionMode, SpacingMode } from \"./PathConstraintData.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Color, Utils } from \"./Utils.js\";\n\n/** Loads skeleton data in the Spine binary format.\n *\n * See [Spine binary format](http://esotericsoftware.com/spine-binary-format) and\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\n * Runtimes Guide. */\nexport class SkeletonBinary {\n\t/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\n\t * runtime than were used in Spine.\n\t *\n\t * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\n\tscale = 1;\n\n\tattachmentLoader: AttachmentLoader;\n\tprivate linkedMeshes = new Array();\n\n\tconstructor (attachmentLoader: AttachmentLoader) {\n\t\tthis.attachmentLoader = attachmentLoader;\n\t}\n\n\treadSkeletonData (binary: Uint8Array | ArrayBuffer): SkeletonData {\n\t\tlet scale = this.scale;\n\n\t\tlet skeletonData = new SkeletonData();\n\t\tskeletonData.name = \"\"; // BOZO\n\n\t\tlet input = new BinaryInput(binary);\n\n\t\tlet lowHash = input.readInt32();\n\t\tlet highHash = input.readInt32();\n\t\tskeletonData.hash = highHash == 0 && lowHash == 0 ? null : highHash.toString(16) + lowHash.toString(16);\n\t\tskeletonData.version = input.readString();\n\t\tskeletonData.x = input.readFloat();\n\t\tskeletonData.y = input.readFloat();\n\t\tskeletonData.width = input.readFloat();\n\t\tskeletonData.height = input.readFloat();\n\t\tskeletonData.referenceScale = input.readFloat() * scale;\n\n\t\tlet nonessential = input.readBoolean();\n\t\tif (nonessential) {\n\t\t\tskeletonData.fps = input.readFloat();\n\t\t\tskeletonData.imagesPath = input.readString();\n\t\t\tskeletonData.audioPath = input.readString();\n\t\t}\n\n\t\tlet n = 0;\n\t\t// Strings.\n\t\tn = input.readInt(true)\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet str = input.readString();\n\t\t\tif (!str) throw new Error(\"String in string table must not be null.\");\n\t\t\tinput.strings.push(str);\n\t\t}\n\n\t\t// Bones.\n\t\tn = input.readInt(true)\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Bone name must not be null.\");\n\t\t\tlet parent = i == 0 ? null : skeletonData.bones[input.readInt(true)];\n\t\t\tlet data = new BoneData(i, name, parent);\n\t\t\tdata.rotation = input.readFloat();\n\t\t\tdata.x = input.readFloat() * scale;\n\t\t\tdata.y = input.readFloat() * scale;\n\t\t\tdata.scaleX = input.readFloat();\n\t\t\tdata.scaleY = input.readFloat();\n\t\t\tdata.shearX = input.readFloat();\n\t\t\tdata.shearY = input.readFloat();\n\t\t\tdata.length = input.readFloat() * scale;\n\t\t\tdata.inherit = input.readByte();\n\t\t\tdata.skinRequired = input.readBoolean();\n\t\t\tif (nonessential) {\n\t\t\t\tColor.rgba8888ToColor(data.color, input.readInt32());\n\t\t\t\tdata.icon = input.readString() ?? undefined;\n\t\t\t\tdata.visible = input.readBoolean();\n\t\t\t}\n\t\t\tskeletonData.bones.push(data);\n\t\t}\n\n\t\t// Slots.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet slotName = input.readString();\n\t\t\tif (!slotName) throw new Error(\"Slot name must not be null.\");\n\t\t\tlet boneData = skeletonData.bones[input.readInt(true)];\n\t\t\tlet data = new SlotData(i, slotName, boneData);\n\t\t\tColor.rgba8888ToColor(data.color, input.readInt32());\n\n\t\t\tlet darkColor = input.readInt32();\n\t\t\tif (darkColor != -1) Color.rgb888ToColor(data.darkColor = new Color(), darkColor);\n\n\t\t\tdata.attachmentName = input.readStringRef();\n\t\t\tdata.blendMode = input.readInt(true);\n\t\t\tif (nonessential) data.visible = input.readBoolean();\n\t\t\tskeletonData.slots.push(data);\n\t\t}\n\n\t\t// IK constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"IK constraint data name must not be null.\");\n\t\t\tlet data = new IkConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tdata.bendDirection = (flags & 2) != 0 ? 1 : -1;\n\t\t\tdata.compress = (flags & 4) != 0;\n\t\t\tdata.stretch = (flags & 8) != 0;\n\t\t\tdata.uniform = (flags & 16) != 0;\n\t\t\tif ((flags & 32) != 0) data.mix = (flags & 64) != 0 ? input.readFloat() : 1;\n\t\t\tif ((flags & 128) != 0) data.softness = input.readFloat() * scale;\n\t\t\tskeletonData.ikConstraints.push(data);\n\t\t}\n\n\t\t// Transform constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Transform constraint data name must not be null.\");\n\t\t\tlet data = new TransformConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tdata.local = (flags & 2) != 0;\n\t\t\tdata.relative = (flags & 4) != 0;\n\t\t\tif ((flags & 8) != 0) data.offsetRotation = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.offsetX = input.readFloat() * scale;\n\t\t\tif ((flags & 32) != 0) data.offsetY = input.readFloat() * scale;\n\t\t\tif ((flags & 64) != 0) data.offsetScaleX = input.readFloat();\n\t\t\tif ((flags & 128) != 0) data.offsetScaleY = input.readFloat();\n\t\t\tflags = input.readByte();\n\t\t\tif ((flags & 1) != 0) data.offsetShearY = input.readFloat();\n\t\t\tif ((flags & 2) != 0) data.mixRotate = input.readFloat();\n\t\t\tif ((flags & 4) != 0) data.mixX = input.readFloat();\n\t\t\tif ((flags & 8) != 0) data.mixY = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.mixScaleX = input.readFloat();\n\t\t\tif ((flags & 32) != 0) data.mixScaleY = input.readFloat();\n\t\t\tif ((flags & 64) != 0) data.mixShearY = input.readFloat();\n\t\t\tskeletonData.transformConstraints.push(data);\n\t\t}\n\n\t\t// Path constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tlet name = input.readString();\n\t\t\tif (!name) throw new Error(\"Path constraint data name must not be null.\");\n\t\t\tlet data = new PathConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tdata.skinRequired = input.readBoolean();\n\t\t\tnn = input.readInt(true);\n\t\t\tfor (let ii = 0; ii < nn; ii++)\n\t\t\t\tdata.bones.push(skeletonData.bones[input.readInt(true)]);\n\t\t\tdata.target = skeletonData.slots[input.readInt(true)];\n\t\t\tconst flags = input.readByte();\n\t\t\tdata.positionMode = flags & 1;\n\t\t\tdata.spacingMode = (flags >> 1) & 3;\n\t\t\tdata.rotateMode = (flags >> 3) & 3;\n\t\t\tif ((flags & 128) != 0) data.offsetRotation = input.readFloat();\n\t\t\tdata.position = input.readFloat();\n\t\t\tif (data.positionMode == PositionMode.Fixed) data.position *= scale;\n\t\t\tdata.spacing = input.readFloat();\n\t\t\tif (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\n\t\t\tdata.mixRotate = input.readFloat();\n\t\t\tdata.mixX = input.readFloat();\n\t\t\tdata.mixY = input.readFloat();\n\t\t\tskeletonData.pathConstraints.push(data);\n\t\t}\n\n\t\t// Physics constraints.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0, nn; i < n; i++) {\n\t\t\tconst name = input.readString();\n\t\t\tif (!name) throw new Error(\"Physics constraint data name must not be null.\");\n\t\t\tconst data = new PhysicsConstraintData(name);\n\t\t\tdata.order = input.readInt(true);\n\t\t\tdata.bone = skeletonData.bones[input.readInt(true)];\n\t\t\tlet flags = input.readByte();\n\t\t\tdata.skinRequired = (flags & 1) != 0;\n\t\t\tif ((flags & 2) != 0) data.x = input.readFloat();\n\t\t\tif ((flags & 4) != 0) data.y = input.readFloat();\n\t\t\tif ((flags & 8) != 0) data.rotate = input.readFloat();\n\t\t\tif ((flags & 16) != 0) data.scaleX = input.readFloat();\n\t\t\tif ((flags & 32) != 0) data.shearX = input.readFloat();\n\t\t\tdata.limit = ((flags & 64) != 0 ? input.readFloat() : 5000) * scale;\n\t\t\tdata.step = 1 / input.readUnsignedByte();\n\t\t\tdata.inertia = input.readFloat();\n\t\t\tdata.strength = input.readFloat();\n\t\t\tdata.damping = input.readFloat();\n\t\t\tdata.massInverse = (flags & 128) != 0 ? input.readFloat() : 1;\n\t\t\tdata.wind = input.readFloat();\n\t\t\tdata.gravity = input.readFloat();\n\t\t\tflags = input.readByte();\n\t\t\tif ((flags & 1) != 0) data.inertiaGlobal = true;\n\t\t\tif ((flags & 2) != 0) data.strengthGlobal = true;\n\t\t\tif ((flags & 4) != 0) data.dampingGlobal = true;\n\t\t\tif ((flags & 8) != 0) data.massGlobal = true;\n\t\t\tif ((flags & 16) != 0) data.windGlobal = true;\n\t\t\tif ((flags & 32) != 0) data.gravityGlobal = true;\n\t\t\tif ((flags & 64) != 0) data.mixGlobal = true;\n\t\t\tdata.mix = (flags & 128) != 0 ? input.readFloat() : 1;\n\t\t\tskeletonData.physicsConstraints.push(data);\n\t\t}\n\n\t\t// Default skin.\n\t\tlet defaultSkin = this.readSkin(input, skeletonData, true, nonessential);\n\t\tif (defaultSkin) {\n\t\t\tskeletonData.defaultSkin = defaultSkin;\n\t\t\tskeletonData.skins.push(defaultSkin);\n\t\t}\n\n\t\t// Skins.\n\t\t{\n\t\t\tlet i = skeletonData.skins.length;\n\t\t\tUtils.setArraySize(skeletonData.skins, n = i + input.readInt(true));\n\t\t\tfor (; i < n; i++) {\n\t\t\t\tlet skin = this.readSkin(input, skeletonData, false, nonessential);\n\t\t\t\tif (!skin) throw new Error(\"readSkin() should not have returned null.\");\n\t\t\t\tskeletonData.skins[i] = skin;\n\t\t\t}\n\t\t}\n\n\t\t// Linked meshes.\n\t\tn = this.linkedMeshes.length;\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet linkedMesh = this.linkedMeshes[i];\n\t\t\tconst skin = skeletonData.skins[linkedMesh.skinIndex];\n\t\t\tif (!linkedMesh.parent) throw new Error(\"Linked mesh parent must not be null\");\n\t\t\tlet parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n\t\t\tif (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);\n\t\t\tlinkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent as VertexAttachment : linkedMesh.mesh;\n\t\t\tlinkedMesh.mesh.setParentMesh(parent as MeshAttachment);\n\t\t\tif (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\n\t\t}\n\t\tthis.linkedMeshes.length = 0;\n\n\t\t// Events.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet eventName = input.readString();\n\t\t\tif (!eventName) throw new Error(\"Event data name must not be null\");\n\t\t\tlet data = new EventData(eventName);\n\t\t\tdata.intValue = input.readInt(false);\n\t\t\tdata.floatValue = input.readFloat();\n\t\t\tdata.stringValue = input.readString();\n\t\t\tdata.audioPath = input.readString();\n\t\t\tif (data.audioPath) {\n\t\t\t\tdata.volume = input.readFloat();\n\t\t\t\tdata.balance = input.readFloat();\n\t\t\t}\n\t\t\tskeletonData.events.push(data);\n\t\t}\n\n\t\t// Animations.\n\t\tn = input.readInt(true);\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tlet animationName = input.readString();\n\t\t\tif (!animationName) throw new Error(\"Animatio name must not be null.\");\n\t\t\tskeletonData.animations.push(this.readAnimation(input, animationName, skeletonData));\n\t\t}\n\t\treturn skeletonData;\n\t}\n\n\tprivate readSkin (input: BinaryInput, skeletonData: SkeletonData, defaultSkin: boolean, nonessential: boolean): Skin | null {\n\t\tlet skin = null;\n\t\tlet slotCount = 0;\n\n\t\tif (defaultSkin) {\n\t\t\tslotCount = input.readInt(true)\n\t\t\tif (slotCount == 0) return null;\n\t\t\tskin = new Skin(\"default\");\n\t\t} else {\n\t\t\tlet skinName = input.readString();\n\t\t\tif (!skinName) throw new Error(\"Skin name must not be null.\");\n\t\t\tskin = new Skin(skinName);\n\t\t\tif (nonessential) Color.rgba8888ToColor(skin.color, input.readInt32());\n\t\t\tskin.bones.length = input.readInt(true);\n\t\t\tfor (let i = 0, n = skin.bones.length; i < n; i++)\n\t\t\t\tskin.bones[i] = skeletonData.bones[input.readInt(true)];\n\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);\n\t\t\tfor (let i = 0, n = input.readInt(true); i < n; i++)\n\t\t\t\tskin.constraints.push(skeletonData.physicsConstraints[input.readInt(true)]);\n\n\t\t\tslotCount = input.readInt(true);\n\t\t}\n\n\t\tfor (let i = 0; i < slotCount; i++) {\n\t\t\tlet slotIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet name = input.readStringRef();\n\t\t\t\tif (!name)\n\t\t\t\t\tthrow new Error(\"Attachment name must not be null\");\n\t\t\t\tlet attachment = this.readAttachment(input, skeletonData, skin, slotIndex, name, nonessential);\n\t\t\t\tif (attachment) skin.setAttachment(slotIndex, name, attachment);\n\t\t\t}\n\t\t}\n\t\treturn skin;\n\t}\n\n\tprivate readAttachment (input: BinaryInput, skeletonData: SkeletonData, skin: Skin, slotIndex: number, attachmentName: string | null | undefined, nonessential: boolean): Attachment | null {\n\t\tlet scale = this.scale;\n\n\t\tlet flags = input.readByte();\n\t\tconst name = (flags & 8) != 0 ? input.readStringRef() : attachmentName;\n\t\tif (!name) throw new Error(\"Attachment name must not be null\");\n\t\tswitch ((flags & 0b111) as AttachmentType) { // BUG?\n\t\t\tcase AttachmentType.Region: {\n\t\t\t\tlet path = (flags & 16) != 0 ? input.readStringRef() : null;\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tlet rotation = (flags & 128) != 0 ? input.readFloat() : 0;\n\t\t\t\tlet x = input.readFloat();\n\t\t\t\tlet y = input.readFloat();\n\t\t\t\tlet scaleX = input.readFloat();\n\t\t\t\tlet scaleY = input.readFloat();\n\t\t\t\tlet width = input.readFloat();\n\t\t\t\tlet height = input.readFloat();\n\n\t\t\t\tif (!path) path = name;\n\t\t\t\tlet region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\n\t\t\t\tif (!region) return null;\n\t\t\t\tregion.path = path;\n\t\t\t\tregion.x = x * scale;\n\t\t\t\tregion.y = y * scale;\n\t\t\t\tregion.scaleX = scaleX;\n\t\t\t\tregion.scaleY = scaleY;\n\t\t\t\tregion.rotation = rotation;\n\t\t\t\tregion.width = width * scale;\n\t\t\t\tregion.height = height * scale;\n\t\t\t\tColor.rgba8888ToColor(region.color, color);\n\t\t\t\tregion.sequence = sequence;\n\t\t\t\tif (sequence == null) region.updateRegion();\n\t\t\t\treturn region;\n\t\t\t}\n\t\t\tcase AttachmentType.BoundingBox: {\n\t\t\t\tlet vertices = this.readVertices(input, (flags & 16) != 0);\n\t\t\t\tlet color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tlet box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n\t\t\t\tif (!box) return null;\n\t\t\t\tbox.worldVerticesLength = vertices.length;\n\t\t\t\tbox.vertices = vertices.vertices!;\n\t\t\t\tbox.bones = vertices.bones;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(box.color, color);\n\t\t\t\treturn box;\n\t\t\t}\n\t\t\tcase AttachmentType.Mesh: {\n\t\t\t\tlet path = (flags & 16) != 0 ? input.readStringRef() : name;\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tconst hullLength = input.readInt(true);\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 128) != 0);\n\t\t\t\tconst uvs = this.readFloatArray(input, vertices.length, 1);\n\t\t\t\tconst triangles = this.readShortArray(input, (vertices.length - hullLength - 2) * 3);\n\t\t\t\tlet edges: number[] = [];\n\t\t\t\tlet width = 0, height = 0;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tedges = this.readShortArray(input, input.readInt(true));\n\t\t\t\t\twidth = input.readFloat();\n\t\t\t\t\theight = input.readFloat();\n\t\t\t\t}\n\n\t\t\t\tif (!path) path = name;\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\t\t\t\tColor.rgba8888ToColor(mesh.color, color);\n\t\t\t\tmesh.bones = vertices.bones;\n\t\t\t\tmesh.vertices = vertices.vertices!;\n\t\t\t\tmesh.worldVerticesLength = vertices.length;\n\t\t\t\tmesh.triangles = triangles;\n\t\t\t\tmesh.regionUVs = uvs;\n\t\t\t\tif (sequence == null) mesh.updateRegion();\n\t\t\t\tmesh.hullLength = hullLength << 1;\n\t\t\t\tmesh.sequence = sequence;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tmesh.edges = edges;\n\t\t\t\t\tmesh.width = width * scale;\n\t\t\t\t\tmesh.height = height * scale;\n\t\t\t\t}\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase AttachmentType.LinkedMesh: {\n\t\t\t\tconst path = (flags & 16) != 0 ? input.readStringRef() : name;\n\t\t\t\tif (path == null) throw new Error(\"Path of linked mesh must not be null\");\n\t\t\t\tconst color = (flags & 32) != 0 ? input.readInt32() : 0xffffffff;\n\t\t\t\tconst sequence = (flags & 64) != 0 ? this.readSequence(input) : null;\n\t\t\t\tconst inheritTimelines = (flags & 128) != 0;\n\t\t\t\tconst skinIndex = input.readInt(true);\n\t\t\t\tconst parent = input.readStringRef();\n\t\t\t\tlet width = 0, height = 0;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\twidth = input.readFloat();\n\t\t\t\t\theight = input.readFloat();\n\t\t\t\t}\n\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\t\t\t\tColor.rgba8888ToColor(mesh.color, color);\n\t\t\t\tmesh.sequence = sequence;\n\t\t\t\tif (nonessential) {\n\t\t\t\t\tmesh.width = width * scale;\n\t\t\t\t\tmesh.height = height * scale;\n\t\t\t\t}\n\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, skinIndex, slotIndex, parent, inheritTimelines));\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase AttachmentType.Path: {\n\t\t\t\tconst closed = (flags & 16) != 0;\n\t\t\t\tconst constantSpeed = (flags & 32) != 0;\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 64) != 0);\n\n\t\t\t\tconst lengths = Utils.newArray(vertices.length / 6, 0);\n\t\t\t\tfor (let i = 0, n = lengths.length; i < n; i++)\n\t\t\t\t\tlengths[i] = input.readFloat() * scale;\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst path = this.attachmentLoader.newPathAttachment(skin, name);\n\t\t\t\tif (!path) return null;\n\t\t\t\tpath.closed = closed;\n\t\t\t\tpath.constantSpeed = constantSpeed;\n\t\t\t\tpath.worldVerticesLength = vertices.length;\n\t\t\t\tpath.vertices = vertices.vertices!;\n\t\t\t\tpath.bones = vertices.bones;\n\t\t\t\tpath.lengths = lengths;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(path.color, color);\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tcase AttachmentType.Point: {\n\t\t\t\tconst rotation = input.readFloat();\n\t\t\t\tconst x = input.readFloat();\n\t\t\t\tconst y = input.readFloat();\n\t\t\t\tconst color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tconst point = this.attachmentLoader.newPointAttachment(skin, name);\n\t\t\t\tif (!point) return null;\n\t\t\t\tpoint.x = x * scale;\n\t\t\t\tpoint.y = y * scale;\n\t\t\t\tpoint.rotation = rotation;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(point.color, color);\n\t\t\t\treturn point;\n\t\t\t}\n\t\t\tcase AttachmentType.Clipping: {\n\t\t\t\tconst endSlotIndex = input.readInt(true);\n\t\t\t\tconst vertices = this.readVertices(input, (flags & 16) != 0);\n\t\t\t\tlet color = nonessential ? input.readInt32() : 0;\n\n\t\t\t\tlet clip = this.attachmentLoader.newClippingAttachment(skin, name);\n\t\t\t\tif (!clip) return null;\n\t\t\t\tclip.endSlot = skeletonData.slots[endSlotIndex];\n\t\t\t\tclip.worldVerticesLength = vertices.length;\n\t\t\t\tclip.vertices = vertices.vertices!;\n\t\t\t\tclip.bones = vertices.bones;\n\t\t\t\tif (nonessential) Color.rgba8888ToColor(clip.color, color);\n\t\t\t\treturn clip;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tprivate readSequence (input: BinaryInput) {\n\t\tlet sequence = new Sequence(input.readInt(true));\n\t\tsequence.start = input.readInt(true);\n\t\tsequence.digits = input.readInt(true);\n\t\tsequence.setupIndex = input.readInt(true);\n\t\treturn sequence;\n\t}\n\n\tprivate readVertices (input: BinaryInput, weighted: boolean): Vertices {\n\t\tconst scale = this.scale;\n\t\tconst vertexCount = input.readInt(true);\n\t\tconst vertices = new Vertices();\n\t\tvertices.length = vertexCount << 1;\n\t\tif (!weighted) {\n\t\t\tvertices.vertices = this.readFloatArray(input, vertices.length, scale);\n\t\t\treturn vertices;\n\t\t}\n\t\tlet weights = new Array();\n\t\tlet bonesArray = new Array();\n\t\tfor (let i = 0; i < vertexCount; i++) {\n\t\t\tlet boneCount = input.readInt(true);\n\t\t\tbonesArray.push(boneCount);\n\t\t\tfor (let ii = 0; ii < boneCount; ii++) {\n\t\t\t\tbonesArray.push(input.readInt(true));\n\t\t\t\tweights.push(input.readFloat() * scale);\n\t\t\t\tweights.push(input.readFloat() * scale);\n\t\t\t\tweights.push(input.readFloat());\n\t\t\t}\n\t\t}\n\t\tvertices.vertices = Utils.toFloatArray(weights);\n\t\tvertices.bones = bonesArray;\n\t\treturn vertices;\n\t}\n\n\tprivate readFloatArray (input: BinaryInput, n: number, scale: number): number[] {\n\t\tlet array = new Array(n);\n\t\tif (scale == 1) {\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tarray[i] = input.readFloat();\n\t\t} else {\n\t\t\tfor (let i = 0; i < n; i++)\n\t\t\t\tarray[i] = input.readFloat() * scale;\n\t\t}\n\t\treturn array;\n\t}\n\n\tprivate readShortArray (input: BinaryInput, n: number): number[] {\n\t\tlet array = new Array(n);\n\t\tfor (let i = 0; i < n; i++)\n\t\t\tarray[i] = input.readInt(true);\n\t\treturn array;\n\t}\n\n\tprivate readAnimation (input: BinaryInput, name: string, skeletonData: SkeletonData): Animation {\n\t\tinput.readInt(true); // Number of timelines.\n\t\tlet timelines = new Array();\n\t\tlet scale = this.scale;\n\n\t\t// Slot timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet slotIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet timelineType = input.readByte();\n\t\t\t\tlet frameCount = input.readInt(true);\n\t\t\t\tlet frameLast = frameCount - 1;\n\t\t\t\tswitch (timelineType) {\n\t\t\t\t\tcase SLOT_ATTACHMENT: {\n\t\t\t\t\t\tlet timeline = new AttachmentTimeline(frameCount, slotIndex);\n\t\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++)\n\t\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat(), input.readStringRef());\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGBA: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBATimeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet a = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, a);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet a2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, a, a2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = r2;\n\t\t\t\t\t\t\tg = g2;\n\t\t\t\t\t\t\tb = b2;\n\t\t\t\t\t\t\ta = a2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGB: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBTimeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, r2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, g2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, b2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = r2;\n\t\t\t\t\t\t\tg = g2;\n\t\t\t\t\t\t\tb = b2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGBA2: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGBA2Timeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet a = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, a, r2, g2, b2);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet nr = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet na = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nr2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, a, na, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, r2, nr2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, g2, ng2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 6, time, time2, b2, nb2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = nr;\n\t\t\t\t\t\t\tg = ng;\n\t\t\t\t\t\t\tb = nb;\n\t\t\t\t\t\t\ta = na;\n\t\t\t\t\t\t\tr2 = nr2;\n\t\t\t\t\t\t\tg2 = ng2;\n\t\t\t\t\t\t\tb2 = nb2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_RGB2: {\n\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\tlet timeline = new RGB2Timeline(frameCount, bezierCount, slotIndex);\n\n\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\tlet r = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet r2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet g2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\tlet b2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, r, g, b, r2, g2, b2);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet nr = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nr2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet ng2 = input.readUnsignedByte() / 255.0;\n\t\t\t\t\t\t\tlet nb2 = input.readUnsignedByte() / 255.0;\n\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, r, nr, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, g, ng, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, b, nb, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, r2, nr2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, g2, ng2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, b2, nb2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tr = nr;\n\t\t\t\t\t\t\tg = ng;\n\t\t\t\t\t\t\tb = nb;\n\t\t\t\t\t\t\tr2 = nr2;\n\t\t\t\t\t\t\tg2 = ng2;\n\t\t\t\t\t\t\tb2 = nb2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase SLOT_ALPHA: {\n\t\t\t\t\t\tlet timeline = new AlphaTimeline(frameCount, input.readInt(true), slotIndex);\n\t\t\t\t\t\tlet time = input.readFloat(), a = input.readUnsignedByte() / 255;\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, a);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\tlet a2 = input.readUnsignedByte() / 255;\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, a, a2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\ta = a2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bone timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet boneIndex = input.readInt(true);\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet type = input.readByte(), frameCount = input.readInt(true);\n\t\t\t\tif (type == BONE_INHERIT) {\n\t\t\t\t\tlet timeline = new InheritTimeline(frameCount, boneIndex);\n\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++) {\n\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat(), input.readByte());\n\t\t\t\t\t}\n\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase BONE_ROTATE:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATE:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATEX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_TRANSLATEY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALE:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALEX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SCALEY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEAR:\n\t\t\t\t\t\ttimelines.push(readTimeline2(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEARX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase BONE_SHEARY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// IK constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\n\t\t\tlet timeline = new IkConstraintTimeline(frameCount, input.readInt(true), index);\n\t\t\tlet flags = input.readByte();\n\t\t\tlet time = input.readFloat(), mix = (flags & 1) != 0 ? ((flags & 2) != 0 ? input.readFloat() : 1) : 0;\n\t\t\tlet softness = (flags & 4) != 0 ? input.readFloat() * scale : 0;\n\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\ttimeline.setFrame(frame, time, mix, softness, (flags & 8) != 0 ? 1 : -1, (flags & 16) != 0, (flags & 32) != 0);\n\t\t\t\tif (frame == frameLast) break;\n\t\t\t\tflags = input.readByte();\n\t\t\t\tconst time2 = input.readFloat(), mix2 = (flags & 1) != 0 ? ((flags & 2) != 0 ? input.readFloat() : 1) : 0;\n\t\t\t\tconst softness2 = (flags & 4) != 0 ? input.readFloat() * scale : 0;\n\t\t\t\tif ((flags & 64) != 0) {\n\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t} else if ((flags & 128) != 0) {\n\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mix, mix2, 1);\n\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, softness, softness2, scale);\n\t\t\t\t}\n\t\t\t\ttime = time2;\n\t\t\t\tmix = mix2;\n\t\t\t\tsoftness = softness2;\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Transform constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true), frameCount = input.readInt(true), frameLast = frameCount - 1;\n\t\t\tlet timeline = new TransformConstraintTimeline(frameCount, input.readInt(true), index);\n\t\t\tlet time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat(),\n\t\t\t\tmixScaleX = input.readFloat(), mixScaleY = input.readFloat(), mixShearY = input.readFloat();\n\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\n\t\t\t\tif (frame == frameLast) break;\n\t\t\t\tlet time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(), mixY2 = input.readFloat(),\n\t\t\t\t\tmixScaleX2 = input.readFloat(), mixScaleY2 = input.readFloat(), mixShearY2 = input.readFloat();\n\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\n\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 5, time, time2, mixShearY, mixShearY2, 1);\n\t\t\t\t}\n\t\t\t\ttime = time2;\n\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\tmixX = mixX2;\n\t\t\t\tmixY = mixY2;\n\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\tmixScaleY = mixScaleY2;\n\t\t\t\tmixShearY = mixShearY2;\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Path constraint timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet index = input.readInt(true);\n\t\t\tlet data = skeletonData.pathConstraints[index];\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase PATH_POSITION:\n\t\t\t\t\t\ttimelines\n\t\t\t\t\t\t\t.push(readTimeline1(input, new PathConstraintPositionTimeline(frameCount, bezierCount, index),\n\t\t\t\t\t\t\t\tdata.positionMode == PositionMode.Fixed ? scale : 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PATH_SPACING:\n\t\t\t\t\t\ttimelines\n\t\t\t\t\t\t\t.push(readTimeline1(input, new PathConstraintSpacingTimeline(frameCount, bezierCount, index),\n\t\t\t\t\t\t\t\tdata.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed ? scale : 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PATH_MIX:\n\t\t\t\t\t\tlet timeline = new PathConstraintMixTimeline(frameCount, bezierCount, index);\n\t\t\t\t\t\tlet time = input.readFloat(), mixRotate = input.readFloat(), mixX = input.readFloat(), mixY = input.readFloat();\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY);\n\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\tlet time2 = input.readFloat(), mixRotate2 = input.readFloat(), mixX2 = input.readFloat(),\n\t\t\t\t\t\t\t\tmixY2 = input.readFloat();\n\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Physics timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tconst index = input.readInt(true) - 1;\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tconst type = input.readByte(), frameCount = input.readInt(true);\n\t\t\t\tif (type == PHYSICS_RESET) {\n\t\t\t\t\tconst timeline = new PhysicsConstraintResetTimeline(frameCount, index);\n\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++)\n\t\t\t\t\t\ttimeline.setFrame(frame, input.readFloat());\n\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst bezierCount = input.readInt(true);\n\t\t\t\tswitch (type) {\n\t\t\t\t\tcase PHYSICS_INERTIA:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_STRENGTH:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_DAMPING:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_MASS:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_WIND:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_GRAVITY:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase PHYSICS_MIX:\n\t\t\t\t\t\ttimelines.push(readTimeline1(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, index), 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Deform timelines.\n\t\tfor (let i = 0, n = input.readInt(true); i < n; i++) {\n\t\t\tlet skin = skeletonData.skins[input.readInt(true)];\n\t\t\tfor (let ii = 0, nn = input.readInt(true); ii < nn; ii++) {\n\t\t\t\tlet slotIndex = input.readInt(true);\n\t\t\t\tfor (let iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {\n\t\t\t\t\tlet attachmentName = input.readStringRef();\n\t\t\t\t\tif (!attachmentName) throw new Error(\"attachmentName must not be null.\");\n\t\t\t\t\tlet attachment = skin.getAttachment(slotIndex, attachmentName);\n\t\t\t\t\tlet timelineType = input.readByte();\n\t\t\t\t\tlet frameCount = input.readInt(true);\n\t\t\t\t\tlet frameLast = frameCount - 1;\n\n\t\t\t\t\tswitch (timelineType) {\n\t\t\t\t\t\tcase ATTACHMENT_DEFORM: {\n\t\t\t\t\t\t\tlet vertexAttachment = attachment as VertexAttachment;\n\t\t\t\t\t\t\tlet weighted = vertexAttachment.bones;\n\t\t\t\t\t\t\tlet vertices = vertexAttachment.vertices;\n\t\t\t\t\t\t\tlet deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n\n\t\t\t\t\t\t\tlet bezierCount = input.readInt(true);\n\t\t\t\t\t\t\tlet timeline = new DeformTimeline(frameCount, bezierCount, slotIndex, vertexAttachment);\n\n\t\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\tlet deform;\n\t\t\t\t\t\t\t\tlet end = input.readInt(true);\n\t\t\t\t\t\t\t\tif (end == 0)\n\t\t\t\t\t\t\t\t\tdeform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tdeform = Utils.newFloatArray(deformLength);\n\t\t\t\t\t\t\t\t\tlet start = input.readInt(true);\n\t\t\t\t\t\t\t\t\tend += start;\n\t\t\t\t\t\t\t\t\tif (scale == 1) {\n\t\t\t\t\t\t\t\t\t\tfor (let v = start; v < end; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] = input.readFloat();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tfor (let v = start; v < end; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] = input.readFloat() * scale;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif (!weighted) {\n\t\t\t\t\t\t\t\t\t\tfor (let v = 0, vn = deform.length; v < vn; v++)\n\t\t\t\t\t\t\t\t\t\t\tdeform[v] += vertices[v];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, deform);\n\t\t\t\t\t\t\t\tif (frame == frameLast) break;\n\t\t\t\t\t\t\t\tlet time2 = input.readFloat();\n\t\t\t\t\t\t\t\tswitch (input.readByte()) {\n\t\t\t\t\t\t\t\t\tcase CURVE_STEPPED:\n\t\t\t\t\t\t\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\tcase CURVE_BEZIER:\n\t\t\t\t\t\t\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, 0, 1, 1);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcase ATTACHMENT_SEQUENCE: {\n\t\t\t\t\t\t\tlet timeline = new SequenceTimeline(frameCount, slotIndex, attachment as unknown as HasTextureRegion);\n\t\t\t\t\t\t\tfor (let frame = 0; frame < frameCount; frame++) {\n\t\t\t\t\t\t\t\tlet time = input.readFloat();\n\t\t\t\t\t\t\t\tlet modeAndIndex = input.readInt32();\n\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, SequenceModeValues[modeAndIndex & 0xf], modeAndIndex >> 4,\n\t\t\t\t\t\t\t\t\tinput.readFloat());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw order timeline.\n\t\tlet drawOrderCount = input.readInt(true);\n\t\tif (drawOrderCount > 0) {\n\t\t\tlet timeline = new DrawOrderTimeline(drawOrderCount);\n\t\t\tlet slotCount = skeletonData.slots.length;\n\t\t\tfor (let i = 0; i < drawOrderCount; i++) {\n\t\t\t\tlet time = input.readFloat();\n\t\t\t\tlet offsetCount = input.readInt(true);\n\t\t\t\tlet drawOrder = Utils.newArray(slotCount, 0);\n\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tdrawOrder[ii] = -1;\n\t\t\t\tlet unchanged = Utils.newArray(slotCount - offsetCount, 0);\n\t\t\t\tlet originalIndex = 0, unchangedIndex = 0;\n\t\t\t\tfor (let ii = 0; ii < offsetCount; ii++) {\n\t\t\t\t\tlet slotIndex = input.readInt(true);\n\t\t\t\t\t// Collect unchanged items.\n\t\t\t\t\twhile (originalIndex != slotIndex)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t// Set changed items.\n\t\t\t\t\tdrawOrder[originalIndex + input.readInt(true)] = originalIndex++;\n\t\t\t\t}\n\t\t\t\t// Collect remaining unchanged items.\n\t\t\t\twhile (originalIndex < slotCount)\n\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t// Fill in unchanged items.\n\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\tif (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex];\n\t\t\t\ttimeline.setFrame(i, time, drawOrder);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Event timeline.\n\t\tlet eventCount = input.readInt(true);\n\t\tif (eventCount > 0) {\n\t\t\tlet timeline = new EventTimeline(eventCount);\n\t\t\tfor (let i = 0; i < eventCount; i++) {\n\t\t\t\tlet time = input.readFloat();\n\t\t\t\tlet eventData = skeletonData.events[input.readInt(true)];\n\t\t\t\tlet event = new Event(time, eventData);\n\t\t\t\tevent.intValue = input.readInt(false);\n\t\t\t\tevent.floatValue = input.readFloat();\n\t\t\t\tevent.stringValue = input.readString();\n\t\t\t\tif (event.stringValue == null) event.stringValue = eventData.stringValue;\n\t\t\t\tif (event.data.audioPath) {\n\t\t\t\t\tevent.volume = input.readFloat();\n\t\t\t\t\tevent.balance = input.readFloat();\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(i, event);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\tlet duration = 0;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\tduration = Math.max(duration, timelines[i].getDuration());\n\t\treturn new Animation(name, timelines, duration);\n\t}\n}\n\nexport class BinaryInput {\n\tconstructor (data: Uint8Array | ArrayBuffer, public strings = new Array(), private index: number = 0, private buffer = new DataView(data instanceof ArrayBuffer ? data : data.buffer)) {\n\t}\n\n\treadByte (): number {\n\t\treturn this.buffer.getInt8(this.index++);\n\t}\n\n\treadUnsignedByte (): number {\n\t\treturn this.buffer.getUint8(this.index++);\n\t}\n\n\treadShort (): number {\n\t\tlet value = this.buffer.getInt16(this.index);\n\t\tthis.index += 2;\n\t\treturn value;\n\t}\n\n\treadInt32 (): number {\n\t\tlet value = this.buffer.getInt32(this.index)\n\t\tthis.index += 4;\n\t\treturn value;\n\t}\n\n\treadInt (optimizePositive: boolean) {\n\t\tlet b = this.readByte();\n\t\tlet result = b & 0x7F;\n\t\tif ((b & 0x80) != 0) {\n\t\t\tb = this.readByte();\n\t\t\tresult |= (b & 0x7F) << 7;\n\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\tb = this.readByte();\n\t\t\t\tresult |= (b & 0x7F) << 14;\n\t\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\t\tb = this.readByte();\n\t\t\t\t\tresult |= (b & 0x7F) << 21;\n\t\t\t\t\tif ((b & 0x80) != 0) {\n\t\t\t\t\t\tb = this.readByte();\n\t\t\t\t\t\tresult |= (b & 0x7F) << 28;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn optimizePositive ? result : ((result >>> 1) ^ -(result & 1));\n\t}\n\n\treadStringRef (): string | null {\n\t\tlet index = this.readInt(true);\n\t\treturn index == 0 ? null : this.strings[index - 1];\n\t}\n\n\treadString (): string | null {\n\t\tlet byteCount = this.readInt(true);\n\t\tswitch (byteCount) {\n\t\t\tcase 0:\n\t\t\t\treturn null;\n\t\t\tcase 1:\n\t\t\t\treturn \"\";\n\t\t}\n\t\tbyteCount--;\n\t\tlet chars = \"\";\n\t\tlet charCount = 0;\n\t\tfor (let i = 0; i < byteCount;) {\n\t\t\tlet b = this.readUnsignedByte();\n\t\t\tswitch (b >> 4) {\n\t\t\t\tcase 12:\n\t\t\t\tcase 13:\n\t\t\t\t\tchars += String.fromCharCode(((b & 0x1F) << 6 | this.readByte() & 0x3F));\n\t\t\t\t\ti += 2;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 14:\n\t\t\t\t\tchars += String.fromCharCode(((b & 0x0F) << 12 | (this.readByte() & 0x3F) << 6 | this.readByte() & 0x3F));\n\t\t\t\t\ti += 3;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tchars += String.fromCharCode(b);\n\t\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t\treturn chars;\n\t}\n\n\treadFloat (): number {\n\t\tlet value = this.buffer.getFloat32(this.index);\n\t\tthis.index += 4;\n\t\treturn value;\n\t}\n\n\treadBoolean (): boolean {\n\t\treturn this.readByte() != 0;\n\t}\n}\n\nclass LinkedMesh {\n\tparent: string | null; skinIndex: number;\n\tslotIndex: number;\n\tmesh: MeshAttachment;\n\tinheritTimeline: boolean;\n\n\tconstructor (mesh: MeshAttachment, skinIndex: number, slotIndex: number, parent: string | null, inheritDeform: boolean) {\n\t\tthis.mesh = mesh;\n\t\tthis.skinIndex = skinIndex;\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.parent = parent;\n\t\tthis.inheritTimeline = inheritDeform;\n\t}\n}\n\nclass Vertices {\n\tconstructor (public bones: Array | null = null, public vertices: Array | Float32Array | null = null, public length: number = 0) { }\n}\n\nenum AttachmentType { Region, BoundingBox, Mesh, LinkedMesh, Path, Point, Clipping }\n\nfunction readTimeline1 (input: BinaryInput, timeline: CurveTimeline1, scale: number): CurveTimeline1 {\n\tlet time = input.readFloat(), value = input.readFloat() * scale;\n\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value);\n\t\tif (frame == frameLast) break;\n\t\tlet time2 = input.readFloat(), value2 = input.readFloat() * scale;\n\t\tswitch (input.readByte()) {\n\t\t\tcase CURVE_STEPPED:\n\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\tbreak;\n\t\t\tcase CURVE_BEZIER:\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue = value2;\n\t}\n\treturn timeline;\n}\n\nfunction readTimeline2 (input: BinaryInput, timeline: CurveTimeline2, scale: number): CurveTimeline2 {\n\tlet time = input.readFloat(), value1 = input.readFloat() * scale, value2 = input.readFloat() * scale;\n\tfor (let frame = 0, bezier = 0, frameLast = timeline.getFrameCount() - 1; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value1, value2);\n\t\tif (frame == frameLast) break;\n\t\tlet time2 = input.readFloat(), nvalue1 = input.readFloat() * scale, nvalue2 = input.readFloat() * scale;\n\t\tswitch (input.readByte()) {\n\t\t\tcase CURVE_STEPPED:\n\t\t\t\ttimeline.setStepped(frame);\n\t\t\t\tbreak;\n\t\t\tcase CURVE_BEZIER:\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);\n\t\t\t\tsetBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue1 = nvalue1;\n\t\tvalue2 = nvalue2;\n\t}\n\treturn timeline;\n}\n\nfunction setBezier (input: BinaryInput, timeline: CurveTimeline, bezier: number, frame: number, value: number,\n\ttime1: number, time2: number, value1: number, value2: number, scale: number) {\n\ttimeline.setBezier(bezier, frame, value, time1, value1, input.readFloat(), input.readFloat() * scale, input.readFloat(), input.readFloat() * scale, time2, value2);\n}\n\nconst BONE_ROTATE = 0;\nconst BONE_TRANSLATE = 1;\nconst BONE_TRANSLATEX = 2;\nconst BONE_TRANSLATEY = 3;\nconst BONE_SCALE = 4;\nconst BONE_SCALEX = 5;\nconst BONE_SCALEY = 6;\nconst BONE_SHEAR = 7;\nconst BONE_SHEARX = 8;\nconst BONE_SHEARY = 9;\nconst BONE_INHERIT = 10;\n\nconst SLOT_ATTACHMENT = 0;\nconst SLOT_RGBA = 1;\nconst SLOT_RGB = 2;\nconst SLOT_RGBA2 = 3;\nconst SLOT_RGB2 = 4;\nconst SLOT_ALPHA = 5;\n\nconst ATTACHMENT_DEFORM = 0;\nconst ATTACHMENT_SEQUENCE = 1;\n\nconst PATH_POSITION = 0;\nconst PATH_SPACING = 1;\nconst PATH_MIX = 2;\n\nconst PHYSICS_INERTIA = 0;\nconst PHYSICS_STRENGTH = 1;\nconst PHYSICS_DAMPING = 2;\nconst PHYSICS_MASS = 4;\nconst PHYSICS_WIND = 5;\nconst PHYSICS_GRAVITY = 6;\nconst PHYSICS_MIX = 7;\nconst PHYSICS_RESET = 8;\n\nconst CURVE_LINEAR = 0;\nconst CURVE_STEPPED = 1;\nconst CURVE_BEZIER = 2;\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BoundingBoxAttachment } from \"./attachments/BoundingBoxAttachment.js\";\nimport { Skeleton } from \"./Skeleton.js\";\nimport { NumberArrayLike, Pool, Utils } from \"./Utils.js\";\n\n/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are\n * provided along with convenience methods for doing hit detection. */\nexport class SkeletonBounds {\n\n\t/** The left edge of the axis aligned bounding box. */\n\tminX = 0;\n\n\t/** The bottom edge of the axis aligned bounding box. */\n\tminY = 0;\n\n\t/** The right edge of the axis aligned bounding box. */\n\tmaxX = 0;\n\n\t/** The top edge of the axis aligned bounding box. */\n\tmaxY = 0;\n\n\t/** The visible bounding boxes. */\n\tboundingBoxes = new Array();\n\n\t/** The world vertices for the bounding box polygons. */\n\tpolygons = new Array();\n\n\tprivate polygonPool = new Pool(() => {\n\t\treturn Utils.newFloatArray(16);\n\t});\n\n\t/** Clears any previous polygons, finds all visible bounding box attachments, and computes the world vertices for each bounding\n\t * box's polygon.\n\t * @param updateAabb If true, the axis aligned bounding box containing all the polygons is computed. If false, the\n\t * SkeletonBounds AABB methods will always return true. */\n\tupdate (skeleton: Skeleton, updateAabb: boolean) {\n\t\tif (!skeleton) throw new Error(\"skeleton cannot be null.\");\n\t\tlet boundingBoxes = this.boundingBoxes;\n\t\tlet polygons = this.polygons;\n\t\tlet polygonPool = this.polygonPool;\n\t\tlet slots = skeleton.slots;\n\t\tlet slotCount = slots.length;\n\n\t\tboundingBoxes.length = 0;\n\t\tpolygonPool.freeAll(polygons);\n\t\tpolygons.length = 0;\n\n\t\tfor (let i = 0; i < slotCount; i++) {\n\t\t\tlet slot = slots[i];\n\t\t\tif (!slot.bone.active) continue;\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (attachment instanceof BoundingBoxAttachment) {\n\t\t\t\tlet boundingBox = attachment as BoundingBoxAttachment;\n\t\t\t\tboundingBoxes.push(boundingBox);\n\n\t\t\t\tlet polygon = polygonPool.obtain();\n\t\t\t\tif (polygon.length != boundingBox.worldVerticesLength) {\n\t\t\t\t\tpolygon = Utils.newFloatArray(boundingBox.worldVerticesLength);\n\t\t\t\t}\n\t\t\t\tpolygons.push(polygon);\n\t\t\t\tboundingBox.computeWorldVertices(slot, 0, boundingBox.worldVerticesLength, polygon, 0, 2);\n\t\t\t}\n\t\t}\n\n\t\tif (updateAabb) {\n\t\t\tthis.aabbCompute();\n\t\t} else {\n\t\t\tthis.minX = Number.POSITIVE_INFINITY;\n\t\t\tthis.minY = Number.POSITIVE_INFINITY;\n\t\t\tthis.maxX = Number.NEGATIVE_INFINITY;\n\t\t\tthis.maxY = Number.NEGATIVE_INFINITY;\n\t\t}\n\t}\n\n\taabbCompute () {\n\t\tlet minX = Number.POSITIVE_INFINITY, minY = Number.POSITIVE_INFINITY, maxX = Number.NEGATIVE_INFINITY, maxY = Number.NEGATIVE_INFINITY;\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++) {\n\t\t\tlet polygon = polygons[i];\n\t\t\tlet vertices = polygon;\n\t\t\tfor (let ii = 0, nn = polygon.length; ii < nn; ii += 2) {\n\t\t\t\tlet x = vertices[ii];\n\t\t\t\tlet y = vertices[ii + 1];\n\t\t\t\tminX = Math.min(minX, x);\n\t\t\t\tminY = Math.min(minY, y);\n\t\t\t\tmaxX = Math.max(maxX, x);\n\t\t\t\tmaxY = Math.max(maxY, y);\n\t\t\t}\n\t\t}\n\t\tthis.minX = minX;\n\t\tthis.minY = minY;\n\t\tthis.maxX = maxX;\n\t\tthis.maxY = maxY;\n\t}\n\n\t/** Returns true if the axis aligned bounding box contains the point. */\n\taabbContainsPoint (x: number, y: number) {\n\t\treturn x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;\n\t}\n\n\t/** Returns true if the axis aligned bounding box intersects the line segment. */\n\taabbIntersectsSegment (x1: number, y1: number, x2: number, y2: number) {\n\t\tlet minX = this.minX;\n\t\tlet minY = this.minY;\n\t\tlet maxX = this.maxX;\n\t\tlet maxY = this.maxY;\n\t\tif ((x1 <= minX && x2 <= minX) || (y1 <= minY && y2 <= minY) || (x1 >= maxX && x2 >= maxX) || (y1 >= maxY && y2 >= maxY))\n\t\t\treturn false;\n\t\tlet m = (y2 - y1) / (x2 - x1);\n\t\tlet y = m * (minX - x1) + y1;\n\t\tif (y > minY && y < maxY) return true;\n\t\ty = m * (maxX - x1) + y1;\n\t\tif (y > minY && y < maxY) return true;\n\t\tlet x = (minY - y1) / m + x1;\n\t\tif (x > minX && x < maxX) return true;\n\t\tx = (maxY - y1) / m + x1;\n\t\tif (x > minX && x < maxX) return true;\n\t\treturn false;\n\t}\n\n\t/** Returns true if the axis aligned bounding box intersects the axis aligned bounding box of the specified bounds. */\n\taabbIntersectsSkeleton (bounds: SkeletonBounds) {\n\t\treturn this.minX < bounds.maxX && this.maxX > bounds.minX && this.minY < bounds.maxY && this.maxY > bounds.minY;\n\t}\n\n\t/** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more\n\t * efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */\n\tcontainsPoint (x: number, y: number): BoundingBoxAttachment | null {\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++)\n\t\t\tif (this.containsPointPolygon(polygons[i], x, y)) return this.boundingBoxes[i];\n\t\treturn null;\n\t}\n\n\t/** Returns true if the polygon contains the point. */\n\tcontainsPointPolygon (polygon: NumberArrayLike, x: number, y: number) {\n\t\tlet vertices = polygon;\n\t\tlet nn = polygon.length;\n\n\t\tlet prevIndex = nn - 2;\n\t\tlet inside = false;\n\t\tfor (let ii = 0; ii < nn; ii += 2) {\n\t\t\tlet vertexY = vertices[ii + 1];\n\t\t\tlet prevY = vertices[prevIndex + 1];\n\t\t\tif ((vertexY < y && prevY >= y) || (prevY < y && vertexY >= y)) {\n\t\t\t\tlet vertexX = vertices[ii];\n\t\t\t\tif (vertexX + (y - vertexY) / (prevY - vertexY) * (vertices[prevIndex] - vertexX) < x) inside = !inside;\n\t\t\t}\n\t\t\tprevIndex = ii;\n\t\t}\n\t\treturn inside;\n\t}\n\n\t/** Returns the first bounding box attachment that contains any part of the line segment, or null. When doing many checks, it\n\t * is usually more efficient to only call this method if {@link #aabbIntersectsSegment()} returns\n\t * true. */\n\tintersectsSegment (x1: number, y1: number, x2: number, y2: number) {\n\t\tlet polygons = this.polygons;\n\t\tfor (let i = 0, n = polygons.length; i < n; i++)\n\t\t\tif (this.intersectsSegmentPolygon(polygons[i], x1, y1, x2, y2)) return this.boundingBoxes[i];\n\t\treturn null;\n\t}\n\n\t/** Returns true if the polygon contains any part of the line segment. */\n\tintersectsSegmentPolygon (polygon: NumberArrayLike, x1: number, y1: number, x2: number, y2: number) {\n\t\tlet vertices = polygon;\n\t\tlet nn = polygon.length;\n\n\t\tlet width12 = x1 - x2, height12 = y1 - y2;\n\t\tlet det1 = x1 * y2 - y1 * x2;\n\t\tlet x3 = vertices[nn - 2], y3 = vertices[nn - 1];\n\t\tfor (let ii = 0; ii < nn; ii += 2) {\n\t\t\tlet x4 = vertices[ii], y4 = vertices[ii + 1];\n\t\t\tlet det2 = x3 * y4 - y3 * x4;\n\t\t\tlet width34 = x3 - x4, height34 = y3 - y4;\n\t\t\tlet det3 = width12 * height34 - height12 * width34;\n\t\t\tlet x = (det1 * width34 - width12 * det2) / det3;\n\t\t\tif (((x >= x3 && x <= x4) || (x >= x4 && x <= x3)) && ((x >= x1 && x <= x2) || (x >= x2 && x <= x1))) {\n\t\t\t\tlet y = (det1 * height34 - height12 * det2) / det3;\n\t\t\t\tif (((y >= y3 && y <= y4) || (y >= y4 && y <= y3)) && ((y >= y1 && y <= y2) || (y >= y2 && y <= y1))) return true;\n\t\t\t}\n\t\t\tx3 = x4;\n\t\t\ty3 = y4;\n\t\t}\n\t\treturn false;\n\t}\n\n\t/** Returns the polygon for the specified bounding box, or null. */\n\tgetPolygon (boundingBox: BoundingBoxAttachment) {\n\t\tif (!boundingBox) throw new Error(\"boundingBox cannot be null.\");\n\t\tlet index = this.boundingBoxes.indexOf(boundingBox);\n\t\treturn index == -1 ? null : this.polygons[index];\n\t}\n\n\t/** The width of the axis aligned bounding box. */\n\tgetWidth () {\n\t\treturn this.maxX - this.minX;\n\t}\n\n\t/** The height of the axis aligned bounding box. */\n\tgetHeight () {\n\t\treturn this.maxY - this.minY;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { NumberArrayLike, Pool } from \"./Utils.js\";\n\nexport class Triangulator {\n\tprivate convexPolygons = new Array>();\n\tprivate convexPolygonsIndices = new Array>();\n\n\tprivate indicesArray = new Array();\n\tprivate isConcaveArray = new Array();\n\tprivate triangles = new Array();\n\n\tprivate polygonPool = new Pool>(() => {\n\t\treturn new Array();\n\t});\n\n\tprivate polygonIndicesPool = new Pool>(() => {\n\t\treturn new Array();\n\t});\n\n\tpublic triangulate (verticesArray: NumberArrayLike): Array {\n\t\tlet vertices = verticesArray;\n\t\tlet vertexCount = verticesArray.length >> 1;\n\n\t\tlet indices = this.indicesArray;\n\t\tindices.length = 0;\n\t\tfor (let i = 0; i < vertexCount; i++)\n\t\t\tindices[i] = i;\n\n\t\tlet isConcave = this.isConcaveArray;\n\t\tisConcave.length = 0;\n\t\tfor (let i = 0, n = vertexCount; i < n; ++i)\n\t\t\tisConcave[i] = Triangulator.isConcave(i, vertexCount, vertices, indices);\n\n\t\tlet triangles = this.triangles;\n\t\ttriangles.length = 0;\n\n\t\twhile (vertexCount > 3) {\n\t\t\t// Find ear tip.\n\t\t\tlet previous = vertexCount - 1, i = 0, next = 1;\n\t\t\twhile (true) {\n\t\t\t\touter:\n\t\t\t\tif (!isConcave[i]) {\n\t\t\t\t\tlet p1 = indices[previous] << 1, p2 = indices[i] << 1, p3 = indices[next] << 1;\n\t\t\t\t\tlet p1x = vertices[p1], p1y = vertices[p1 + 1];\n\t\t\t\t\tlet p2x = vertices[p2], p2y = vertices[p2 + 1];\n\t\t\t\t\tlet p3x = vertices[p3], p3y = vertices[p3 + 1];\n\t\t\t\t\tfor (let ii = (next + 1) % vertexCount; ii != previous; ii = (ii + 1) % vertexCount) {\n\t\t\t\t\t\tif (!isConcave[ii]) continue;\n\t\t\t\t\t\tlet v = indices[ii] << 1;\n\t\t\t\t\t\tlet vx = vertices[v], vy = vertices[v + 1];\n\t\t\t\t\t\tif (Triangulator.positiveArea(p3x, p3y, p1x, p1y, vx, vy)) {\n\t\t\t\t\t\t\tif (Triangulator.positiveArea(p1x, p1y, p2x, p2y, vx, vy)) {\n\t\t\t\t\t\t\t\tif (Triangulator.positiveArea(p2x, p2y, p3x, p3y, vx, vy)) break outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (next == 0) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (!isConcave[i]) break;\n\t\t\t\t\t\ti--;\n\t\t\t\t\t} while (i > 0);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tprevious = i;\n\t\t\t\ti = next;\n\t\t\t\tnext = (next + 1) % vertexCount;\n\t\t\t}\n\n\t\t\t// Cut ear tip.\n\t\t\ttriangles.push(indices[(vertexCount + i - 1) % vertexCount]);\n\t\t\ttriangles.push(indices[i]);\n\t\t\ttriangles.push(indices[(i + 1) % vertexCount]);\n\t\t\tindices.splice(i, 1);\n\t\t\tisConcave.splice(i, 1);\n\t\t\tvertexCount--;\n\n\t\t\tlet previousIndex = (vertexCount + i - 1) % vertexCount;\n\t\t\tlet nextIndex = i == vertexCount ? 0 : i;\n\t\t\tisConcave[previousIndex] = Triangulator.isConcave(previousIndex, vertexCount, vertices, indices);\n\t\t\tisConcave[nextIndex] = Triangulator.isConcave(nextIndex, vertexCount, vertices, indices);\n\t\t}\n\n\t\tif (vertexCount == 3) {\n\t\t\ttriangles.push(indices[2]);\n\t\t\ttriangles.push(indices[0]);\n\t\t\ttriangles.push(indices[1]);\n\t\t}\n\n\t\treturn triangles;\n\t}\n\n\tdecompose (verticesArray: Array, triangles: Array): Array> {\n\t\tlet vertices = verticesArray;\n\t\tlet convexPolygons = this.convexPolygons;\n\t\tthis.polygonPool.freeAll(convexPolygons);\n\t\tconvexPolygons.length = 0;\n\n\t\tlet convexPolygonsIndices = this.convexPolygonsIndices;\n\t\tthis.polygonIndicesPool.freeAll(convexPolygonsIndices);\n\t\tconvexPolygonsIndices.length = 0;\n\n\t\tlet polygonIndices = this.polygonIndicesPool.obtain();\n\t\tpolygonIndices.length = 0;\n\n\t\tlet polygon = this.polygonPool.obtain();\n\t\tpolygon.length = 0;\n\n\t\t// Merge subsequent triangles if they form a triangle fan.\n\t\tlet fanBaseIndex = -1, lastWinding = 0;\n\t\tfor (let i = 0, n = triangles.length; i < n; i += 3) {\n\t\t\tlet t1 = triangles[i] << 1, t2 = triangles[i + 1] << 1, t3 = triangles[i + 2] << 1;\n\t\t\tlet x1 = vertices[t1], y1 = vertices[t1 + 1];\n\t\t\tlet x2 = vertices[t2], y2 = vertices[t2 + 1];\n\t\t\tlet x3 = vertices[t3], y3 = vertices[t3 + 1];\n\n\t\t\t// If the base of the last triangle is the same as this triangle, check if they form a convex polygon (triangle fan).\n\t\t\tlet merged = false;\n\t\t\tif (fanBaseIndex == t1) {\n\t\t\t\tlet o = polygon.length - 4;\n\t\t\t\tlet winding1 = Triangulator.winding(polygon[o], polygon[o + 1], polygon[o + 2], polygon[o + 3], x3, y3);\n\t\t\t\tlet winding2 = Triangulator.winding(x3, y3, polygon[0], polygon[1], polygon[2], polygon[3]);\n\t\t\t\tif (winding1 == lastWinding && winding2 == lastWinding) {\n\t\t\t\t\tpolygon.push(x3);\n\t\t\t\t\tpolygon.push(y3);\n\t\t\t\t\tpolygonIndices.push(t3);\n\t\t\t\t\tmerged = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Otherwise make this triangle the new base.\n\t\t\tif (!merged) {\n\t\t\t\tif (polygon.length > 0) {\n\t\t\t\t\tconvexPolygons.push(polygon);\n\t\t\t\t\tconvexPolygonsIndices.push(polygonIndices);\n\t\t\t\t} else {\n\t\t\t\t\tthis.polygonPool.free(polygon)\n\t\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\n\t\t\t\t}\n\t\t\t\tpolygon = this.polygonPool.obtain();\n\t\t\t\tpolygon.length = 0;\n\t\t\t\tpolygon.push(x1);\n\t\t\t\tpolygon.push(y1);\n\t\t\t\tpolygon.push(x2);\n\t\t\t\tpolygon.push(y2);\n\t\t\t\tpolygon.push(x3);\n\t\t\t\tpolygon.push(y3);\n\t\t\t\tpolygonIndices = this.polygonIndicesPool.obtain();\n\t\t\t\tpolygonIndices.length = 0;\n\t\t\t\tpolygonIndices.push(t1);\n\t\t\t\tpolygonIndices.push(t2);\n\t\t\t\tpolygonIndices.push(t3);\n\t\t\t\tlastWinding = Triangulator.winding(x1, y1, x2, y2, x3, y3);\n\t\t\t\tfanBaseIndex = t1;\n\t\t\t}\n\t\t}\n\n\t\tif (polygon.length > 0) {\n\t\t\tconvexPolygons.push(polygon);\n\t\t\tconvexPolygonsIndices.push(polygonIndices);\n\t\t}\n\n\t\t// Go through the list of polygons and try to merge the remaining triangles with the found triangle fans.\n\t\tfor (let i = 0, n = convexPolygons.length; i < n; i++) {\n\t\t\tpolygonIndices = convexPolygonsIndices[i];\n\t\t\tif (polygonIndices.length == 0) continue;\n\t\t\tlet firstIndex = polygonIndices[0];\n\t\t\tlet lastIndex = polygonIndices[polygonIndices.length - 1];\n\n\t\t\tpolygon = convexPolygons[i];\n\t\t\tlet o = polygon.length - 4;\n\t\t\tlet prevPrevX = polygon[o], prevPrevY = polygon[o + 1];\n\t\t\tlet prevX = polygon[o + 2], prevY = polygon[o + 3];\n\t\t\tlet firstX = polygon[0], firstY = polygon[1];\n\t\t\tlet secondX = polygon[2], secondY = polygon[3];\n\t\t\tlet winding = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, firstX, firstY);\n\n\t\t\tfor (let ii = 0; ii < n; ii++) {\n\t\t\t\tif (ii == i) continue;\n\t\t\t\tlet otherIndices = convexPolygonsIndices[ii];\n\t\t\t\tif (otherIndices.length != 3) continue;\n\t\t\t\tlet otherFirstIndex = otherIndices[0];\n\t\t\t\tlet otherSecondIndex = otherIndices[1];\n\t\t\t\tlet otherLastIndex = otherIndices[2];\n\n\t\t\t\tlet otherPoly = convexPolygons[ii];\n\t\t\t\tlet x3 = otherPoly[otherPoly.length - 2], y3 = otherPoly[otherPoly.length - 1];\n\n\t\t\t\tif (otherFirstIndex != firstIndex || otherSecondIndex != lastIndex) continue;\n\t\t\t\tlet winding1 = Triangulator.winding(prevPrevX, prevPrevY, prevX, prevY, x3, y3);\n\t\t\t\tlet winding2 = Triangulator.winding(x3, y3, firstX, firstY, secondX, secondY);\n\t\t\t\tif (winding1 == winding && winding2 == winding) {\n\t\t\t\t\totherPoly.length = 0;\n\t\t\t\t\totherIndices.length = 0;\n\t\t\t\t\tpolygon.push(x3);\n\t\t\t\t\tpolygon.push(y3);\n\t\t\t\t\tpolygonIndices.push(otherLastIndex);\n\t\t\t\t\tprevPrevX = prevX;\n\t\t\t\t\tprevPrevY = prevY;\n\t\t\t\t\tprevX = x3;\n\t\t\t\t\tprevY = y3;\n\t\t\t\t\tii = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Remove empty polygons that resulted from the merge step above.\n\t\tfor (let i = convexPolygons.length - 1; i >= 0; i--) {\n\t\t\tpolygon = convexPolygons[i];\n\t\t\tif (polygon.length == 0) {\n\t\t\t\tconvexPolygons.splice(i, 1);\n\t\t\t\tthis.polygonPool.free(polygon);\n\t\t\t\tpolygonIndices = convexPolygonsIndices[i]\n\t\t\t\tconvexPolygonsIndices.splice(i, 1)\n\t\t\t\tthis.polygonIndicesPool.free(polygonIndices);\n\t\t\t}\n\t\t}\n\n\t\treturn convexPolygons;\n\t}\n\n\tprivate static isConcave (index: number, vertexCount: number, vertices: NumberArrayLike, indices: NumberArrayLike): boolean {\n\t\tlet previous = indices[(vertexCount + index - 1) % vertexCount] << 1;\n\t\tlet current = indices[index] << 1;\n\t\tlet next = indices[(index + 1) % vertexCount] << 1;\n\t\treturn !this.positiveArea(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next],\n\t\t\tvertices[next + 1]);\n\t}\n\n\tprivate static positiveArea (p1x: number, p1y: number, p2x: number, p2y: number, p3x: number, p3y: number): boolean {\n\t\treturn p1x * (p3y - p2y) + p2x * (p1y - p3y) + p3x * (p2y - p1y) >= 0;\n\t}\n\n\tprivate static winding (p1x: number, p1y: number, p2x: number, p2y: number, p3x: number, p3y: number): number {\n\t\tlet px = p2x - p1x, py = p2y - p1y;\n\t\treturn p3x * py - p3y * px + px * p1y - p1x * py >= 0 ? 1 : -1;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { ClippingAttachment } from \"./attachments/ClippingAttachment.js\";\nimport { Slot } from \"./Slot.js\";\nimport { Triangulator } from \"./Triangulator.js\";\nimport { Utils, Color, NumberArrayLike } from \"./Utils.js\";\n\nexport class SkeletonClipping {\n\tprivate triangulator = new Triangulator();\n\tprivate clippingPolygon = new Array();\n\tprivate clipOutput = new Array();\n\tclippedVertices = new Array();\n\tclippedUVs = new Array();\n\tclippedTriangles = new Array();\n\tprivate scratch = new Array();\n\n\tprivate clipAttachment: ClippingAttachment | null = null;\n\tprivate clippingPolygons: Array> | null = null;\n\n\tclipStart (slot: Slot, clip: ClippingAttachment): number {\n\t\tif (this.clipAttachment) return 0;\n\t\tthis.clipAttachment = clip;\n\n\t\tlet n = clip.worldVerticesLength;\n\t\tlet vertices = Utils.setArraySize(this.clippingPolygon, n);\n\t\tclip.computeWorldVertices(slot, 0, n, vertices, 0, 2);\n\t\tlet clippingPolygon = this.clippingPolygon;\n\t\tSkeletonClipping.makeClockwise(clippingPolygon);\n\t\tlet clippingPolygons = this.clippingPolygons = this.triangulator.decompose(clippingPolygon, this.triangulator.triangulate(clippingPolygon));\n\t\tfor (let i = 0, n = clippingPolygons.length; i < n; i++) {\n\t\t\tlet polygon = clippingPolygons[i];\n\t\t\tSkeletonClipping.makeClockwise(polygon);\n\t\t\tpolygon.push(polygon[0]);\n\t\t\tpolygon.push(polygon[1]);\n\t\t}\n\n\t\treturn clippingPolygons.length;\n\t}\n\n\tclipEndWithSlot (slot: Slot) {\n\t\tif (this.clipAttachment && this.clipAttachment.endSlot == slot.data) this.clipEnd();\n\t}\n\n\tclipEnd () {\n\t\tif (!this.clipAttachment) return;\n\t\tthis.clipAttachment = null;\n\t\tthis.clippingPolygons = null;\n\t\tthis.clippedVertices.length = 0;\n\t\tthis.clippedTriangles.length = 0;\n\t\tthis.clippingPolygon.length = 0;\n\t}\n\n\tisClipping (): boolean {\n\t\treturn this.clipAttachment != null;\n\t}\n\n\t/**\n\t* @deprecated Use clipTriangles without verticesLength parameter. Mark for removal in 4.3.\n\t*/\n\tclipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number): void;\n\n\t/**\n\t * @deprecated Use clipTriangles without verticesLength parameter. Mark for removal in 4.3.\n\t */\n\tclipTriangles (vertices: NumberArrayLike, verticesLength: number, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike, light: Color, dark: Color, twoColor: boolean): void;\n\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number): void;\n\tclipTriangles (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike, light: Color, dark: Color, twoColor: boolean): void;\n\tclipTriangles (\n\t\tvertices: NumberArrayLike,\n\t\tverticesLengthOrTriangles: number | NumberArrayLike,\n\t\ttrianglesOrTrianglesLength: NumberArrayLike | number,\n\t\ttrianglesLengthOrUvs?: number | NumberArrayLike,\n\t\tuvsOrLight?: NumberArrayLike | Color,\n\t\tlightOrDark?: Color,\n\t\tdarkOrTwoColor?: Color | boolean,\n\t\ttwoColorParam?: boolean\n\t): void {\n\t\t// Determine which overload is being used\n\t\tlet triangles: NumberArrayLike;\n\t\tlet trianglesLength: number;\n\t\tlet uvs: NumberArrayLike | undefined;\n\t\tlet light: Color | undefined;\n\t\tlet dark: Color | undefined;\n\t\tlet twoColor: boolean | undefined;\n\n\t\tif (typeof verticesLengthOrTriangles === 'number') {\n\t\t\ttriangles = trianglesOrTrianglesLength as NumberArrayLike;\n\t\t\ttrianglesLength = trianglesLengthOrUvs as number;\n\t\t\tuvs = uvsOrLight as NumberArrayLike;\n\t\t\tlight = lightOrDark as Color | undefined;\n\t\t\tdark = darkOrTwoColor as Color | undefined;\n\t\t\ttwoColor = twoColorParam;\n\t\t} else {\n\t\t\ttriangles = verticesLengthOrTriangles;\n\t\t\ttrianglesLength = trianglesOrTrianglesLength as number;\n\t\t\tuvs = trianglesLengthOrUvs as NumberArrayLike;\n\t\t\tlight = uvsOrLight as Color | undefined;\n\t\t\tdark = lightOrDark as Color | undefined;\n\t\t\ttwoColor = darkOrTwoColor as boolean;\n\t\t}\n\n\t\tif (uvs && light && dark && typeof twoColor === 'boolean')\n\t\t\tthis.clipTrianglesRender(vertices, triangles, trianglesLength, uvs, light, dark, twoColor);\n\t\telse\n\t\t\tthis.clipTrianglesNoRender(vertices, triangles, trianglesLength);\n\t}\n\n\tprivate clipTrianglesNoRender (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number) {\n\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\n\t\t\t\t\tclippedVerticesItems[s + 2] = x2;\n\t\t\t\t\tclippedVerticesItems[s + 3] = y2;\n\n\t\t\t\t\tclippedVerticesItems[s + 4] = x3;\n\t\t\t\t\tclippedVerticesItems[s + 5] = y3;\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate clipTrianglesRender (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike,\n\t\tlight: Color, dark: Color, twoColor: boolean) {\n\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\t\tlet vertexSize = twoColor ? 12 : 8;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\t\t\tlet u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\t\t\tlet u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\t\t\tlet u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\t\t\t\t\tlet d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n\t\t\t\t\tlet d = 1 / (d0 * d2 + d1 * (y1 - y3));\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * vertexSize);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += vertexSize) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\n\t\t\t\t\t\tlet c0 = x - x3, c1 = y - y3;\n\t\t\t\t\t\tlet a = (d0 * c0 + d1 * c1) * d;\n\t\t\t\t\t\tlet b = (d4 * c0 + d2 * c1) * d;\n\t\t\t\t\t\tlet c = 1 - a - b;\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1 * a + u2 * b + u3 * c;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1 * a + v2 * b + v3 * c;\n\t\t\t\t\t\tif (twoColor) {\n\t\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\n\t\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * vertexSize);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\t\t\t\t\tclippedVerticesItems[s + 2] = light.r;\n\t\t\t\t\tclippedVerticesItems[s + 3] = light.g;\n\t\t\t\t\tclippedVerticesItems[s + 4] = light.b;\n\t\t\t\t\tclippedVerticesItems[s + 5] = light.a;\n\t\t\t\t\tif (!twoColor) {\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 8] = x2;\n\t\t\t\t\t\tclippedVerticesItems[s + 9] = y2;\n\t\t\t\t\t\tclippedVerticesItems[s + 10] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 11] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 12] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 13] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 14] = u2;\n\t\t\t\t\t\tclippedVerticesItems[s + 15] = v2;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 16] = x3;\n\t\t\t\t\t\tclippedVerticesItems[s + 17] = y3;\n\t\t\t\t\t\tclippedVerticesItems[s + 18] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 19] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 20] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 21] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 22] = u3;\n\t\t\t\t\t\tclippedVerticesItems[s + 23] = v3;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclippedVerticesItems[s + 6] = u1;\n\t\t\t\t\t\tclippedVerticesItems[s + 7] = v1;\n\t\t\t\t\t\tclippedVerticesItems[s + 8] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 9] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 10] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 11] = dark.a;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 12] = x2;\n\t\t\t\t\t\tclippedVerticesItems[s + 13] = y2;\n\t\t\t\t\t\tclippedVerticesItems[s + 14] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 15] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 16] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 17] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 18] = u2;\n\t\t\t\t\t\tclippedVerticesItems[s + 19] = v2;\n\t\t\t\t\t\tclippedVerticesItems[s + 20] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 21] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 22] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 23] = dark.a;\n\n\t\t\t\t\t\tclippedVerticesItems[s + 24] = x3;\n\t\t\t\t\t\tclippedVerticesItems[s + 25] = y3;\n\t\t\t\t\t\tclippedVerticesItems[s + 26] = light.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 27] = light.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 28] = light.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 29] = light.a;\n\t\t\t\t\t\tclippedVerticesItems[s + 30] = u3;\n\t\t\t\t\t\tclippedVerticesItems[s + 31] = v3;\n\t\t\t\t\t\tclippedVerticesItems[s + 32] = dark.r;\n\t\t\t\t\t\tclippedVerticesItems[s + 33] = dark.g;\n\t\t\t\t\t\tclippedVerticesItems[s + 34] = dark.b;\n\t\t\t\t\t\tclippedVerticesItems[s + 35] = dark.a;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tpublic clipTrianglesUnpacked (vertices: NumberArrayLike, triangles: NumberArrayLike, trianglesLength: number, uvs: NumberArrayLike) {\n\t\tlet clipOutput = this.clipOutput, clippedVertices = this.clippedVertices, clippedUVs = this.clippedUVs;\n\t\tlet clippedTriangles = this.clippedTriangles;\n\t\tlet polygons = this.clippingPolygons!;\n\t\tlet polygonsCount = polygons.length;\n\n\t\tlet index = 0;\n\t\tclippedVertices.length = 0;\n\t\tclippedUVs.length = 0;\n\t\tclippedTriangles.length = 0;\n\t\tfor (let i = 0; i < trianglesLength; i += 3) {\n\t\t\tlet vertexOffset = triangles[i] << 1;\n\t\t\tlet x1 = vertices[vertexOffset], y1 = vertices[vertexOffset + 1];\n\t\t\tlet u1 = uvs[vertexOffset], v1 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 1] << 1;\n\t\t\tlet x2 = vertices[vertexOffset], y2 = vertices[vertexOffset + 1];\n\t\t\tlet u2 = uvs[vertexOffset], v2 = uvs[vertexOffset + 1];\n\n\t\t\tvertexOffset = triangles[i + 2] << 1;\n\t\t\tlet x3 = vertices[vertexOffset], y3 = vertices[vertexOffset + 1];\n\t\t\tlet u3 = uvs[vertexOffset], v3 = uvs[vertexOffset + 1];\n\n\t\t\tfor (let p = 0; p < polygonsCount; p++) {\n\t\t\t\tlet s = clippedVertices.length;\n\t\t\t\tif (this.clip(x1, y1, x2, y2, x3, y3, polygons[p], clipOutput)) {\n\t\t\t\t\tlet clipOutputLength = clipOutput.length;\n\t\t\t\t\tif (clipOutputLength == 0) continue;\n\t\t\t\t\tlet d0 = y2 - y3, d1 = x3 - x2, d2 = x1 - x3, d4 = y3 - y1;\n\t\t\t\t\tlet d = 1 / (d0 * d2 + d1 * (y1 - y3));\n\n\t\t\t\t\tlet clipOutputCount = clipOutputLength >> 1;\n\t\t\t\t\tlet clipOutputItems = this.clipOutput;\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + clipOutputCount * 2);\n\t\t\t\t\tlet clippedUVsItems = Utils.setArraySize(clippedUVs, s + clipOutputCount * 2);\n\t\t\t\t\tfor (let ii = 0; ii < clipOutputLength; ii += 2, s += 2) {\n\t\t\t\t\t\tlet x = clipOutputItems[ii], y = clipOutputItems[ii + 1];\n\t\t\t\t\t\tclippedVerticesItems[s] = x;\n\t\t\t\t\t\tclippedVerticesItems[s + 1] = y;\n\t\t\t\t\t\tlet c0 = x - x3, c1 = y - y3;\n\t\t\t\t\t\tlet a = (d0 * c0 + d1 * c1) * d;\n\t\t\t\t\t\tlet b = (d4 * c0 + d2 * c1) * d;\n\t\t\t\t\t\tlet c = 1 - a - b;\n\t\t\t\t\t\tclippedUVsItems[s] = u1 * a + u2 * b + u3 * c;\n\t\t\t\t\t\tclippedUVsItems[s + 1] = v1 * a + v2 * b + v3 * c;\n\t\t\t\t\t}\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3 * (clipOutputCount - 2));\n\t\t\t\t\tclipOutputCount--;\n\t\t\t\t\tfor (let ii = 1; ii < clipOutputCount; ii++, s += 3) {\n\t\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + ii);\n\t\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + ii + 1);\n\t\t\t\t\t}\n\t\t\t\t\tindex += clipOutputCount + 1;\n\n\t\t\t\t} else {\n\t\t\t\t\tlet clippedVerticesItems = Utils.setArraySize(clippedVertices, s + 3 * 2);\n\t\t\t\t\tclippedVerticesItems[s] = x1;\n\t\t\t\t\tclippedVerticesItems[s + 1] = y1;\n\t\t\t\t\tclippedVerticesItems[s + 2] = x2;\n\t\t\t\t\tclippedVerticesItems[s + 3] = y2;\n\t\t\t\t\tclippedVerticesItems[s + 4] = x3;\n\t\t\t\t\tclippedVerticesItems[s + 5] = y3;\n\n\t\t\t\t\tlet clippedUVSItems = Utils.setArraySize(clippedUVs, s + 3 * 2);\n\t\t\t\t\tclippedUVSItems[s] = u1;\n\t\t\t\t\tclippedUVSItems[s + 1] = v1;\n\t\t\t\t\tclippedUVSItems[s + 2] = u2;\n\t\t\t\t\tclippedUVSItems[s + 3] = v2;\n\t\t\t\t\tclippedUVSItems[s + 4] = u3;\n\t\t\t\t\tclippedUVSItems[s + 5] = v3;\n\n\t\t\t\t\ts = clippedTriangles.length;\n\t\t\t\t\tlet clippedTrianglesItems = Utils.setArraySize(clippedTriangles, s + 3);\n\t\t\t\t\tclippedTrianglesItems[s] = index;\n\t\t\t\t\tclippedTrianglesItems[s + 1] = (index + 1);\n\t\t\t\t\tclippedTrianglesItems[s + 2] = (index + 2);\n\t\t\t\t\tindex += 3;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/** Clips the input triangle against the convex, clockwise clipping area. If the triangle lies entirely within the clipping\n\t * area, false is returned. The clipping area must duplicate the first vertex at the end of the vertices list. */\n\tclip (x1: number, y1: number, x2: number, y2: number, x3: number, y3: number, clippingArea: Array, output: Array) {\n\t\tlet originalOutput = output;\n\t\tlet clipped = false;\n\n\t\t// Avoid copy at the end.\n\t\tlet input: Array;\n\t\tif (clippingArea.length % 4 >= 2) {\n\t\t\tinput = output;\n\t\t\toutput = this.scratch;\n\t\t} else\n\t\t\tinput = this.scratch;\n\n\t\tinput.length = 0;\n\t\tinput.push(x1);\n\t\tinput.push(y1);\n\t\tinput.push(x2);\n\t\tinput.push(y2);\n\t\tinput.push(x3);\n\t\tinput.push(y3);\n\t\tinput.push(x1);\n\t\tinput.push(y1);\n\t\toutput.length = 0;\n\n\t\tlet clippingVerticesLast = clippingArea.length - 4;\n\t\tlet clippingVertices = clippingArea;\n\t\tfor (let i = 0; ; i += 2) {\n\t\t\tlet edgeX = clippingVertices[i], edgeY = clippingVertices[i + 1];\n\t\t\tlet ex = edgeX - clippingVertices[i + 2], ey = edgeY - clippingVertices[i + 3];\n\n\t\t\tlet outputStart = output.length;\n\t\t\tlet inputVertices = input;\n\t\t\tfor (let ii = 0, nn = input.length - 2; ii < nn;) {\n\t\t\t\tlet inputX = inputVertices[ii], inputY = inputVertices[ii + 1];\n\t\t\t\tii += 2;\n\t\t\t\tlet inputX2 = inputVertices[ii], inputY2 = inputVertices[ii + 1];\n\t\t\t\tlet s2 = ey * (edgeX - inputX2) > ex * (edgeY - inputY2);\n\t\t\t\tlet s1 = ey * (edgeX - inputX) - ex * (edgeY - inputY);\n\t\t\t\tif (s1 > 0) {\n\t\t\t\t\tif (s2) { // v1 inside, v2 inside\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// v1 inside, v2 outside\n\t\t\t\t\tlet ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);\n\t\t\t\t\tif (t >= 0 && t <= 1) {\n\t\t\t\t\t\toutput.push(inputX + ix * t);\n\t\t\t\t\t\toutput.push(inputY + iy * t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t} else if (s2) { // v1 outside, v2 inside\n\t\t\t\t\tlet ix = inputX2 - inputX, iy = inputY2 - inputY, t = s1 / (ix * ey - iy * ex);\n\t\t\t\t\tif (t >= 0 && t <= 1) {\n\t\t\t\t\t\toutput.push(inputX + ix * t);\n\t\t\t\t\t\toutput.push(inputY + iy * t);\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\toutput.push(inputX2);\n\t\t\t\t\t\toutput.push(inputY2);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tclipped = true;\n\t\t\t}\n\n\t\t\tif (outputStart == output.length) { // All edges outside.\n\t\t\t\toriginalOutput.length = 0;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\toutput.push(output[0]);\n\t\t\toutput.push(output[1]);\n\n\t\t\tif (i == clippingVerticesLast) break;\n\t\t\tlet temp = output;\n\t\t\toutput = input;\n\t\t\toutput.length = 0;\n\t\t\tinput = temp;\n\t\t}\n\n\t\tif (originalOutput != output) {\n\t\t\toriginalOutput.length = 0;\n\t\t\tfor (let i = 0, n = output.length - 2; i < n; i++)\n\t\t\t\toriginalOutput[i] = output[i];\n\t\t} else\n\t\t\toriginalOutput.length = originalOutput.length - 2;\n\n\t\treturn clipped;\n\t}\n\n\tpublic static makeClockwise (polygon: NumberArrayLike) {\n\t\tlet vertices = polygon;\n\t\tlet verticeslength = polygon.length;\n\n\t\tlet area = vertices[verticeslength - 2] * vertices[1] - vertices[0] * vertices[verticeslength - 1], p1x = 0, p1y = 0, p2x = 0, p2y = 0;\n\t\tfor (let i = 0, n = verticeslength - 3; i < n; i += 2) {\n\t\t\tp1x = vertices[i];\n\t\t\tp1y = vertices[i + 1];\n\t\t\tp2x = vertices[i + 2];\n\t\t\tp2y = vertices[i + 3];\n\t\t\tarea += p1x * p2y - p2x * p1y;\n\t\t}\n\t\tif (area < 0) return;\n\n\t\tfor (let i = 0, lastX = verticeslength - 2, n = verticeslength >> 1; i < n; i += 2) {\n\t\t\tlet x = vertices[i], y = vertices[i + 1];\n\t\t\tlet other = lastX - i;\n\t\t\tvertices[i] = vertices[other];\n\t\t\tvertices[i + 1] = vertices[other + 1];\n\t\t\tvertices[other] = x;\n\t\t\tvertices[other + 1] = y;\n\t\t}\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Animation, Timeline, InheritTimeline, AttachmentTimeline, RGBATimeline, RGBTimeline, AlphaTimeline, RGBA2Timeline, RGB2Timeline, RotateTimeline, TranslateTimeline, TranslateXTimeline, TranslateYTimeline, ScaleTimeline, ScaleXTimeline, ScaleYTimeline, ShearTimeline, ShearXTimeline, ShearYTimeline, IkConstraintTimeline, TransformConstraintTimeline, PathConstraintPositionTimeline, PathConstraintSpacingTimeline, PathConstraintMixTimeline, DeformTimeline, DrawOrderTimeline, EventTimeline, CurveTimeline1, CurveTimeline2, CurveTimeline, PhysicsConstraintResetTimeline, PhysicsConstraintInertiaTimeline, PhysicsConstraintStrengthTimeline, PhysicsConstraintDampingTimeline, PhysicsConstraintMassTimeline, PhysicsConstraintWindTimeline, PhysicsConstraintGravityTimeline, PhysicsConstraintMixTimeline } from \"./Animation.js\";\nimport { VertexAttachment, Attachment } from \"./attachments/Attachment.js\";\nimport { AttachmentLoader } from \"./attachments/AttachmentLoader.js\";\nimport { MeshAttachment } from \"./attachments/MeshAttachment.js\";\nimport { BoneData, Inherit } from \"./BoneData.js\";\nimport { EventData } from \"./EventData.js\";\nimport { Event } from \"./Event.js\";\nimport { IkConstraintData } from \"./IkConstraintData.js\";\nimport { PathConstraintData, PositionMode, SpacingMode, RotateMode } from \"./PathConstraintData.js\";\nimport { SkeletonData } from \"./SkeletonData.js\";\nimport { Skin } from \"./Skin.js\";\nimport { SlotData, BlendMode } from \"./SlotData.js\";\nimport { TransformConstraintData } from \"./TransformConstraintData.js\";\nimport { Utils, Color, NumberArrayLike } from \"./Utils.js\";\nimport { Sequence, SequenceMode } from \"./attachments/Sequence.js\";\nimport { SequenceTimeline } from \"./Animation.js\";\nimport { HasTextureRegion } from \"./attachments/HasTextureRegion.js\";\nimport { PhysicsConstraintData } from \"./PhysicsConstraintData.js\";\n\n/** Loads skeleton data in the Spine JSON format.\n *\n * See [Spine JSON format](http://esotericsoftware.com/spine-json-format) and\n * [JSON and binary data](http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data) in the Spine\n * Runtimes Guide. */\nexport class SkeletonJson {\n\tattachmentLoader: AttachmentLoader;\n\n\t/** Scales bone positions, image sizes, and translations as they are loaded. This allows different size images to be used at\n\t * runtime than were used in Spine.\n\t *\n\t * See [Scaling](http://esotericsoftware.com/spine-loading-skeleton-data#Scaling) in the Spine Runtimes Guide. */\n\tscale = 1;\n\tprivate linkedMeshes = new Array();\n\n\tconstructor (attachmentLoader: AttachmentLoader) {\n\t\tthis.attachmentLoader = attachmentLoader;\n\t}\n\n\treadSkeletonData (json: string | any): SkeletonData {\n\t\tlet scale = this.scale;\n\t\tlet skeletonData = new SkeletonData();\n\t\tlet root = typeof (json) === \"string\" ? JSON.parse(json) : json;\n\n\t\t// Skeleton\n\t\tlet skeletonMap = root.skeleton;\n\t\tif (skeletonMap) {\n\t\t\tskeletonData.hash = skeletonMap.hash;\n\t\t\tskeletonData.version = skeletonMap.spine;\n\t\t\tskeletonData.x = skeletonMap.x;\n\t\t\tskeletonData.y = skeletonMap.y;\n\t\t\tskeletonData.width = skeletonMap.width;\n\t\t\tskeletonData.height = skeletonMap.height;\n\t\t\tskeletonData.referenceScale = getValue(skeletonMap, \"referenceScale\", 100) * scale;\n\t\t\tskeletonData.fps = skeletonMap.fps;\n\t\t\tskeletonData.imagesPath = skeletonMap.images ?? null;\n\t\t\tskeletonData.audioPath = skeletonMap.audio ?? null;\n\t\t}\n\n\t\t// Bones\n\t\tif (root.bones) {\n\t\t\tfor (let i = 0; i < root.bones.length; i++) {\n\t\t\t\tlet boneMap = root.bones[i];\n\n\t\t\t\tlet parent: BoneData | null = null;\n\t\t\t\tlet parentName: string = getValue(boneMap, \"parent\", null);\n\t\t\t\tif (parentName) parent = skeletonData.findBone(parentName);\n\t\t\t\tlet data = new BoneData(skeletonData.bones.length, boneMap.name, parent);\n\t\t\t\tdata.length = getValue(boneMap, \"length\", 0) * scale;\n\t\t\t\tdata.x = getValue(boneMap, \"x\", 0) * scale;\n\t\t\t\tdata.y = getValue(boneMap, \"y\", 0) * scale;\n\t\t\t\tdata.rotation = getValue(boneMap, \"rotation\", 0);\n\t\t\t\tdata.scaleX = getValue(boneMap, \"scaleX\", 1);\n\t\t\t\tdata.scaleY = getValue(boneMap, \"scaleY\", 1);\n\t\t\t\tdata.shearX = getValue(boneMap, \"shearX\", 0);\n\t\t\t\tdata.shearY = getValue(boneMap, \"shearY\", 0);\n\t\t\t\tdata.inherit = Utils.enumValue(Inherit, getValue(boneMap, \"inherit\", \"Normal\"));\n\t\t\t\tdata.skinRequired = getValue(boneMap, \"skin\", false);\n\n\t\t\t\tlet color = getValue(boneMap, \"color\", null);\n\t\t\t\tif (color) data.color.setFromString(color);\n\n\t\t\t\tskeletonData.bones.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Slots.\n\t\tif (root.slots) {\n\t\t\tfor (let i = 0; i < root.slots.length; i++) {\n\t\t\t\tlet slotMap = root.slots[i];\n\t\t\t\tlet slotName = slotMap.name;\n\n\t\t\t\tlet boneData = skeletonData.findBone(slotMap.bone);\n\t\t\t\tif (!boneData) throw new Error(`Couldn't find bone ${slotMap.bone} for slot ${slotName}`);\n\t\t\t\tlet data = new SlotData(skeletonData.slots.length, slotName, boneData);\n\n\t\t\t\tlet color: string = getValue(slotMap, \"color\", null);\n\t\t\t\tif (color) data.color.setFromString(color);\n\n\t\t\t\tlet dark: string = getValue(slotMap, \"dark\", null);\n\t\t\t\tif (dark) data.darkColor = Color.fromString(dark);\n\n\t\t\t\tdata.attachmentName = getValue(slotMap, \"attachment\", null);\n\t\t\t\tdata.blendMode = Utils.enumValue(BlendMode, getValue(slotMap, \"blend\", \"normal\"));\n\t\t\t\tdata.visible = getValue(slotMap, \"visible\", true);\n\t\t\t\tskeletonData.slots.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// IK constraints\n\t\tif (root.ik) {\n\t\t\tfor (let i = 0; i < root.ik.length; i++) {\n\t\t\t\tlet constraintMap = root.ik[i];\n\t\t\t\tlet data = new IkConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet bone = skeletonData.findBone(constraintMap.bones[ii]);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${constraintMap.bones[ii]} for IK constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet target = skeletonData.findBone(constraintMap.target);;\n\t\t\t\tif (!target) throw new Error(`Couldn't find target bone ${constraintMap.target} for IK constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.mix = getValue(constraintMap, \"mix\", 1);\n\t\t\t\tdata.softness = getValue(constraintMap, \"softness\", 0) * scale;\n\t\t\t\tdata.bendDirection = getValue(constraintMap, \"bendPositive\", true) ? 1 : -1;\n\t\t\t\tdata.compress = getValue(constraintMap, \"compress\", false);\n\t\t\t\tdata.stretch = getValue(constraintMap, \"stretch\", false);\n\t\t\t\tdata.uniform = getValue(constraintMap, \"uniform\", false);\n\n\t\t\t\tskeletonData.ikConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Transform constraints.\n\t\tif (root.transform) {\n\t\t\tfor (let i = 0; i < root.transform.length; i++) {\n\t\t\t\tlet constraintMap = root.transform[i];\n\t\t\t\tlet data = new TransformConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet boneName = constraintMap.bones[ii];\n\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for transform constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet targetName: string = constraintMap.target;\n\t\t\t\tlet target = skeletonData.findBone(targetName);\n\t\t\t\tif (!target) throw new Error(`Couldn't find target bone ${targetName} for transform constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.local = getValue(constraintMap, \"local\", false);\n\t\t\t\tdata.relative = getValue(constraintMap, \"relative\", false);\n\t\t\t\tdata.offsetRotation = getValue(constraintMap, \"rotation\", 0);\n\t\t\t\tdata.offsetX = getValue(constraintMap, \"x\", 0) * scale;\n\t\t\t\tdata.offsetY = getValue(constraintMap, \"y\", 0) * scale;\n\t\t\t\tdata.offsetScaleX = getValue(constraintMap, \"scaleX\", 0);\n\t\t\t\tdata.offsetScaleY = getValue(constraintMap, \"scaleY\", 0);\n\t\t\t\tdata.offsetShearY = getValue(constraintMap, \"shearY\", 0);\n\n\t\t\t\tdata.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\n\t\t\t\tdata.mixX = getValue(constraintMap, \"mixX\", 1);\n\t\t\t\tdata.mixY = getValue(constraintMap, \"mixY\", data.mixX);\n\t\t\t\tdata.mixScaleX = getValue(constraintMap, \"mixScaleX\", 1);\n\t\t\t\tdata.mixScaleY = getValue(constraintMap, \"mixScaleY\", data.mixScaleX);\n\t\t\t\tdata.mixShearY = getValue(constraintMap, \"mixShearY\", 1);\n\n\t\t\t\tskeletonData.transformConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Path constraints.\n\t\tif (root.path) {\n\t\t\tfor (let i = 0; i < root.path.length; i++) {\n\t\t\t\tlet constraintMap = root.path[i];\n\t\t\t\tlet data = new PathConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tfor (let ii = 0; ii < constraintMap.bones.length; ii++) {\n\t\t\t\t\tlet boneName = constraintMap.bones[ii];\n\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for path constraint ${constraintMap.name}.`);\n\t\t\t\t\tdata.bones.push(bone);\n\t\t\t\t}\n\n\t\t\t\tlet targetName: string = constraintMap.target;\n\t\t\t\tlet target = skeletonData.findSlot(targetName);\n\t\t\t\tif (!target) throw new Error(`Couldn't find target slot ${targetName} for path constraint ${constraintMap.name}.`);\n\t\t\t\tdata.target = target;\n\n\t\t\t\tdata.positionMode = Utils.enumValue(PositionMode, getValue(constraintMap, \"positionMode\", \"Percent\"));\n\t\t\t\tdata.spacingMode = Utils.enumValue(SpacingMode, getValue(constraintMap, \"spacingMode\", \"Length\"));\n\t\t\t\tdata.rotateMode = Utils.enumValue(RotateMode, getValue(constraintMap, \"rotateMode\", \"Tangent\"));\n\t\t\t\tdata.offsetRotation = getValue(constraintMap, \"rotation\", 0);\n\t\t\t\tdata.position = getValue(constraintMap, \"position\", 0);\n\t\t\t\tif (data.positionMode == PositionMode.Fixed) data.position *= scale;\n\t\t\t\tdata.spacing = getValue(constraintMap, \"spacing\", 0);\n\t\t\t\tif (data.spacingMode == SpacingMode.Length || data.spacingMode == SpacingMode.Fixed) data.spacing *= scale;\n\t\t\t\tdata.mixRotate = getValue(constraintMap, \"mixRotate\", 1);\n\t\t\t\tdata.mixX = getValue(constraintMap, \"mixX\", 1);\n\t\t\t\tdata.mixY = getValue(constraintMap, \"mixY\", data.mixX);\n\n\t\t\t\tskeletonData.pathConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Physics constraints.\n\t\tif (root.physics) {\n\t\t\tfor (let i = 0; i < root.physics.length; i++) {\n\t\t\t\tconst constraintMap = root.physics[i];\n\t\t\t\tconst data = new PhysicsConstraintData(constraintMap.name);\n\t\t\t\tdata.order = getValue(constraintMap, \"order\", 0);\n\t\t\t\tdata.skinRequired = getValue(constraintMap, \"skin\", false);\n\n\t\t\t\tconst boneName = constraintMap.bone;\n\t\t\t\tconst bone = skeletonData.findBone(boneName);\n\t\t\t\tif (bone == null) throw new Error(\"Physics bone not found: \" + boneName);\n\t\t\t\tdata.bone = bone;\n\n\t\t\t\tdata.x = getValue(constraintMap, \"x\", 0);\n\t\t\t\tdata.y = getValue(constraintMap, \"y\", 0);\n\t\t\t\tdata.rotate = getValue(constraintMap, \"rotate\", 0);\n\t\t\t\tdata.scaleX = getValue(constraintMap, \"scaleX\", 0);\n\t\t\t\tdata.shearX = getValue(constraintMap, \"shearX\", 0);\n\t\t\t\tdata.limit = getValue(constraintMap, \"limit\", 5000) * scale;\n\t\t\t\tdata.step = 1 / getValue(constraintMap, \"fps\", 60);\n\t\t\t\tdata.inertia = getValue(constraintMap, \"inertia\", 1);\n\t\t\t\tdata.strength = getValue(constraintMap, \"strength\", 100);\n\t\t\t\tdata.damping = getValue(constraintMap, \"damping\", 1);\n\t\t\t\tdata.massInverse = 1 / getValue(constraintMap, \"mass\", 1);\n\t\t\t\tdata.wind = getValue(constraintMap, \"wind\", 0);\n\t\t\t\tdata.gravity = getValue(constraintMap, \"gravity\", 0);\n\t\t\t\tdata.mix = getValue(constraintMap, \"mix\", 1);\n\t\t\t\tdata.inertiaGlobal = getValue(constraintMap, \"inertiaGlobal\", false);\n\t\t\t\tdata.strengthGlobal = getValue(constraintMap, \"strengthGlobal\", false);\n\t\t\t\tdata.dampingGlobal = getValue(constraintMap, \"dampingGlobal\", false);\n\t\t\t\tdata.massGlobal = getValue(constraintMap, \"massGlobal\", false);\n\t\t\t\tdata.windGlobal = getValue(constraintMap, \"windGlobal\", false);\n\t\t\t\tdata.gravityGlobal = getValue(constraintMap, \"gravityGlobal\", false);\n\t\t\t\tdata.mixGlobal = getValue(constraintMap, \"mixGlobal\", false);\n\n\t\t\t\tskeletonData.physicsConstraints.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Skins.\n\t\tif (root.skins) {\n\t\t\tfor (let i = 0; i < root.skins.length; i++) {\n\t\t\t\tlet skinMap = root.skins[i]\n\t\t\t\tlet skin = new Skin(skinMap.name);\n\n\t\t\t\tif (skinMap.bones) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.bones.length; ii++) {\n\t\t\t\t\t\tlet boneName = skinMap.bones[ii];\n\t\t\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\t\t\tif (!bone) throw new Error(`Couldn't find bone ${boneName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.bones.push(bone);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.ik) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.ik.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.ik[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findIkConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find IK constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.transform) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.transform.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.transform[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findTransformConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find transform constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.path) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.path.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.path[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findPathConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find path constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (skinMap.physics) {\n\t\t\t\t\tfor (let ii = 0; ii < skinMap.physics.length; ii++) {\n\t\t\t\t\t\tlet constraintName = skinMap.physics[ii];\n\t\t\t\t\t\tlet constraint = skeletonData.findPhysicsConstraint(constraintName);\n\t\t\t\t\t\tif (!constraint) throw new Error(`Couldn't find physics constraint ${constraintName} for skin ${skinMap.name}.`);\n\t\t\t\t\t\tskin.constraints.push(constraint);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (let slotName in skinMap.attachments) {\n\t\t\t\t\tlet slot = skeletonData.findSlot(slotName);\n\t\t\t\t\tif (!slot) throw new Error(`Couldn't find slot ${slotName} for skin ${skinMap.name}.`);\n\t\t\t\t\tlet slotMap = skinMap.attachments[slotName];\n\t\t\t\t\tfor (let entryName in slotMap) {\n\t\t\t\t\t\tlet attachment = this.readAttachment(slotMap[entryName], skin, slot.index, entryName, skeletonData);\n\t\t\t\t\t\tif (attachment) skin.setAttachment(slot.index, entryName, attachment);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tskeletonData.skins.push(skin);\n\t\t\t\tif (skin.name == \"default\") skeletonData.defaultSkin = skin;\n\t\t\t}\n\t\t}\n\n\t\t// Linked meshes.\n\t\tfor (let i = 0, n = this.linkedMeshes.length; i < n; i++) {\n\t\t\tlet linkedMesh = this.linkedMeshes[i];\n\t\t\tlet skin = !linkedMesh.skin ? skeletonData.defaultSkin : skeletonData.findSkin(linkedMesh.skin);\n\t\t\tif (!skin) throw new Error(`Skin not found: ${linkedMesh.skin}`);\n\t\t\tlet parent = skin.getAttachment(linkedMesh.slotIndex, linkedMesh.parent);\n\t\t\tif (!parent) throw new Error(`Parent mesh not found: ${linkedMesh.parent}`);\n\t\t\tlinkedMesh.mesh.timelineAttachment = linkedMesh.inheritTimeline ? parent : linkedMesh.mesh;\n\t\t\tlinkedMesh.mesh.setParentMesh(parent);\n\t\t\tif (linkedMesh.mesh.region != null) linkedMesh.mesh.updateRegion();\n\t\t}\n\t\tthis.linkedMeshes.length = 0;\n\n\t\t// Events.\n\t\tif (root.events) {\n\t\t\tfor (let eventName in root.events) {\n\t\t\t\tlet eventMap = root.events[eventName];\n\t\t\t\tlet data = new EventData(eventName);\n\t\t\t\tdata.intValue = getValue(eventMap, \"int\", 0);\n\t\t\t\tdata.floatValue = getValue(eventMap, \"float\", 0);\n\t\t\t\tdata.stringValue = getValue(eventMap, \"string\", \"\");\n\t\t\t\tdata.audioPath = getValue(eventMap, \"audio\", null);\n\t\t\t\tif (data.audioPath) {\n\t\t\t\t\tdata.volume = getValue(eventMap, \"volume\", 1);\n\t\t\t\t\tdata.balance = getValue(eventMap, \"balance\", 0);\n\t\t\t\t}\n\t\t\t\tskeletonData.events.push(data);\n\t\t\t}\n\t\t}\n\n\t\t// Animations.\n\t\tif (root.animations) {\n\t\t\tfor (let animationName in root.animations) {\n\t\t\t\tlet animationMap = root.animations[animationName];\n\t\t\t\tthis.readAnimation(animationMap, animationName, skeletonData);\n\t\t\t}\n\t\t}\n\n\t\treturn skeletonData;\n\t}\n\n\treadAttachment (map: any, skin: Skin, slotIndex: number, name: string, skeletonData: SkeletonData): Attachment | null {\n\t\tlet scale = this.scale;\n\t\tname = getValue(map, \"name\", name);\n\n\t\tswitch (getValue(map, \"type\", \"region\")) {\n\t\t\tcase \"region\": {\n\t\t\t\tlet path = getValue(map, \"path\", name);\n\t\t\t\tlet sequence = this.readSequence(getValue(map, \"sequence\", null));\n\t\t\t\tlet region = this.attachmentLoader.newRegionAttachment(skin, name, path, sequence);\n\t\t\t\tif (!region) return null;\n\t\t\t\tregion.path = path;\n\t\t\t\tregion.x = getValue(map, \"x\", 0) * scale;\n\t\t\t\tregion.y = getValue(map, \"y\", 0) * scale;\n\t\t\t\tregion.scaleX = getValue(map, \"scaleX\", 1);\n\t\t\t\tregion.scaleY = getValue(map, \"scaleY\", 1);\n\t\t\t\tregion.rotation = getValue(map, \"rotation\", 0);\n\t\t\t\tregion.width = map.width * scale;\n\t\t\t\tregion.height = map.height * scale;\n\t\t\t\tregion.sequence = sequence;\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) region.color.setFromString(color);\n\n\t\t\t\tif (region.region != null) region.updateRegion();\n\t\t\t\treturn region;\n\t\t\t}\n\t\t\tcase \"boundingbox\": {\n\t\t\t\tlet box = this.attachmentLoader.newBoundingBoxAttachment(skin, name);\n\t\t\t\tif (!box) return null;\n\t\t\t\tthis.readVertices(map, box, map.vertexCount << 1);\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) box.color.setFromString(color);\n\t\t\t\treturn box;\n\t\t\t}\n\t\t\tcase \"mesh\":\n\t\t\tcase \"linkedmesh\": {\n\t\t\t\tlet path = getValue(map, \"path\", name);\n\t\t\t\tlet sequence = this.readSequence(getValue(map, \"sequence\", null));\n\t\t\t\tlet mesh = this.attachmentLoader.newMeshAttachment(skin, name, path, sequence);\n\t\t\t\tif (!mesh) return null;\n\t\t\t\tmesh.path = path;\n\n\t\t\t\tlet color = getValue(map, \"color\", null);\n\t\t\t\tif (color) mesh.color.setFromString(color);\n\n\t\t\t\tmesh.width = getValue(map, \"width\", 0) * scale;\n\t\t\t\tmesh.height = getValue(map, \"height\", 0) * scale;\n\t\t\t\tmesh.sequence = sequence;\n\n\t\t\t\tlet parent: string = getValue(map, \"parent\", null);\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis.linkedMeshes.push(new LinkedMesh(mesh, getValue(map, \"skin\", null), slotIndex, parent, getValue(map, \"timelines\", true)));\n\t\t\t\t\treturn mesh;\n\t\t\t\t}\n\n\t\t\t\tlet uvs: Array = map.uvs;\n\t\t\t\tthis.readVertices(map, mesh, uvs.length);\n\t\t\t\tmesh.triangles = map.triangles;\n\t\t\t\tmesh.regionUVs = uvs;\n\t\t\t\tif (mesh.region != null) mesh.updateRegion();\n\n\t\t\t\tmesh.edges = getValue(map, \"edges\", null);\n\t\t\t\tmesh.hullLength = getValue(map, \"hull\", 0) * 2;\n\t\t\t\treturn mesh;\n\t\t\t}\n\t\t\tcase \"path\": {\n\t\t\t\tlet path = this.attachmentLoader.newPathAttachment(skin, name);\n\t\t\t\tif (!path) return null;\n\t\t\t\tpath.closed = getValue(map, \"closed\", false);\n\t\t\t\tpath.constantSpeed = getValue(map, \"constantSpeed\", true);\n\n\t\t\t\tlet vertexCount = map.vertexCount;\n\t\t\t\tthis.readVertices(map, path, vertexCount << 1);\n\n\t\t\t\tlet lengths: Array = Utils.newArray(vertexCount / 3, 0);\n\t\t\t\tfor (let i = 0; i < map.lengths.length; i++)\n\t\t\t\t\tlengths[i] = map.lengths[i] * scale;\n\t\t\t\tpath.lengths = lengths;\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) path.color.setFromString(color);\n\t\t\t\treturn path;\n\t\t\t}\n\t\t\tcase \"point\": {\n\t\t\t\tlet point = this.attachmentLoader.newPointAttachment(skin, name);\n\t\t\t\tif (!point) return null;\n\t\t\t\tpoint.x = getValue(map, \"x\", 0) * scale;\n\t\t\t\tpoint.y = getValue(map, \"y\", 0) * scale;\n\t\t\t\tpoint.rotation = getValue(map, \"rotation\", 0);\n\n\t\t\t\tlet color = getValue(map, \"color\", null);\n\t\t\t\tif (color) point.color.setFromString(color);\n\t\t\t\treturn point;\n\t\t\t}\n\t\t\tcase \"clipping\": {\n\t\t\t\tlet clip = this.attachmentLoader.newClippingAttachment(skin, name);\n\t\t\t\tif (!clip) return null;\n\n\t\t\t\tlet end = getValue(map, \"end\", null);\n\t\t\t\tif (end) clip.endSlot = skeletonData.findSlot(end);\n\n\t\t\t\tlet vertexCount = map.vertexCount;\n\t\t\t\tthis.readVertices(map, clip, vertexCount << 1);\n\n\t\t\t\tlet color: string = getValue(map, \"color\", null);\n\t\t\t\tif (color) clip.color.setFromString(color);\n\t\t\t\treturn clip;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\treadSequence (map: any) {\n\t\tif (map == null) return null;\n\t\tlet sequence = new Sequence(getValue(map, \"count\", 0));\n\t\tsequence.start = getValue(map, \"start\", 1);\n\t\tsequence.digits = getValue(map, \"digits\", 0);\n\t\tsequence.setupIndex = getValue(map, \"setup\", 0);\n\t\treturn sequence;\n\t}\n\n\treadVertices (map: any, attachment: VertexAttachment, verticesLength: number) {\n\t\tlet scale = this.scale;\n\t\tattachment.worldVerticesLength = verticesLength;\n\t\tlet vertices: Array = map.vertices;\n\t\tif (verticesLength == vertices.length) {\n\t\t\tlet scaledVertices = Utils.toFloatArray(vertices);\n\t\t\tif (scale != 1) {\n\t\t\t\tfor (let i = 0, n = vertices.length; i < n; i++)\n\t\t\t\t\tscaledVertices[i] *= scale;\n\t\t\t}\n\t\t\tattachment.vertices = scaledVertices;\n\t\t\treturn;\n\t\t}\n\t\tlet weights = new Array();\n\t\tlet bones = new Array();\n\t\tfor (let i = 0, n = vertices.length; i < n;) {\n\t\t\tlet boneCount = vertices[i++];\n\t\t\tbones.push(boneCount);\n\t\t\tfor (let nn = i + boneCount * 4; i < nn; i += 4) {\n\t\t\t\tbones.push(vertices[i]);\n\t\t\t\tweights.push(vertices[i + 1] * scale);\n\t\t\t\tweights.push(vertices[i + 2] * scale);\n\t\t\t\tweights.push(vertices[i + 3]);\n\t\t\t}\n\t\t}\n\t\tattachment.bones = bones;\n\t\tattachment.vertices = Utils.toFloatArray(weights);\n\t}\n\n\treadAnimation (map: any, name: string, skeletonData: SkeletonData) {\n\t\tlet scale = this.scale;\n\t\tlet timelines = new Array();\n\n\t\t// Slot timelines.\n\t\tif (map.slots) {\n\t\t\tfor (let slotName in map.slots) {\n\t\t\t\tlet slotMap = map.slots[slotName];\n\t\t\t\tlet slot = skeletonData.findSlot(slotName);\n\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slotName);\n\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\tfor (let timelineName in slotMap) {\n\t\t\t\t\tlet timelineMap = slotMap[timelineName];\n\t\t\t\t\tif (!timelineMap) continue;\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName == \"attachment\") {\n\t\t\t\t\t\tlet timeline = new AttachmentTimeline(frames, slotIndex);\n\t\t\t\t\t\tfor (let frame = 0; frame < frames; frame++) {\n\t\t\t\t\t\t\tlet keyMap = timelineMap[frame];\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(keyMap, \"time\", 0), getValue(keyMap, \"name\", null));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgba\") {\n\t\t\t\t\t\tlet timeline = new RGBATimeline(frames, frames << 2, slotIndex);\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.color);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color.a);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.color);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgb\") {\n\t\t\t\t\t\tlet timeline = new RGBTimeline(frames, frames * 3, slotIndex);\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.color);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.color);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"alpha\") {\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, new AlphaTimeline(frames, frames, slotIndex), 0, 1));\n\t\t\t\t\t} else if (timelineName == \"rgba2\") {\n\t\t\t\t\t\tlet timeline = new RGBA2Timeline(frames, frames * 7, slotIndex);\n\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.light);\n\t\t\t\t\t\tlet color2 = Color.fromString(keyMap.dark);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color.a, color2.r, color2.g, color2.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.light);\n\t\t\t\t\t\t\tlet newColor2 = Color.fromString(nextMap.dark);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color.a, newColor.a, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.r, newColor2.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.g, newColor2.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 6, time, time2, color2.b, newColor2.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tcolor2 = newColor2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\n\t\t\t\t\t} else if (timelineName == \"rgb2\") {\n\t\t\t\t\t\tlet timeline = new RGB2Timeline(frames, frames * 6, slotIndex);\n\n\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet color = Color.fromString(keyMap.light);\n\t\t\t\t\t\tlet color2 = Color.fromString(keyMap.dark);\n\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, color.r, color.g, color.b, color2.r, color2.g, color2.b);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet newColor = Color.fromString(nextMap.light);\n\t\t\t\t\t\t\tlet newColor2 = Color.fromString(nextMap.dark);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, color.r, newColor.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, color.g, newColor.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, color.b, newColor.b, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, color2.r, newColor2.r, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, color2.g, newColor2.g, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, color2.b, newColor2.b, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tcolor = newColor;\n\t\t\t\t\t\t\tcolor2 = newColor2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Bone timelines.\n\t\tif (map.bones) {\n\t\t\tfor (let boneName in map.bones) {\n\t\t\t\tlet boneMap = map.bones[boneName];\n\t\t\t\tlet bone = skeletonData.findBone(boneName);\n\t\t\t\tif (!bone) throw new Error(\"Bone not found: \" + boneName);\n\t\t\t\tlet boneIndex = bone.index;\n\t\t\t\tfor (let timelineName in boneMap) {\n\t\t\t\t\tlet timelineMap = boneMap[timelineName];\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (frames == 0) continue;\n\n\t\t\t\t\tif (timelineName === \"rotate\") {\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, new RotateTimeline(frames, frames, boneIndex), 0, 1));\n\t\t\t\t\t} else if (timelineName === \"translate\") {\n\t\t\t\t\t\tlet timeline = new TranslateTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, scale));\n\t\t\t\t\t} else if (timelineName === \"translatex\") {\n\t\t\t\t\t\tlet timeline = new TranslateXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, scale));\n\t\t\t\t\t} else if (timelineName === \"translatey\") {\n\t\t\t\t\t\tlet timeline = new TranslateYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, scale));\n\t\t\t\t\t} else if (timelineName === \"scale\") {\n\t\t\t\t\t\tlet timeline = new ScaleTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 1, 1));\n\t\t\t\t\t} else if (timelineName === \"scalex\") {\n\t\t\t\t\t\tlet timeline = new ScaleXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 1, 1));\n\t\t\t\t\t} else if (timelineName === \"scaley\") {\n\t\t\t\t\t\tlet timeline = new ScaleYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 1, 1));\n\t\t\t\t\t} else if (timelineName === \"shear\") {\n\t\t\t\t\t\tlet timeline = new ShearTimeline(frames, frames << 1, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline2(timelineMap, timeline, \"x\", \"y\", 0, 1));\n\t\t\t\t\t} else if (timelineName === \"shearx\") {\n\t\t\t\t\t\tlet timeline = new ShearXTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t\t} else if (timelineName === \"sheary\") {\n\t\t\t\t\t\tlet timeline = new ShearYTimeline(frames, frames, boneIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t\t} else if (timelineName === \"inherit\") {\n\t\t\t\t\t\tlet timeline = new InheritTimeline(frames, bone.index);\n\t\t\t\t\t\tfor (let frame = 0; frame < timelineMap.length; frame++) {\n\t\t\t\t\t\t\tlet aFrame = timelineMap[frame];\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(aFrame, \"time\", 0), Utils.enumValue(Inherit, getValue(aFrame, \"inherit\", \"Normal\")));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// IK constraint timelines.\n\t\tif (map.ik) {\n\t\t\tfor (let constraintName in map.ik) {\n\t\t\t\tlet constraintMap = map.ik[constraintName];\n\t\t\t\tlet keyMap = constraintMap[0];\n\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\tlet constraint = skeletonData.findIkConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"IK Constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.ikConstraints.indexOf(constraint);\n\t\t\t\tlet timeline = new IkConstraintTimeline(constraintMap.length, constraintMap.length << 1, constraintIndex);\n\n\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\tlet mix = getValue(keyMap, \"mix\", 1);\n\t\t\t\tlet softness = getValue(keyMap, \"softness\", 0) * scale;\n\n\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\ttimeline.setFrame(frame, time, mix, softness, getValue(keyMap, \"bendPositive\", true) ? 1 : -1, getValue(keyMap, \"compress\", false), getValue(keyMap, \"stretch\", false));\n\t\t\t\t\tlet nextMap = constraintMap[frame + 1];\n\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\tlet mix2 = getValue(nextMap, \"mix\", 1);\n\t\t\t\t\tlet softness2 = getValue(nextMap, \"softness\", 0) * scale;\n\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\tif (curve) {\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mix, mix2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, softness, softness2, scale);\n\t\t\t\t\t}\n\n\t\t\t\t\ttime = time2;\n\t\t\t\t\tmix = mix2;\n\t\t\t\t\tsoftness = softness2;\n\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t}\n\t\t\t\ttimelines.push(timeline);\n\t\t\t}\n\t\t}\n\n\t\t// Transform constraint timelines.\n\t\tif (map.transform) {\n\t\t\tfor (let constraintName in map.transform) {\n\t\t\t\tlet timelineMap = map.transform[constraintName];\n\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\tlet constraint = skeletonData.findTransformConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"Transform constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.transformConstraints.indexOf(constraint);\n\t\t\t\tlet timeline = new TransformConstraintTimeline(timelineMap.length, timelineMap.length * 6, constraintIndex);\n\n\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\tlet mixRotate = getValue(keyMap, \"mixRotate\", 1);\n\t\t\t\tlet mixX = getValue(keyMap, \"mixX\", 1);\n\t\t\t\tlet mixY = getValue(keyMap, \"mixY\", mixX);\n\t\t\t\tlet mixScaleX = getValue(keyMap, \"mixScaleX\", 1);\n\t\t\t\tlet mixScaleY = getValue(keyMap, \"mixScaleY\", mixScaleX);\n\t\t\t\tlet mixShearY = getValue(keyMap, \"mixShearY\", 1);\n\n\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY, mixScaleX, mixScaleY, mixShearY);\n\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\tlet mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\n\t\t\t\t\tlet mixX2 = getValue(nextMap, \"mixX\", 1);\n\t\t\t\t\tlet mixY2 = getValue(nextMap, \"mixY\", mixX2);\n\t\t\t\t\tlet mixScaleX2 = getValue(nextMap, \"mixScaleX\", 1);\n\t\t\t\t\tlet mixScaleY2 = getValue(nextMap, \"mixScaleY\", mixScaleX2);\n\t\t\t\t\tlet mixShearY2 = getValue(nextMap, \"mixShearY\", 1);\n\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\tif (curve) {\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 3, time, time2, mixScaleX, mixScaleX2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 4, time, time2, mixScaleY, mixScaleY2, 1);\n\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 5, time, time2, mixShearY, mixShearY2, 1);\n\t\t\t\t\t}\n\n\t\t\t\t\ttime = time2;\n\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\t\tmixScaleY = mixScaleY2;\n\t\t\t\t\tmixScaleX = mixScaleX2;\n\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t}\n\t\t\t\ttimelines.push(timeline);\n\t\t\t}\n\t\t}\n\n\t\t// Path constraint timelines.\n\t\tif (map.path) {\n\t\t\tfor (let constraintName in map.path) {\n\t\t\t\tlet constraintMap = map.path[constraintName];\n\t\t\t\tlet constraint = skeletonData.findPathConstraint(constraintName);\n\t\t\t\tif (!constraint) throw new Error(\"Path constraint not found: \" + constraintName);\n\t\t\t\tlet constraintIndex = skeletonData.pathConstraints.indexOf(constraint);\n\t\t\t\tfor (let timelineName in constraintMap) {\n\t\t\t\t\tlet timelineMap = constraintMap[timelineName];\n\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName === \"position\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintPositionTimeline(frames, frames, constraintIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, constraint.positionMode == PositionMode.Fixed ? scale : 1));\n\t\t\t\t\t} else if (timelineName === \"spacing\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintSpacingTimeline(frames, frames, constraintIndex);\n\t\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, constraint.spacingMode == SpacingMode.Length || constraint.spacingMode == SpacingMode.Fixed ? scale : 1));\n\t\t\t\t\t} else if (timelineName === \"mix\") {\n\t\t\t\t\t\tlet timeline = new PathConstraintMixTimeline(frames, frames * 3, constraintIndex);\n\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\tlet mixRotate = getValue(keyMap, \"mixRotate\", 1);\n\t\t\t\t\t\tlet mixX = getValue(keyMap, \"mixX\", 1);\n\t\t\t\t\t\tlet mixY = getValue(keyMap, \"mixY\", mixX);\n\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mixRotate, mixX, mixY);\n\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\tlet mixRotate2 = getValue(nextMap, \"mixRotate\", 1);\n\t\t\t\t\t\t\tlet mixX2 = getValue(nextMap, \"mixX\", 1);\n\t\t\t\t\t\t\tlet mixY2 = getValue(nextMap, \"mixY\", mixX2);\n\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\tif (curve) {\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, mixRotate, mixRotate2, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, mixX, mixX2, 1);\n\t\t\t\t\t\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 2, time, time2, mixY, mixY2, 1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\tmixRotate = mixRotate2;\n\t\t\t\t\t\t\tmixX = mixX2;\n\t\t\t\t\t\t\tmixY = mixY2;\n\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Physics constraint timelines.\n\t\tif (map.physics) {\n\t\t\tfor (let constraintName in map.physics) {\n\t\t\t\tlet constraintMap = map.physics[constraintName];\n\t\t\t\tlet constraintIndex = -1;\n\t\t\t\tif (constraintName.length > 0) {\n\t\t\t\t\tlet constraint = skeletonData.findPhysicsConstraint(constraintName);\n\t\t\t\t\tif (!constraint) throw new Error(\"Physics constraint not found: \" + constraintName);\n\t\t\t\t\tconstraintIndex = skeletonData.physicsConstraints.indexOf(constraint);\n\t\t\t\t}\n\t\t\t\tfor (let timelineName in constraintMap) {\n\t\t\t\t\tlet timelineMap = constraintMap[timelineName];\n\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\tlet frames = timelineMap.length;\n\t\t\t\t\tif (timelineName == \"reset\") {\n\t\t\t\t\t\tconst timeline = new PhysicsConstraintResetTimeline(frames, constraintIndex);\n\t\t\t\t\t\tfor (let frame = 0; keyMap != null; keyMap = timelineMap[frame + 1], frame++)\n\t\t\t\t\t\t\ttimeline.setFrame(frame, getValue(keyMap, \"time\", 0));\n\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet timeline;\n\t\t\t\t\tif (timelineName == \"inertia\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintInertiaTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"strength\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintStrengthTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"damping\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintDampingTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"mass\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintMassTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"wind\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintWindTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"gravity\")\n\t\t\t\t\t\ttimeline = new PhysicsConstraintGravityTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse if (timelineName == \"mix\") //\n\t\t\t\t\t\ttimeline = new PhysicsConstraintMixTimeline(frames, frames, constraintIndex);\n\t\t\t\t\telse\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\ttimelines.push(readTimeline1(timelineMap, timeline, 0, 1));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Attachment timelines.\n\t\tif (map.attachments) {\n\t\t\tfor (let attachmentsName in map.attachments) {\n\t\t\t\tlet attachmentsMap = map.attachments[attachmentsName];\n\t\t\t\tlet skin = skeletonData.findSkin(attachmentsName);\n\t\t\t\tif (!skin) throw new Error(\"Skin not found: \" + attachmentsName);\n\t\t\t\tfor (let slotMapName in attachmentsMap) {\n\t\t\t\t\tlet slotMap = attachmentsMap[slotMapName];\n\t\t\t\t\tlet slot = skeletonData.findSlot(slotMapName);\n\t\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slotMapName);\n\t\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\t\tfor (let attachmentMapName in slotMap) {\n\t\t\t\t\t\tlet attachmentMap = slotMap[attachmentMapName];\n\t\t\t\t\t\tlet attachment = skin.getAttachment(slotIndex, attachmentMapName);\n\n\t\t\t\t\t\tfor (let timelineMapName in attachmentMap) {\n\t\t\t\t\t\t\tlet timelineMap = attachmentMap[timelineMapName];\n\t\t\t\t\t\t\tlet keyMap = timelineMap[0];\n\t\t\t\t\t\t\tif (!keyMap) continue;\n\n\t\t\t\t\t\t\tif (timelineMapName == \"deform\") {\n\t\t\t\t\t\t\t\tlet weighted = attachment.bones;\n\t\t\t\t\t\t\t\tlet vertices = attachment.vertices;\n\t\t\t\t\t\t\t\tlet deformLength = weighted ? vertices.length / 3 * 2 : vertices.length;\n\n\t\t\t\t\t\t\t\tlet timeline = new DeformTimeline(timelineMap.length, timelineMap.length, slotIndex, attachment);\n\t\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\t\tfor (let frame = 0, bezier = 0; ; frame++) {\n\t\t\t\t\t\t\t\t\tlet deform: NumberArrayLike;\n\t\t\t\t\t\t\t\t\tlet verticesValue: Array = getValue(keyMap, \"vertices\", null);\n\t\t\t\t\t\t\t\t\tif (!verticesValue)\n\t\t\t\t\t\t\t\t\t\tdeform = weighted ? Utils.newFloatArray(deformLength) : vertices;\n\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\tdeform = Utils.newFloatArray(deformLength);\n\t\t\t\t\t\t\t\t\t\tlet start = getValue(keyMap, \"offset\", 0);\n\t\t\t\t\t\t\t\t\t\tUtils.arrayCopy(verticesValue, 0, deform, start, verticesValue.length);\n\t\t\t\t\t\t\t\t\t\tif (scale != 1) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = start, n = i + verticesValue.length; i < n; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tdeform[i] *= scale;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tif (!weighted) {\n\t\t\t\t\t\t\t\t\t\t\tfor (let i = 0; i < deformLength; i++)\n\t\t\t\t\t\t\t\t\t\t\t\tdeform[i] += vertices[i];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, deform);\n\t\t\t\t\t\t\t\t\tlet nextMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\t\tif (!nextMap) {\n\t\t\t\t\t\t\t\t\t\ttimeline.shrink(bezier);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\t\t\t\t\t\t\t\tlet curve = keyMap.curve;\n\t\t\t\t\t\t\t\t\tif (curve) bezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, 0, 1, 1);\n\t\t\t\t\t\t\t\t\ttime = time2;\n\t\t\t\t\t\t\t\t\tkeyMap = nextMap;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\t} else if (timelineMapName == \"sequence\") {\n\t\t\t\t\t\t\t\tlet timeline = new SequenceTimeline(timelineMap.length, slotIndex, attachment as unknown as HasTextureRegion);\n\t\t\t\t\t\t\t\tlet lastDelay = 0;\n\t\t\t\t\t\t\t\tfor (let frame = 0; frame < timelineMap.length; frame++) {\n\t\t\t\t\t\t\t\t\tlet delay = getValue(keyMap, \"delay\", lastDelay);\n\t\t\t\t\t\t\t\t\tlet time = getValue(keyMap, \"time\", 0);\n\t\t\t\t\t\t\t\t\tlet mode = SequenceMode[getValue(keyMap, \"mode\", \"hold\")] as unknown as number;\n\t\t\t\t\t\t\t\t\tlet index = getValue(keyMap, \"index\", 0);\n\t\t\t\t\t\t\t\t\ttimeline.setFrame(frame, time, mode, index, delay);\n\t\t\t\t\t\t\t\t\tlastDelay = delay;\n\t\t\t\t\t\t\t\t\tkeyMap = timelineMap[frame + 1];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttimelines.push(timeline);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Draw order timelines.\n\t\tif (map.drawOrder) {\n\t\t\tlet timeline = new DrawOrderTimeline(map.drawOrder.length);\n\t\t\tlet slotCount = skeletonData.slots.length;\n\t\t\tlet frame = 0;\n\t\t\tfor (let i = 0; i < map.drawOrder.length; i++, frame++) {\n\t\t\t\tlet drawOrderMap = map.drawOrder[i];\n\t\t\t\tlet drawOrder: Array | null = null;\n\t\t\t\tlet offsets = getValue(drawOrderMap, \"offsets\", null);\n\t\t\t\tif (offsets) {\n\t\t\t\t\tdrawOrder = Utils.newArray(slotCount, -1);\n\t\t\t\t\tlet unchanged = Utils.newArray(slotCount - offsets.length, 0);\n\t\t\t\t\tlet originalIndex = 0, unchangedIndex = 0;\n\t\t\t\t\tfor (let ii = 0; ii < offsets.length; ii++) {\n\t\t\t\t\t\tlet offsetMap = offsets[ii];\n\t\t\t\t\t\tlet slot = skeletonData.findSlot(offsetMap.slot);\n\t\t\t\t\t\tif (!slot) throw new Error(\"Slot not found: \" + slot);\n\t\t\t\t\t\tlet slotIndex = slot.index;\n\t\t\t\t\t\t// Collect unchanged items.\n\t\t\t\t\t\twhile (originalIndex != slotIndex)\n\t\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t\t// Set changed items.\n\t\t\t\t\t\tdrawOrder[originalIndex + offsetMap.offset] = originalIndex++;\n\t\t\t\t\t}\n\t\t\t\t\t// Collect remaining unchanged items.\n\t\t\t\t\twhile (originalIndex < slotCount)\n\t\t\t\t\t\tunchanged[unchangedIndex++] = originalIndex++;\n\t\t\t\t\t// Fill in unchanged items.\n\t\t\t\t\tfor (let ii = slotCount - 1; ii >= 0; ii--)\n\t\t\t\t\t\tif (drawOrder[ii] == -1) drawOrder[ii] = unchanged[--unchangedIndex];\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(frame, getValue(drawOrderMap, \"time\", 0), drawOrder);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\t// Event timelines.\n\t\tif (map.events) {\n\t\t\tlet timeline = new EventTimeline(map.events.length);\n\t\t\tlet frame = 0;\n\t\t\tfor (let i = 0; i < map.events.length; i++, frame++) {\n\t\t\t\tlet eventMap = map.events[i];\n\t\t\t\tlet eventData = skeletonData.findEvent(eventMap.name);\n\t\t\t\tif (!eventData) throw new Error(\"Event not found: \" + eventMap.name);\n\t\t\t\tlet event = new Event(Utils.toSinglePrecision(getValue(eventMap, \"time\", 0)), eventData);\n\t\t\t\tevent.intValue = getValue(eventMap, \"int\", eventData.intValue);\n\t\t\t\tevent.floatValue = getValue(eventMap, \"float\", eventData.floatValue);\n\t\t\t\tevent.stringValue = getValue(eventMap, \"string\", eventData.stringValue);\n\t\t\t\tif (event.data.audioPath) {\n\t\t\t\t\tevent.volume = getValue(eventMap, \"volume\", 1);\n\t\t\t\t\tevent.balance = getValue(eventMap, \"balance\", 0);\n\t\t\t\t}\n\t\t\t\ttimeline.setFrame(frame, event);\n\t\t\t}\n\t\t\ttimelines.push(timeline);\n\t\t}\n\n\t\tlet duration = 0;\n\t\tfor (let i = 0, n = timelines.length; i < n; i++)\n\t\t\tduration = Math.max(duration, timelines[i].getDuration());\n\t\tskeletonData.animations.push(new Animation(name, timelines, duration));\n\t}\n}\n\nclass LinkedMesh {\n\tparent: string; skin: string;\n\tslotIndex: number;\n\tmesh: MeshAttachment;\n\tinheritTimeline: boolean;\n\n\tconstructor (mesh: MeshAttachment, skin: string, slotIndex: number, parent: string, inheritDeform: boolean) {\n\t\tthis.mesh = mesh;\n\t\tthis.skin = skin;\n\t\tthis.slotIndex = slotIndex;\n\t\tthis.parent = parent;\n\t\tthis.inheritTimeline = inheritDeform;\n\t}\n}\n\nfunction readTimeline1 (keys: any[], timeline: CurveTimeline1, defaultValue: number, scale: number) {\n\tlet keyMap = keys[0];\n\tlet time = getValue(keyMap, \"time\", 0);\n\tlet value = getValue(keyMap, \"value\", defaultValue) * scale;\n\tlet bezier = 0;\n\tfor (let frame = 0; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value);\n\t\tlet nextMap = keys[frame + 1];\n\t\tif (!nextMap) {\n\t\t\ttimeline.shrink(bezier);\n\t\t\treturn timeline;\n\t\t}\n\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\tlet value2 = getValue(nextMap, \"value\", defaultValue) * scale;\n\t\tif (keyMap.curve) bezier = readCurve(keyMap.curve, timeline, bezier, frame, 0, time, time2, value, value2, scale);\n\t\ttime = time2;\n\t\tvalue = value2;\n\t\tkeyMap = nextMap;\n\t}\n}\n\nfunction readTimeline2 (keys: any[], timeline: CurveTimeline2, name1: string, name2: string, defaultValue: number, scale: number) {\n\tlet keyMap = keys[0];\n\tlet time = getValue(keyMap, \"time\", 0);\n\tlet value1 = getValue(keyMap, name1, defaultValue) * scale;\n\tlet value2 = getValue(keyMap, name2, defaultValue) * scale;\n\tlet bezier = 0;\n\tfor (let frame = 0; ; frame++) {\n\t\ttimeline.setFrame(frame, time, value1, value2);\n\t\tlet nextMap = keys[frame + 1];\n\t\tif (!nextMap) {\n\t\t\ttimeline.shrink(bezier);\n\t\t\treturn timeline;\n\t\t}\n\t\tlet time2 = getValue(nextMap, \"time\", 0);\n\t\tlet nvalue1 = getValue(nextMap, name1, defaultValue) * scale;\n\t\tlet nvalue2 = getValue(nextMap, name2, defaultValue) * scale;\n\t\tlet curve = keyMap.curve;\n\t\tif (curve) {\n\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 0, time, time2, value1, nvalue1, scale);\n\t\t\tbezier = readCurve(curve, timeline, bezier, frame, 1, time, time2, value2, nvalue2, scale);\n\t\t}\n\t\ttime = time2;\n\t\tvalue1 = nvalue1;\n\t\tvalue2 = nvalue2;\n\t\tkeyMap = nextMap;\n\t}\n}\n\nfunction readCurve (curve: any, timeline: CurveTimeline, bezier: number, frame: number, value: number, time1: number, time2: number,\n\tvalue1: number, value2: number, scale: number) {\n\tif (curve == \"stepped\") {\n\t\ttimeline.setStepped(frame);\n\t\treturn bezier;\n\t}\n\tlet i = value << 2;\n\tlet cx1 = curve[i];\n\tlet cy1 = curve[i + 1] * scale;\n\tlet cx2 = curve[i + 2];\n\tlet cy2 = curve[i + 3] * scale;\n\ttimeline.setBezier(bezier, frame, value, time1, value1, cx1, cy1, cx2, cy2, time2, value2);\n\treturn bezier + 1;\n}\n\nfunction getValue (map: any, property: string, defaultValue: any) {\n\treturn map[property] !== undefined ? map[property] : defaultValue;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\n(() => {\n\tif (typeof Math.fround === \"undefined\") {\n\t\tMath.fround = (function (array) {\n\t\t\treturn function (x: number) {\n\t\t\t\treturn array[0] = x, array[0];\n\t\t\t};\n\t\t})(new Float32Array(1));\n\t}\n})();\n\nexport { }\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Restorable, BlendMode } from \"@esotericsoftware/spine-core\";\n\nexport class ManagedWebGLRenderingContext {\n\tpublic canvas: HTMLCanvasElement | OffscreenCanvas;\n\tpublic gl: WebGLRenderingContext;\n\tprivate restorables = new Array();\n\n\tconstructor (canvasOrContext: HTMLCanvasElement | WebGLRenderingContext, contextConfig: any = { alpha: \"true\" }) {\n\t\tif (!((canvasOrContext instanceof WebGLRenderingContext) || (typeof WebGL2RenderingContext !== 'undefined' && canvasOrContext instanceof WebGL2RenderingContext))) {\n\t\t\tlet canvas: HTMLCanvasElement = canvasOrContext;\n\t\t\tthis.gl = (canvas.getContext(\"webgl2\", contextConfig) || canvas.getContext(\"webgl\", contextConfig));\n\t\t\tthis.canvas = canvas;\n\t\t\tcanvas.addEventListener(\"webglcontextlost\", (e: any) => {\n\t\t\t\tlet event = e;\n\t\t\t\tif (e) e.preventDefault();\n\t\t\t});\n\t\t\tcanvas.addEventListener(\"webglcontextrestored\", (e: any) => {\n\t\t\t\tfor (let i = 0, n = this.restorables.length; i < n; i++)\n\t\t\t\t\tthis.restorables[i].restore();\n\t\t\t});\n\t\t} else {\n\t\t\tthis.gl = canvasOrContext;\n\t\t\tthis.canvas = this.gl.canvas;\n\t\t}\n\t}\n\n\taddRestorable (restorable: Restorable) {\n\t\tthis.restorables.push(restorable);\n\t}\n\n\tremoveRestorable (restorable: Restorable) {\n\t\tlet index = this.restorables.indexOf(restorable);\n\t\tif (index > -1) this.restorables.splice(index, 1);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture, Disposable, Restorable, TextureFilter, TextureWrap } from \"@esotericsoftware/spine-core\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class GLTexture extends Texture implements Disposable, Restorable {\n\tcontext: ManagedWebGLRenderingContext;\n\tprivate texture: WebGLTexture | null = null;\n\tprivate boundUnit = 0;\n\tprivate useMipMaps = false;\n\n\tpublic static DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL = false;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, image: HTMLImageElement | ImageBitmap, useMipMaps: boolean = false) {\n\t\tsuper(image);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.useMipMaps = useMipMaps;\n\t\tthis.restore();\n\t\tthis.context.addRestorable(this);\n\t}\n\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) {\n\t\tlet gl = this.context.gl;\n\t\tthis.bind();\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, GLTexture.validateMagFilter(magFilter));\n\t\tthis.useMipMaps = GLTexture.usesMipMaps(minFilter);\n\t\tif (this.useMipMaps) gl.generateMipmap(gl.TEXTURE_2D);\n\t}\n\n\tstatic validateMagFilter (magFilter: TextureFilter) {\n\t\tswitch (magFilter) {\n\t\t\tcase TextureFilter.MipMapLinearLinear:\n\t\t\tcase TextureFilter.MipMapLinearNearest:\n\t\t\tcase TextureFilter.MipMapNearestLinear:\n\t\t\tcase TextureFilter.MipMapNearestNearest:\n\t\t\t\treturn TextureFilter.Linear;\n\t\t\tdefault:\n\t\t\t\treturn magFilter;\n\t\t}\n\t}\n\n\tstatic usesMipMaps (filter: TextureFilter) {\n\t\tswitch (filter) {\n\t\t\tcase TextureFilter.MipMapLinearLinear:\n\t\t\tcase TextureFilter.MipMapLinearNearest:\n\t\t\tcase TextureFilter.MipMapNearestLinear:\n\t\t\tcase TextureFilter.MipMapNearestNearest:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) {\n\t\tlet gl = this.context.gl;\n\t\tthis.bind();\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, uWrap);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, vWrap);\n\t}\n\n\tupdate (useMipMaps: boolean) {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.texture) this.texture = this.context.gl.createTexture();\n\t\tthis.bind();\n\t\tif (GLTexture.DISABLE_UNPACK_PREMULTIPLIED_ALPHA_WEBGL) gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n\t\tgl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this._image);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, useMipMaps ? gl.LINEAR_MIPMAP_LINEAR : gl.LINEAR);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n\t\tgl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n\t\tif (useMipMaps) gl.generateMipmap(gl.TEXTURE_2D);\n\t}\n\n\trestore () {\n\t\tthis.texture = null;\n\t\tthis.update(this.useMipMaps);\n\t}\n\n\tbind (unit: number = 0) {\n\t\tlet gl = this.context.gl;\n\t\tthis.boundUnit = unit;\n\t\tgl.activeTexture(gl.TEXTURE0 + unit);\n\t\tgl.bindTexture(gl.TEXTURE_2D, this.texture);\n\t}\n\n\tunbind () {\n\t\tlet gl = this.context.gl;\n\t\tgl.activeTexture(gl.TEXTURE0 + this.boundUnit);\n\t\tgl.bindTexture(gl.TEXTURE_2D, null);\n\t}\n\n\tdispose () {\n\t\tthis.context.removeRestorable(this);\n\t\tlet gl = this.context.gl;\n\t\tgl.deleteTexture(this.texture);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { AssetManagerBase, Downloader } from \"@esotericsoftware/spine-core\"\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\nimport { GLTexture } from \"./GLTexture.js\";\n\n\nexport class AssetManager extends AssetManagerBase {\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, pathPrefix: string = \"\", downloader: Downloader = new Downloader()) {\n\t\tsuper((image: HTMLImageElement | ImageBitmap) => {\n\t\t\treturn new GLTexture(context, image);\n\t\t}, pathPrefix, downloader);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Matrix4, M00, M01, M02, M03, M10, M11, M12, M13, M20, M21, M22, M23, M30, M31, M32, M33 } from \"./Matrix4.js\";\n\nexport class Vector3 {\n\tx = 0;\n\ty = 0;\n\tz = 0;\n\n\tconstructor (x: number = 0, y: number = 0, z: number = 0) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t}\n\n\tsetFrom (v: Vector3): Vector3 {\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\treturn this;\n\t}\n\n\tset (x: number, y: number, z: number): Vector3 {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\treturn this;\n\t}\n\n\tadd (v: Vector3): Vector3 {\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\treturn this;\n\t}\n\n\tsub (v: Vector3): Vector3 {\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\treturn this;\n\t}\n\n\tscale (s: number): Vector3 {\n\t\tthis.x *= s;\n\t\tthis.y *= s;\n\t\tthis.z *= s;\n\t\treturn this;\n\t}\n\n\tnormalize (): Vector3 {\n\t\tlet len = this.length();\n\t\tif (len == 0) return this;\n\t\tlen = 1 / len;\n\t\tthis.x *= len;\n\t\tthis.y *= len;\n\t\tthis.z *= len;\n\t\treturn this;\n\t}\n\n\tcross (v: Vector3): Vector3 {\n\t\treturn this.set(this.y * v.z - this.z * v.y, this.z * v.x - this.x * v.z, this.x * v.y - this.y * v.x)\n\t}\n\n\tmultiply (matrix: Matrix4): Vector3 {\n\t\tlet l_mat = matrix.values;\n\t\treturn this.set(this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03],\n\t\t\tthis.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13],\n\t\t\tthis.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23]);\n\t}\n\n\tproject (matrix: Matrix4): Vector3 {\n\t\tlet l_mat = matrix.values;\n\t\tlet l_w = 1 / (this.x * l_mat[M30] + this.y * l_mat[M31] + this.z * l_mat[M32] + l_mat[M33]);\n\t\treturn this.set((this.x * l_mat[M00] + this.y * l_mat[M01] + this.z * l_mat[M02] + l_mat[M03]) * l_w,\n\t\t\t(this.x * l_mat[M10] + this.y * l_mat[M11] + this.z * l_mat[M12] + l_mat[M13]) * l_w,\n\t\t\t(this.x * l_mat[M20] + this.y * l_mat[M21] + this.z * l_mat[M22] + l_mat[M23]) * l_w);\n\t}\n\n\tdot (v: Vector3): number {\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t}\n\n\tlength (): number {\n\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t}\n\n\tdistance (v: Vector3): number {\n\t\tlet a = v.x - this.x;\n\t\tlet b = v.y - this.y;\n\t\tlet c = v.z - this.z;\n\t\treturn Math.sqrt(a * a + b * b + c * c);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Vector3 } from \"./Vector3.js\";\n\nexport const M00 = 0;\nexport const M01 = 4;\nexport const M02 = 8;\nexport const M03 = 12;\nexport const M10 = 1;\nexport const M11 = 5;\nexport const M12 = 9;\nexport const M13 = 13;\nexport const M20 = 2;\nexport const M21 = 6;\nexport const M22 = 10;\nexport const M23 = 14;\nexport const M30 = 3;\nexport const M31 = 7;\nexport const M32 = 11;\nexport const M33 = 15;\n\nexport class Matrix4 {\n\ttemp: Float32Array = new Float32Array(16);\n\tvalues: Float32Array = new Float32Array(16);\n\n\tprivate static xAxis = new Vector3();\n\tprivate static yAxis = new Vector3();\n\tprivate static zAxis = new Vector3();\n\tprivate static tmpMatrix = new Matrix4();\n\n\tconstructor () {\n\t\tlet v = this.values;\n\t\tv[M00] = 1;\n\t\tv[M11] = 1;\n\t\tv[M22] = 1;\n\t\tv[M33] = 1;\n\t}\n\n\tset (values: ArrayLike): Matrix4 {\n\t\tthis.values.set(values);\n\t\treturn this;\n\t}\n\n\ttranspose (): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tt[M00] = v[M00];\n\t\tt[M01] = v[M10];\n\t\tt[M02] = v[M20];\n\t\tt[M03] = v[M30];\n\t\tt[M10] = v[M01];\n\t\tt[M11] = v[M11];\n\t\tt[M12] = v[M21];\n\t\tt[M13] = v[M31];\n\t\tt[M20] = v[M02];\n\t\tt[M21] = v[M12];\n\t\tt[M22] = v[M22];\n\t\tt[M23] = v[M32];\n\t\tt[M30] = v[M03];\n\t\tt[M31] = v[M13];\n\t\tt[M32] = v[M23];\n\t\tt[M33] = v[M33];\n\t\treturn this.set(t);\n\t}\n\n\tidentity (): Matrix4 {\n\t\tlet v = this.values;\n\t\tv[M00] = 1;\n\t\tv[M01] = 0;\n\t\tv[M02] = 0;\n\t\tv[M03] = 0;\n\t\tv[M10] = 0;\n\t\tv[M11] = 1;\n\t\tv[M12] = 0;\n\t\tv[M13] = 0;\n\t\tv[M20] = 0;\n\t\tv[M21] = 0;\n\t\tv[M22] = 1;\n\t\tv[M23] = 0;\n\t\tv[M30] = 0;\n\t\tv[M31] = 0;\n\t\tv[M32] = 0;\n\t\tv[M33] = 1;\n\t\treturn this;\n\t}\n\n\tinvert (): Matrix4 {\n\t\tlet v = this.values;\n\t\tlet t = this.temp;\n\t\tlet l_det = v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03]\n\t\t\t+ v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03]\n\t\t\t- v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13]\n\t\t\t- v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13]\n\t\t\t+ v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23]\n\t\t\t+ v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23]\n\t\t\t- v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33]\n\t\t\t- v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33];\n\t\tif (l_det == 0) throw new Error(\"non-invertible matrix\");\n\t\tlet inv_det = 1.0 / l_det;\n\t\tt[M00] = v[M12] * v[M23] * v[M31] - v[M13] * v[M22] * v[M31] + v[M13] * v[M21] * v[M32]\n\t\t\t- v[M11] * v[M23] * v[M32] - v[M12] * v[M21] * v[M33] + v[M11] * v[M22] * v[M33];\n\t\tt[M01] = v[M03] * v[M22] * v[M31] - v[M02] * v[M23] * v[M31] - v[M03] * v[M21] * v[M32]\n\t\t\t+ v[M01] * v[M23] * v[M32] + v[M02] * v[M21] * v[M33] - v[M01] * v[M22] * v[M33];\n\t\tt[M02] = v[M02] * v[M13] * v[M31] - v[M03] * v[M12] * v[M31] + v[M03] * v[M11] * v[M32]\n\t\t\t- v[M01] * v[M13] * v[M32] - v[M02] * v[M11] * v[M33] + v[M01] * v[M12] * v[M33];\n\t\tt[M03] = v[M03] * v[M12] * v[M21] - v[M02] * v[M13] * v[M21] - v[M03] * v[M11] * v[M22]\n\t\t\t+ v[M01] * v[M13] * v[M22] + v[M02] * v[M11] * v[M23] - v[M01] * v[M12] * v[M23];\n\t\tt[M10] = v[M13] * v[M22] * v[M30] - v[M12] * v[M23] * v[M30] - v[M13] * v[M20] * v[M32]\n\t\t\t+ v[M10] * v[M23] * v[M32] + v[M12] * v[M20] * v[M33] - v[M10] * v[M22] * v[M33];\n\t\tt[M11] = v[M02] * v[M23] * v[M30] - v[M03] * v[M22] * v[M30] + v[M03] * v[M20] * v[M32]\n\t\t\t- v[M00] * v[M23] * v[M32] - v[M02] * v[M20] * v[M33] + v[M00] * v[M22] * v[M33];\n\t\tt[M12] = v[M03] * v[M12] * v[M30] - v[M02] * v[M13] * v[M30] - v[M03] * v[M10] * v[M32]\n\t\t\t+ v[M00] * v[M13] * v[M32] + v[M02] * v[M10] * v[M33] - v[M00] * v[M12] * v[M33];\n\t\tt[M13] = v[M02] * v[M13] * v[M20] - v[M03] * v[M12] * v[M20] + v[M03] * v[M10] * v[M22]\n\t\t\t- v[M00] * v[M13] * v[M22] - v[M02] * v[M10] * v[M23] + v[M00] * v[M12] * v[M23];\n\t\tt[M20] = v[M11] * v[M23] * v[M30] - v[M13] * v[M21] * v[M30] + v[M13] * v[M20] * v[M31]\n\t\t\t- v[M10] * v[M23] * v[M31] - v[M11] * v[M20] * v[M33] + v[M10] * v[M21] * v[M33];\n\t\tt[M21] = v[M03] * v[M21] * v[M30] - v[M01] * v[M23] * v[M30] - v[M03] * v[M20] * v[M31]\n\t\t\t+ v[M00] * v[M23] * v[M31] + v[M01] * v[M20] * v[M33] - v[M00] * v[M21] * v[M33];\n\t\tt[M22] = v[M01] * v[M13] * v[M30] - v[M03] * v[M11] * v[M30] + v[M03] * v[M10] * v[M31]\n\t\t\t- v[M00] * v[M13] * v[M31] - v[M01] * v[M10] * v[M33] + v[M00] * v[M11] * v[M33];\n\t\tt[M23] = v[M03] * v[M11] * v[M20] - v[M01] * v[M13] * v[M20] - v[M03] * v[M10] * v[M21]\n\t\t\t+ v[M00] * v[M13] * v[M21] + v[M01] * v[M10] * v[M23] - v[M00] * v[M11] * v[M23];\n\t\tt[M30] = v[M12] * v[M21] * v[M30] - v[M11] * v[M22] * v[M30] - v[M12] * v[M20] * v[M31]\n\t\t\t+ v[M10] * v[M22] * v[M31] + v[M11] * v[M20] * v[M32] - v[M10] * v[M21] * v[M32];\n\t\tt[M31] = v[M01] * v[M22] * v[M30] - v[M02] * v[M21] * v[M30] + v[M02] * v[M20] * v[M31]\n\t\t\t- v[M00] * v[M22] * v[M31] - v[M01] * v[M20] * v[M32] + v[M00] * v[M21] * v[M32];\n\t\tt[M32] = v[M02] * v[M11] * v[M30] - v[M01] * v[M12] * v[M30] - v[M02] * v[M10] * v[M31]\n\t\t\t+ v[M00] * v[M12] * v[M31] + v[M01] * v[M10] * v[M32] - v[M00] * v[M11] * v[M32];\n\t\tt[M33] = v[M01] * v[M12] * v[M20] - v[M02] * v[M11] * v[M20] + v[M02] * v[M10] * v[M21]\n\t\t\t- v[M00] * v[M12] * v[M21] - v[M01] * v[M10] * v[M22] + v[M00] * v[M11] * v[M22];\n\t\tv[M00] = t[M00] * inv_det;\n\t\tv[M01] = t[M01] * inv_det;\n\t\tv[M02] = t[M02] * inv_det;\n\t\tv[M03] = t[M03] * inv_det;\n\t\tv[M10] = t[M10] * inv_det;\n\t\tv[M11] = t[M11] * inv_det;\n\t\tv[M12] = t[M12] * inv_det;\n\t\tv[M13] = t[M13] * inv_det;\n\t\tv[M20] = t[M20] * inv_det;\n\t\tv[M21] = t[M21] * inv_det;\n\t\tv[M22] = t[M22] * inv_det;\n\t\tv[M23] = t[M23] * inv_det;\n\t\tv[M30] = t[M30] * inv_det;\n\t\tv[M31] = t[M31] * inv_det;\n\t\tv[M32] = t[M32] * inv_det;\n\t\tv[M33] = t[M33] * inv_det;\n\t\treturn this;\n\t}\n\n\tdeterminant (): number {\n\t\tlet v = this.values;\n\t\treturn v[M30] * v[M21] * v[M12] * v[M03] - v[M20] * v[M31] * v[M12] * v[M03] - v[M30] * v[M11] * v[M22] * v[M03]\n\t\t\t+ v[M10] * v[M31] * v[M22] * v[M03] + v[M20] * v[M11] * v[M32] * v[M03] - v[M10] * v[M21] * v[M32] * v[M03]\n\t\t\t- v[M30] * v[M21] * v[M02] * v[M13] + v[M20] * v[M31] * v[M02] * v[M13] + v[M30] * v[M01] * v[M22] * v[M13]\n\t\t\t- v[M00] * v[M31] * v[M22] * v[M13] - v[M20] * v[M01] * v[M32] * v[M13] + v[M00] * v[M21] * v[M32] * v[M13]\n\t\t\t+ v[M30] * v[M11] * v[M02] * v[M23] - v[M10] * v[M31] * v[M02] * v[M23] - v[M30] * v[M01] * v[M12] * v[M23]\n\t\t\t+ v[M00] * v[M31] * v[M12] * v[M23] + v[M10] * v[M01] * v[M32] * v[M23] - v[M00] * v[M11] * v[M32] * v[M23]\n\t\t\t- v[M20] * v[M11] * v[M02] * v[M33] + v[M10] * v[M21] * v[M02] * v[M33] + v[M20] * v[M01] * v[M12] * v[M33]\n\t\t\t- v[M00] * v[M21] * v[M12] * v[M33] - v[M10] * v[M01] * v[M22] * v[M33] + v[M00] * v[M11] * v[M22] * v[M33];\n\t}\n\n\ttranslate (x: number, y: number, z: number): Matrix4 {\n\t\tlet v = this.values;\n\t\tv[M03] += x;\n\t\tv[M13] += y;\n\t\tv[M23] += z;\n\t\treturn this;\n\t}\n\n\tcopy (): Matrix4 {\n\t\treturn new Matrix4().set(this.values);\n\t}\n\n\tprojection (near: number, far: number, fovy: number, aspectRatio: number): Matrix4 {\n\t\tthis.identity();\n\t\tlet l_fd = (1.0 / Math.tan((fovy * (Math.PI / 180)) / 2.0));\n\t\tlet l_a1 = (far + near) / (near - far);\n\t\tlet l_a2 = (2 * far * near) / (near - far);\n\t\tlet v = this.values;\n\t\tv[M00] = l_fd / aspectRatio;\n\t\tv[M10] = 0;\n\t\tv[M20] = 0;\n\t\tv[M30] = 0;\n\t\tv[M01] = 0;\n\t\tv[M11] = l_fd;\n\t\tv[M21] = 0;\n\t\tv[M31] = 0;\n\t\tv[M02] = 0;\n\t\tv[M12] = 0;\n\t\tv[M22] = l_a1;\n\t\tv[M32] = -1;\n\t\tv[M03] = 0;\n\t\tv[M13] = 0;\n\t\tv[M23] = l_a2;\n\t\tv[M33] = 0;\n\t\treturn this;\n\t}\n\n\tortho2d (x: number, y: number, width: number, height: number): Matrix4 {\n\t\treturn this.ortho(x, x + width, y, y + height, 0, 1);\n\t}\n\n\tortho (left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4 {\n\t\tthis.identity();\n\t\tlet x_orth = 2 / (right - left);\n\t\tlet y_orth = 2 / (top - bottom);\n\t\tlet z_orth = -2 / (far - near);\n\n\t\tlet tx = -(right + left) / (right - left);\n\t\tlet ty = -(top + bottom) / (top - bottom);\n\t\tlet tz = -(far + near) / (far - near);\n\n\t\tlet v = this.values;\n\t\tv[M00] = x_orth;\n\t\tv[M10] = 0;\n\t\tv[M20] = 0;\n\t\tv[M30] = 0;\n\t\tv[M01] = 0;\n\t\tv[M11] = y_orth;\n\t\tv[M21] = 0;\n\t\tv[M31] = 0;\n\t\tv[M02] = 0;\n\t\tv[M12] = 0;\n\t\tv[M22] = z_orth;\n\t\tv[M32] = 0;\n\t\tv[M03] = tx;\n\t\tv[M13] = ty;\n\t\tv[M23] = tz;\n\t\tv[M33] = 1;\n\t\treturn this;\n\t}\n\n\tmultiply (matrix: Matrix4): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tlet m = matrix.values;\n\t\tt[M00] = v[M00] * m[M00] + v[M01] * m[M10] + v[M02] * m[M20] + v[M03] * m[M30];\n\t\tt[M01] = v[M00] * m[M01] + v[M01] * m[M11] + v[M02] * m[M21] + v[M03] * m[M31];\n\t\tt[M02] = v[M00] * m[M02] + v[M01] * m[M12] + v[M02] * m[M22] + v[M03] * m[M32];\n\t\tt[M03] = v[M00] * m[M03] + v[M01] * m[M13] + v[M02] * m[M23] + v[M03] * m[M33];\n\t\tt[M10] = v[M10] * m[M00] + v[M11] * m[M10] + v[M12] * m[M20] + v[M13] * m[M30];\n\t\tt[M11] = v[M10] * m[M01] + v[M11] * m[M11] + v[M12] * m[M21] + v[M13] * m[M31];\n\t\tt[M12] = v[M10] * m[M02] + v[M11] * m[M12] + v[M12] * m[M22] + v[M13] * m[M32];\n\t\tt[M13] = v[M10] * m[M03] + v[M11] * m[M13] + v[M12] * m[M23] + v[M13] * m[M33];\n\t\tt[M20] = v[M20] * m[M00] + v[M21] * m[M10] + v[M22] * m[M20] + v[M23] * m[M30];\n\t\tt[M21] = v[M20] * m[M01] + v[M21] * m[M11] + v[M22] * m[M21] + v[M23] * m[M31];\n\t\tt[M22] = v[M20] * m[M02] + v[M21] * m[M12] + v[M22] * m[M22] + v[M23] * m[M32];\n\t\tt[M23] = v[M20] * m[M03] + v[M21] * m[M13] + v[M22] * m[M23] + v[M23] * m[M33];\n\t\tt[M30] = v[M30] * m[M00] + v[M31] * m[M10] + v[M32] * m[M20] + v[M33] * m[M30];\n\t\tt[M31] = v[M30] * m[M01] + v[M31] * m[M11] + v[M32] * m[M21] + v[M33] * m[M31];\n\t\tt[M32] = v[M30] * m[M02] + v[M31] * m[M12] + v[M32] * m[M22] + v[M33] * m[M32];\n\t\tt[M33] = v[M30] * m[M03] + v[M31] * m[M13] + v[M32] * m[M23] + v[M33] * m[M33];\n\t\treturn this.set(this.temp);\n\t}\n\n\tmultiplyLeft (matrix: Matrix4): Matrix4 {\n\t\tlet t = this.temp;\n\t\tlet v = this.values;\n\t\tlet m = matrix.values;\n\t\tt[M00] = m[M00] * v[M00] + m[M01] * v[M10] + m[M02] * v[M20] + m[M03] * v[M30];\n\t\tt[M01] = m[M00] * v[M01] + m[M01] * v[M11] + m[M02] * v[M21] + m[M03] * v[M31];\n\t\tt[M02] = m[M00] * v[M02] + m[M01] * v[M12] + m[M02] * v[M22] + m[M03] * v[M32];\n\t\tt[M03] = m[M00] * v[M03] + m[M01] * v[M13] + m[M02] * v[M23] + m[M03] * v[M33];\n\t\tt[M10] = m[M10] * v[M00] + m[M11] * v[M10] + m[M12] * v[M20] + m[M13] * v[M30];\n\t\tt[M11] = m[M10] * v[M01] + m[M11] * v[M11] + m[M12] * v[M21] + m[M13] * v[M31];\n\t\tt[M12] = m[M10] * v[M02] + m[M11] * v[M12] + m[M12] * v[M22] + m[M13] * v[M32];\n\t\tt[M13] = m[M10] * v[M03] + m[M11] * v[M13] + m[M12] * v[M23] + m[M13] * v[M33];\n\t\tt[M20] = m[M20] * v[M00] + m[M21] * v[M10] + m[M22] * v[M20] + m[M23] * v[M30];\n\t\tt[M21] = m[M20] * v[M01] + m[M21] * v[M11] + m[M22] * v[M21] + m[M23] * v[M31];\n\t\tt[M22] = m[M20] * v[M02] + m[M21] * v[M12] + m[M22] * v[M22] + m[M23] * v[M32];\n\t\tt[M23] = m[M20] * v[M03] + m[M21] * v[M13] + m[M22] * v[M23] + m[M23] * v[M33];\n\t\tt[M30] = m[M30] * v[M00] + m[M31] * v[M10] + m[M32] * v[M20] + m[M33] * v[M30];\n\t\tt[M31] = m[M30] * v[M01] + m[M31] * v[M11] + m[M32] * v[M21] + m[M33] * v[M31];\n\t\tt[M32] = m[M30] * v[M02] + m[M31] * v[M12] + m[M32] * v[M22] + m[M33] * v[M32];\n\t\tt[M33] = m[M30] * v[M03] + m[M31] * v[M13] + m[M32] * v[M23] + m[M33] * v[M33];\n\t\treturn this.set(this.temp);\n\t}\n\n\tlookAt (position: Vector3, direction: Vector3, up: Vector3) {\n\t\tlet xAxis = Matrix4.xAxis, yAxis = Matrix4.yAxis, zAxis = Matrix4.zAxis;\n\t\tzAxis.setFrom(direction).normalize();\n\t\txAxis.setFrom(direction).normalize();\n\t\txAxis.cross(up).normalize();\n\t\tyAxis.setFrom(xAxis).cross(zAxis).normalize();\n\t\tthis.identity();\n\t\tlet val = this.values;\n\t\tval[M00] = xAxis.x;\n\t\tval[M01] = xAxis.y;\n\t\tval[M02] = xAxis.z;\n\t\tval[M10] = yAxis.x;\n\t\tval[M11] = yAxis.y;\n\t\tval[M12] = yAxis.z;\n\t\tval[M20] = -zAxis.x;\n\t\tval[M21] = -zAxis.y;\n\t\tval[M22] = -zAxis.z;\n\n\t\tMatrix4.tmpMatrix.identity();\n\t\tMatrix4.tmpMatrix.values[M03] = -position.x;\n\t\tMatrix4.tmpMatrix.values[M13] = -position.y;\n\t\tMatrix4.tmpMatrix.values[M23] = -position.z;\n\t\tthis.multiply(Matrix4.tmpMatrix)\n\n\t\treturn this;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Matrix4 } from \"./Matrix4.js\";\nimport { Vector3 } from \"./Vector3.js\";\n\nexport class OrthoCamera {\n\tposition = new Vector3(0, 0, 0);\n\tdirection = new Vector3(0, 0, -1);\n\tup = new Vector3(0, 1, 0);\n\tnear = 0;\n\tfar = 100;\n\tzoom = 1;\n\tviewportWidth = 0;\n\tviewportHeight = 0;\n\tprojectionView = new Matrix4();\n\tinverseProjectionView = new Matrix4();\n\tprojection = new Matrix4();\n\tview = new Matrix4();\n\n\tconstructor (viewportWidth: number, viewportHeight: number) {\n\t\tthis.viewportWidth = viewportWidth;\n\t\tthis.viewportHeight = viewportHeight;\n\t\tthis.update();\n\t}\n\n\tupdate () {\n\t\tlet projection = this.projection;\n\t\tlet view = this.view;\n\t\tlet projectionView = this.projectionView;\n\t\tlet inverseProjectionView = this.inverseProjectionView;\n\t\tlet zoom = this.zoom, viewportWidth = this.viewportWidth, viewportHeight = this.viewportHeight;\n\t\tprojection.ortho(zoom * (-viewportWidth / 2), zoom * (viewportWidth / 2),\n\t\t\tzoom * (-viewportHeight / 2), zoom * (viewportHeight / 2),\n\t\t\tthis.near, this.far);\n\t\tview.lookAt(this.position, this.direction, this.up);\n\t\tprojectionView.set(projection.values);\n\t\tprojectionView.multiply(view);\n\t\tinverseProjectionView.set(projectionView.values).invert();\n\t}\n\n\tscreenToWorld (screenCoords: Vector3, screenWidth: number, screenHeight: number) {\n\t\tlet x = screenCoords.x, y = screenHeight - screenCoords.y - 1;\n\t\tscreenCoords.x = (2 * x) / screenWidth - 1;\n\t\tscreenCoords.y = (2 * y) / screenHeight - 1;\n\t\tscreenCoords.z = (2 * screenCoords.z) - 1;\n\t\tscreenCoords.project(this.inverseProjectionView);\n\t\treturn screenCoords;\n\t}\n\n\tworldToScreen (worldCoords: Vector3, screenWidth: number, screenHeight: number) {\n\t\tworldCoords.project(this.projectionView);\n\t\tworldCoords.x = screenWidth * (worldCoords.x + 1) / 2;\n\t\tworldCoords.y = screenHeight * (worldCoords.y + 1) / 2;\n\t\tworldCoords.z = (worldCoords.z + 1) / 2;\n\t\treturn worldCoords;\n\t}\n\n\tsetViewport (viewportWidth: number, viewportHeight: number) {\n\t\tthis.viewportWidth = viewportWidth;\n\t\tthis.viewportHeight = viewportHeight;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nexport class Input {\n\telement: HTMLElement;\n\tmouseX = 0;\n\tmouseY = 0;\n\tbuttonDown = false;\n\ttouch0: Touch | null = null;\n\ttouch1: Touch | null = null;\n\tinitialPinchDistance = 0;\n\tprivate listeners = new Array();\n\tprivate eventListeners: Array<{ target: any, event: any, func: any }> = [];\n\n\tconstructor (element: HTMLElement) {\n\t\tthis.element = element;\n\t\tthis.setupCallbacks(element);\n\t}\n\n\tprivate setupCallbacks (element: HTMLElement) {\n\t\tlet mouseDown = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\t\t\t\tthis.buttonDown = true;\n\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(this.mouseX, this.mouseY); });\n\n\t\t\t\tdocument.addEventListener(\"mousemove\", mouseMove);\n\t\t\t\tdocument.addEventListener(\"mouseup\", mouseUp);\n\t\t\t}\n\t\t}\n\n\t\tlet mouseMove = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\n\t\t\t\tthis.listeners.map((listener) => {\n\t\t\t\t\tif (this.buttonDown) {\n\t\t\t\t\t\tif (listener.dragged) listener.dragged(this.mouseX, this.mouseY);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (listener.moved) listener.moved(this.mouseX, this.mouseY);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tlet mouseUp = (ev: UIEvent) => {\n\t\t\tif (ev instanceof MouseEvent) {\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tthis.mouseX = ev.clientX - rect.left;;\n\t\t\t\tthis.mouseY = ev.clientY - rect.top;\n\t\t\t\tthis.buttonDown = false;\n\t\t\t\tthis.listeners.map((listener) => { if (listener.up) listener.up(this.mouseX, this.mouseY); });\n\n\t\t\t\tdocument.removeEventListener(\"mousemove\", mouseMove);\n\t\t\t\tdocument.removeEventListener(\"mouseup\", mouseUp);\n\t\t\t}\n\t\t}\n\n\t\tlet mouseWheel = (e: WheelEvent) => {\n\t\t\te.preventDefault();\n\t\t\tlet deltaY = e.deltaY;\n\t\t\tif (e.deltaMode == WheelEvent.DOM_DELTA_LINE) deltaY *= 8;\n\t\t\tif (e.deltaMode == WheelEvent.DOM_DELTA_PAGE) deltaY *= 24;\n\t\t\tthis.listeners.map((listener) => { if (listener.wheel) listener.wheel(e.deltaY); });\n\t\t};\n\n\t\telement.addEventListener(\"mousedown\", mouseDown, true);\n\t\telement.addEventListener(\"mousemove\", mouseMove, true);\n\t\telement.addEventListener(\"mouseup\", mouseUp, true);\n\t\telement.addEventListener(\"wheel\", mouseWheel, true);\n\n\n\t\telement.addEventListener(\"touchstart\", (ev: TouchEvent) => {\n\t\t\tif (!this.touch0 || !this.touch1) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet nativeTouch = touches.item(0);\n\t\t\t\tif (!nativeTouch) return;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\t\t\t\tlet touch = new Touch(nativeTouch.identifier, x, y);\n\t\t\t\tthis.mouseX = x;\n\t\t\t\tthis.mouseY = y;\n\t\t\t\tthis.buttonDown = true;\n\n\t\t\t\tif (!this.touch0) {\n\t\t\t\t\tthis.touch0 = touch;\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(touch.x, touch.y) })\n\t\t\t\t} else if (!this.touch1) {\n\t\t\t\t\tthis.touch1 = touch;\n\t\t\t\t\tlet dx = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet dy = this.touch1.x - this.touch0.x;\n\t\t\t\t\tthis.initialPinchDistance = Math.sqrt(dx * dx + dy * dy);\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.zoom) listener.zoom(this.initialPinchDistance, this.initialPinchDistance) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t}, false);\n\n\t\telement.addEventListener(\"touchmove\", (ev: TouchEvent) => {\n\t\t\tif (this.touch0) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\tvar nativeTouch = touches[i];\n\t\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\n\t\t\t\t\tif (this.touch0.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch0.x = this.mouseX = x;\n\t\t\t\t\t\tthis.touch0.y = this.mouseY = y;\n\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.dragged) listener.dragged(x, y) });\n\t\t\t\t\t}\n\t\t\t\t\tif (this.touch1 && this.touch1.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch1.x = this.mouseX = x;\n\t\t\t\t\t\tthis.touch1.y = this.mouseY = y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.touch0 && this.touch1) {\n\t\t\t\t\tlet dx = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet dy = this.touch1.x - this.touch0.x;\n\t\t\t\t\tlet distance = Math.sqrt(dx * dx + dy * dy);\n\t\t\t\t\tthis.listeners.map((listener) => { if (listener.zoom) listener.zoom(this.initialPinchDistance, distance) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t}, false);\n\n\t\tlet touchEnd = (ev: TouchEvent) => {\n\t\t\tif (this.touch0) {\n\t\t\t\tvar touches = ev.changedTouches;\n\t\t\t\tlet rect = element.getBoundingClientRect();\n\n\t\t\t\tfor (var i = 0; i < touches.length; i++) {\n\t\t\t\t\tvar nativeTouch = touches[i];\n\t\t\t\t\tlet x = nativeTouch.clientX - rect.left;\n\t\t\t\t\tlet y = nativeTouch.clientY - rect.top;\n\n\t\t\t\t\tif (this.touch0.identifier === nativeTouch.identifier) {\n\t\t\t\t\t\tthis.touch0 = null;\n\t\t\t\t\t\tthis.mouseX = x;\n\t\t\t\t\t\tthis.mouseY = y;\n\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.up) listener.up(x, y) });\n\n\t\t\t\t\t\tif (!this.touch1) {\n\t\t\t\t\t\t\tthis.buttonDown = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.touch0 = this.touch1;\n\t\t\t\t\t\t\tthis.touch1 = null;\n\t\t\t\t\t\t\tthis.mouseX = this.touch0.x;\n\t\t\t\t\t\t\tthis.mouseX = this.touch0.x;\n\t\t\t\t\t\t\tthis.buttonDown = true;\n\t\t\t\t\t\t\tthis.listeners.map((listener) => { if (listener.down) listener.down(this.touch0!.x, this.touch0!.y) });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.touch1 && this.touch1.identifier) {\n\t\t\t\t\t\tthis.touch1 = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tev.preventDefault();\n\t\t};\n\t\telement.addEventListener(\"touchend\", touchEnd, false);\n\t\telement.addEventListener(\"touchcancel\", touchEnd);\n\t}\n\n\taddListener (listener: InputListener) {\n\t\tthis.listeners.push(listener);\n\t}\n\n\tremoveListener (listener: InputListener) {\n\t\tlet idx = this.listeners.indexOf(listener);\n\t\tif (idx > -1) {\n\t\t\tthis.listeners.splice(idx, 1);\n\t\t}\n\t}\n}\n\nexport class Touch {\n\tconstructor (public identifier: number, public x: number, public y: number) {\n\t}\n}\n\nexport interface InputListener {\n\tdown?(x: number, y: number): void;\n\tup?(x: number, y: number): void;\n\tmoved?(x: number, y: number): void;\n\tdragged?(x: number, y: number): void;\n\twheel?(delta: number): void;\n\tzoom?(initialDistance: number, distance: number): void;\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Input } from \"./Input.js\";\nimport { OrthoCamera } from \"./Camera.js\";\nimport { Vector3 } from \"./Vector3.js\";\n\nexport class CameraController {\n\tconstructor (public canvas: HTMLElement, public camera: OrthoCamera) {\n\t\tlet cameraX = 0, cameraY = 0, cameraZoom = 0;\n\t\tlet mouseX = 0, mouseY = 0;\n\t\tlet lastX = 0, lastY = 0;\n\t\tlet initialZoom = 0;\n\n\t\tnew Input(canvas).addListener({\n\t\t\tdown: (x: number, y: number) => {\n\t\t\t\tcameraX = camera.position.x;\n\t\t\t\tcameraY = camera.position.y;\n\t\t\t\tmouseX = lastX = x;\n\t\t\t\tmouseY = lastY = y;\n\t\t\t\tinitialZoom = camera.zoom;\n\t\t\t},\n\t\t\tdragged: (x: number, y: number) => {\n\t\t\t\tlet deltaX = x - mouseX;\n\t\t\t\tlet deltaY = y - mouseY;\n\t\t\t\tlet originWorld = camera.screenToWorld(new Vector3(0, 0), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\tlet deltaWorld = camera.screenToWorld(new Vector3(deltaX, deltaY), canvas.clientWidth, canvas.clientHeight).sub(originWorld);\n\t\t\t\tcamera.position.set(cameraX - deltaWorld.x, cameraY - deltaWorld.y, 0);\n\t\t\t\tcamera.update();\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t\twheel: (delta: number) => {\n\t\t\t\tlet zoomAmount = delta / 200 * camera.zoom;\n\t\t\t\tlet newZoom = camera.zoom + zoomAmount;\n\t\t\t\tif (newZoom > 0) {\n\t\t\t\t\tlet x = 0, y = 0;\n\t\t\t\t\tif (delta < 0) {\n\t\t\t\t\t\tx = lastX; y = lastY;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet viewCenter = new Vector3(canvas.clientWidth / 2 + 15, canvas.clientHeight / 2);\n\t\t\t\t\t\tlet mouseToCenterX = lastX - viewCenter.x;\n\t\t\t\t\t\tlet mouseToCenterY = canvas.clientHeight - 1 - lastY - viewCenter.y;\n\t\t\t\t\t\tx = viewCenter.x - mouseToCenterX;\n\t\t\t\t\t\ty = canvas.clientHeight - 1 - viewCenter.y + mouseToCenterY;\n\t\t\t\t\t}\n\t\t\t\t\tlet oldDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\t\tcamera.zoom = newZoom;\n\t\t\t\t\tcamera.update();\n\t\t\t\t\tlet newDistance = camera.screenToWorld(new Vector3(x, y), canvas.clientWidth, canvas.clientHeight);\n\t\t\t\t\tcamera.position.add(oldDistance.sub(newDistance));\n\t\t\t\t\tcamera.update();\n\t\t\t\t}\n\t\t\t},\n\t\t\tzoom: (initialDistance, distance) => {\n\t\t\t\tlet newZoom = initialDistance / distance;\n\t\t\t\tcamera.zoom = initialZoom * newZoom;\n\t\t\t},\n\t\t\tup: (x: number, y: number) => {\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t\tmoved: (x: number, y: number) => {\n\t\t\t\tlastX = x;\n\t\t\t\tlastY = y;\n\t\t\t},\n\t\t});\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Restorable } from \"@esotericsoftware/spine-core\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class Shader implements Disposable, Restorable {\n\tpublic static MVP_MATRIX = \"u_projTrans\";\n\tpublic static POSITION = \"a_position\";\n\tpublic static COLOR = \"a_color\";\n\tpublic static COLOR2 = \"a_color2\";\n\tpublic static TEXCOORDS = \"a_texCoords\";\n\tpublic static SAMPLER = \"u_texture\";\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate vs: WebGLShader | null = null;\n\tprivate vsSource: string;\n\tprivate fs: WebGLShader | null = null;\n\tprivate fsSource: string;\n\tprivate program: WebGLProgram | null = null;\n\tprivate tmp2x2: Float32Array = new Float32Array(2 * 2);\n\tprivate tmp3x3: Float32Array = new Float32Array(3 * 3);\n\tprivate tmp4x4: Float32Array = new Float32Array(4 * 4);\n\n\tpublic getProgram () { return this.program; }\n\tpublic getVertexShader () { return this.vertexShader; }\n\tpublic getFragmentShader () { return this.fragmentShader; }\n\tpublic getVertexShaderSource () { return this.vsSource; }\n\tpublic getFragmentSource () { return this.fsSource; }\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, private vertexShader: string, private fragmentShader: string) {\n\t\tthis.vsSource = vertexShader;\n\t\tthis.fsSource = fragmentShader;\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.context.addRestorable(this);\n\t\tthis.compile();\n\t}\n\n\tprivate compile () {\n\t\tlet gl = this.context.gl;\n\t\ttry {\n\t\t\tthis.vs = this.compileShader(gl.VERTEX_SHADER, this.vertexShader);\n\t\t\tif (!this.vs) throw new Error(\"Couldn't compile vertex shader.\");\n\t\t\tthis.fs = this.compileShader(gl.FRAGMENT_SHADER, this.fragmentShader);\n\t\t\tif (!this.fs) throw new Error(\"Couldn#t compile fragment shader.\");\n\t\t\tthis.program = this.compileProgram(this.vs, this.fs);\n\t\t} catch (e) {\n\t\t\tthis.dispose();\n\t\t\tthrow e;\n\t\t}\n\t}\n\n\tprivate compileShader (type: number, source: string) {\n\t\tlet gl = this.context.gl;\n\t\tlet shader = gl.createShader(type);\n\t\tif (!shader) throw new Error(\"Couldn't create shader.\");\n\t\tgl.shaderSource(shader, source);\n\t\tgl.compileShader(shader);\n\t\tif (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n\t\t\tlet error = \"Couldn't compile shader: \" + gl.getShaderInfoLog(shader);\n\t\t\tgl.deleteShader(shader);\n\t\t\tif (!gl.isContextLost()) throw new Error(error);\n\t\t}\n\t\treturn shader;\n\t}\n\n\tprivate compileProgram (vs: WebGLShader, fs: WebGLShader) {\n\t\tlet gl = this.context.gl;\n\t\tlet program = gl.createProgram();\n\t\tif (!program) throw new Error(\"Couldn't compile program.\");\n\t\tgl.attachShader(program, vs);\n\t\tgl.attachShader(program, fs);\n\t\tgl.linkProgram(program);\n\n\t\tif (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n\t\t\tlet error = \"Couldn't compile shader program: \" + gl.getProgramInfoLog(program);\n\t\t\tgl.deleteProgram(program);\n\t\t\tif (!gl.isContextLost()) throw new Error(error);\n\t\t}\n\t\treturn program;\n\t}\n\n\trestore () {\n\t\tthis.compile();\n\t}\n\n\tpublic bind () {\n\t\tthis.context.gl.useProgram(this.program);\n\t}\n\n\tpublic unbind () {\n\t\tthis.context.gl.useProgram(null);\n\t}\n\n\tpublic setUniformi (uniform: string, value: number) {\n\t\tthis.context.gl.uniform1i(this.getUniformLocation(uniform), value);\n\t}\n\n\tpublic setUniformf (uniform: string, value: number) {\n\t\tthis.context.gl.uniform1f(this.getUniformLocation(uniform), value);\n\t}\n\n\tpublic setUniform2f (uniform: string, value: number, value2: number) {\n\t\tthis.context.gl.uniform2f(this.getUniformLocation(uniform), value, value2);\n\t}\n\n\tpublic setUniform3f (uniform: string, value: number, value2: number, value3: number) {\n\t\tthis.context.gl.uniform3f(this.getUniformLocation(uniform), value, value2, value3);\n\t}\n\n\tpublic setUniform4f (uniform: string, value: number, value2: number, value3: number, value4: number) {\n\t\tthis.context.gl.uniform4f(this.getUniformLocation(uniform), value, value2, value3, value4);\n\t}\n\n\tpublic setUniform2x2f (uniform: string, value: ArrayLike) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp2x2.set(value);\n\t\tgl.uniformMatrix2fv(this.getUniformLocation(uniform), false, this.tmp2x2);\n\t}\n\n\tpublic setUniform3x3f (uniform: string, value: ArrayLike) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp3x3.set(value);\n\t\tgl.uniformMatrix3fv(this.getUniformLocation(uniform), false, this.tmp3x3);\n\t}\n\n\tpublic setUniform4x4f (uniform: string, value: ArrayLike) {\n\t\tlet gl = this.context.gl;\n\t\tthis.tmp4x4.set(value);\n\t\tgl.uniformMatrix4fv(this.getUniformLocation(uniform), false, this.tmp4x4);\n\t}\n\n\tpublic getUniformLocation (uniform: string): WebGLUniformLocation | null {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.program) throw new Error(\"Shader not compiled.\");\n\t\tlet location = gl.getUniformLocation(this.program, uniform);\n\t\tif (!location && !gl.isContextLost()) throw new Error(`Couldn't find location for uniform ${uniform}`);\n\t\treturn location;\n\t}\n\n\tpublic getAttributeLocation (attribute: string): number {\n\t\tlet gl = this.context.gl;\n\t\tif (!this.program) throw new Error(\"Shader not compiled.\");\n\t\tlet location = gl.getAttribLocation(this.program, attribute);\n\t\tif (location == -1 && !gl.isContextLost()) throw new Error(`Couldn't find location for attribute ${attribute}`);\n\t\treturn location;\n\t}\n\n\tpublic dispose () {\n\t\tthis.context.removeRestorable(this);\n\n\t\tlet gl = this.context.gl;\n\t\tif (this.vs) {\n\t\t\tgl.deleteShader(this.vs);\n\t\t\tthis.vs = null;\n\t\t}\n\n\t\tif (this.fs) {\n\t\t\tgl.deleteShader(this.fs);\n\t\t\tthis.fs = null;\n\t\t}\n\n\t\tif (this.program) {\n\t\t\tgl.deleteProgram(this.program);\n\t\t\tthis.program = null;\n\t\t}\n\t}\n\n\tpublic static newColoredTextured (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nattribute vec2 ${Shader.TEXCOORDS};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_color;\nvarying vec2 v_texCoords;\n\nvoid main () {\n\tv_color = ${Shader.COLOR};\n\tv_texCoords = ${Shader.TEXCOORDS};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_color;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main () {\n\tgl_FragColor = v_color * texture2D(u_texture, v_texCoords);\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n\n\tpublic static newTwoColoredTextured (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nattribute vec4 ${Shader.COLOR2};\nattribute vec2 ${Shader.TEXCOORDS};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_light;\nvarying vec4 v_dark;\nvarying vec2 v_texCoords;\n\nvoid main () {\n\tv_light = ${Shader.COLOR};\n\tv_dark = ${Shader.COLOR2};\n\tv_texCoords = ${Shader.TEXCOORDS};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_light;\nvarying LOWP vec4 v_dark;\nvarying vec2 v_texCoords;\nuniform sampler2D u_texture;\n\nvoid main () {\n\tvec4 texColor = texture2D(u_texture, v_texCoords);\n\tgl_FragColor.a = texColor.a * v_light.a;\n\tgl_FragColor.rgb = ((texColor.a - 1.0) * v_dark.a + 1.0 - texColor.rgb) * v_dark.rgb + texColor.rgb * v_light.rgb;\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n\n\tpublic static newColored (context: ManagedWebGLRenderingContext | WebGLRenderingContext): Shader {\n\t\tlet vs = `\nattribute vec4 ${Shader.POSITION};\nattribute vec4 ${Shader.COLOR};\nuniform mat4 ${Shader.MVP_MATRIX};\nvarying vec4 v_color;\n\nvoid main () {\n\tv_color = ${Shader.COLOR};\n\tgl_Position = ${Shader.MVP_MATRIX} * ${Shader.POSITION};\n}\n`;\n\n\t\tlet fs = `\n#ifdef GL_ES\n\t#define LOWP lowp\n\tprecision mediump float;\n#else\n\t#define LOWP\n#endif\nvarying LOWP vec4 v_color;\n\nvoid main () {\n\tgl_FragColor = v_color;\n}\n`;\n\n\t\treturn new Shader(context, vs, fs);\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Restorable } from \"@esotericsoftware/spine-core\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\n\nexport class Mesh implements Disposable, Restorable {\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate vertices: Float32Array;\n\tprivate verticesBuffer: WebGLBuffer | null = null;\n\tprivate verticesLength = 0;\n\tprivate dirtyVertices = false;\n\tprivate indices: Uint16Array;\n\tprivate indicesBuffer: WebGLBuffer | null = null;\n\tprivate indicesLength = 0;\n\tprivate dirtyIndices = false;\n\tprivate elementsPerVertex = 0;\n\n\tgetAttributes (): VertexAttribute[] { return this.attributes; }\n\n\tmaxVertices (): number { return this.vertices.length / this.elementsPerVertex; }\n\tnumVertices (): number { return this.verticesLength / this.elementsPerVertex; }\n\tsetVerticesLength (length: number) {\n\t\tthis.dirtyVertices = true;\n\t\tthis.verticesLength = length;\n\t}\n\tgetVertices (): Float32Array { return this.vertices; }\n\n\tmaxIndices (): number { return this.indices.length; }\n\tnumIndices (): number { return this.indicesLength; }\n\tsetIndicesLength (length: number) {\n\t\tthis.dirtyIndices = true;\n\t\tthis.indicesLength = length;\n\t}\n\tgetIndices (): Uint16Array { return this.indices };\n\n\tgetVertexSizeInFloats (): number {\n\t\tlet size = 0;\n\t\tfor (var i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attribute = this.attributes[i];\n\t\t\tsize += attribute.numElements;\n\t\t}\n\t\treturn size;\n\t}\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, private attributes: VertexAttribute[], maxVertices: number, maxIndices: number) {\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.elementsPerVertex = 0;\n\t\tfor (let i = 0; i < attributes.length; i++) {\n\t\t\tthis.elementsPerVertex += attributes[i].numElements;\n\t\t}\n\t\tthis.vertices = new Float32Array(maxVertices * this.elementsPerVertex);\n\t\tthis.indices = new Uint16Array(maxIndices);\n\t\tthis.context.addRestorable(this);\n\t}\n\n\tsetVertices (vertices: Array) {\n\t\tthis.dirtyVertices = true;\n\t\tif (vertices.length > this.vertices.length) throw Error(\"Mesh can't store more than \" + this.maxVertices() + \" vertices\");\n\t\tthis.vertices.set(vertices, 0);\n\t\tthis.verticesLength = vertices.length;\n\t}\n\n\tsetIndices (indices: Array) {\n\t\tthis.dirtyIndices = true;\n\t\tif (indices.length > this.indices.length) throw Error(\"Mesh can't store more than \" + this.maxIndices() + \" indices\");\n\t\tthis.indices.set(indices, 0);\n\t\tthis.indicesLength = indices.length;\n\t}\n\n\tdraw (shader: Shader, primitiveType: number) {\n\t\tthis.drawWithOffset(shader, primitiveType, 0, this.indicesLength > 0 ? this.indicesLength : this.verticesLength / this.elementsPerVertex);\n\t}\n\n\tdrawWithOffset (shader: Shader, primitiveType: number, offset: number, count: number) {\n\t\tlet gl = this.context.gl;\n\t\tif (this.dirtyVertices || this.dirtyIndices) this.update();\n\t\tthis.bind(shader);\n\t\tif (this.indicesLength > 0) {\n\t\t\tgl.drawElements(primitiveType, count, gl.UNSIGNED_SHORT, offset * 2);\n\t\t} else {\n\t\t\tgl.drawArrays(primitiveType, offset, count);\n\t\t}\n\t\tthis.unbind(shader);\n\t}\n\n\tbind (shader: Shader) {\n\t\tlet gl = this.context.gl;\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\n\t\tlet offset = 0;\n\t\tfor (let i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attrib = this.attributes[i];\n\t\t\tlet location = shader.getAttributeLocation(attrib.name);\n\t\t\tgl.enableVertexAttribArray(location);\n\t\t\tgl.vertexAttribPointer(location, attrib.numElements, gl.FLOAT, false, this.elementsPerVertex * 4, offset * 4);\n\t\t\toffset += attrib.numElements;\n\t\t}\n\t\tif (this.indicesLength > 0) gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n\t}\n\n\tunbind (shader: Shader) {\n\t\tlet gl = this.context.gl;\n\t\tfor (let i = 0; i < this.attributes.length; i++) {\n\t\t\tlet attrib = this.attributes[i];\n\t\t\tlet location = shader.getAttributeLocation(attrib.name);\n\t\t\tgl.disableVertexAttribArray(location);\n\t\t}\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, null);\n\t\tif (this.indicesLength > 0) gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, null);\n\t}\n\n\tprivate update () {\n\t\tlet gl = this.context.gl;\n\t\tif (this.dirtyVertices) {\n\t\t\tif (!this.verticesBuffer) {\n\t\t\t\tthis.verticesBuffer = gl.createBuffer();\n\t\t\t}\n\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, this.verticesBuffer);\n\t\t\tgl.bufferData(gl.ARRAY_BUFFER, this.vertices.subarray(0, this.verticesLength), gl.DYNAMIC_DRAW);\n\t\t\tthis.dirtyVertices = false;\n\t\t}\n\n\t\tif (this.dirtyIndices) {\n\t\t\tif (!this.indicesBuffer) {\n\t\t\t\tthis.indicesBuffer = gl.createBuffer();\n\t\t\t}\n\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indicesBuffer);\n\t\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices.subarray(0, this.indicesLength), gl.DYNAMIC_DRAW);\n\t\t\tthis.dirtyIndices = false;\n\t\t}\n\t}\n\n\trestore () {\n\t\tthis.verticesBuffer = null;\n\t\tthis.indicesBuffer = null;\n\t\tthis.update();\n\t}\n\n\tdispose () {\n\t\tthis.context.removeRestorable(this);\n\t\tlet gl = this.context.gl;\n\t\tgl.deleteBuffer(this.verticesBuffer);\n\t\tgl.deleteBuffer(this.indicesBuffer);\n\t}\n}\n\nexport class VertexAttribute {\n\tconstructor (public name: string, public type: VertexAttributeType, public numElements: number) { }\n}\n\nexport class Position2Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.POSITION, VertexAttributeType.Float, 2);\n\t}\n}\n\nexport class Position3Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.POSITION, VertexAttributeType.Float, 3);\n\t}\n}\n\nexport class TexCoordAttribute extends VertexAttribute {\n\tconstructor (unit: number = 0) {\n\t\tsuper(Shader.TEXCOORDS + (unit == 0 ? \"\" : unit), VertexAttributeType.Float, 2);\n\t}\n}\n\nexport class ColorAttribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.COLOR, VertexAttributeType.Float, 4);\n\t}\n}\n\nexport class Color2Attribute extends VertexAttribute {\n\tconstructor () {\n\t\tsuper(Shader.COLOR2, VertexAttributeType.Float, 4);\n\t}\n}\n\nexport enum VertexAttributeType {\n\tFloat\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BlendMode, Disposable } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { Mesh, Position2Attribute, ColorAttribute, TexCoordAttribute, Color2Attribute } from \"./Mesh.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nconst GL_ONE = 1;\nconst GL_ONE_MINUS_SRC_COLOR = 0x0301;\nconst GL_SRC_ALPHA = 0x0302;\nconst GL_ONE_MINUS_SRC_ALPHA = 0x0303;\nconst GL_ONE_MINUS_DST_ALPHA = 0x0305;\nconst GL_DST_COLOR = 0x0306;\n\nexport class PolygonBatcher implements Disposable {\n\tpublic static disableCulling = false;\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate drawCalls = 0;\n\tprivate static globalDrawCalls = 0;\n\tisDrawing = false;\n\tprivate mesh: Mesh;\n\tprivate shader: Shader | null = null;\n\tprivate lastTexture: GLTexture | null = null;\n\tprivate verticesLength = 0;\n\tprivate indicesLength = 0;\n\tprivate srcColorBlend: number;\n\tprivate srcAlphaBlend: number;\n\tprivate dstBlend: number;\n\tprivate cullWasEnabled = false;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint: boolean = true, maxVertices: number = 10920) {\n\t\tif (maxVertices > 10920) throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tlet attributes = twoColorTint ?\n\t\t\t[new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute(), new Color2Attribute()] :\n\t\t\t[new Position2Attribute(), new ColorAttribute(), new TexCoordAttribute()];\n\t\tthis.mesh = new Mesh(context, attributes, maxVertices, maxVertices * 3);\n\t\tlet gl = this.context.gl;\n\t\tthis.srcColorBlend = gl.SRC_ALPHA;\n\t\tthis.srcAlphaBlend = gl.ONE;\n\t\tthis.dstBlend = gl.ONE_MINUS_SRC_ALPHA;\n\t}\n\n\tbegin (shader: Shader) {\n\t\tif (this.isDrawing) throw new Error(\"PolygonBatch is already drawing. Call PolygonBatch.end() before calling PolygonBatch.begin()\");\n\t\tthis.drawCalls = 0;\n\t\tthis.shader = shader;\n\t\tthis.lastTexture = null;\n\t\tthis.isDrawing = true;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.enable(gl.BLEND);\n\t\tgl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend);\n\n\t\tif (PolygonBatcher.disableCulling) {\n\t\t\tthis.cullWasEnabled = gl.isEnabled(gl.CULL_FACE);\n\t\t\tif (this.cullWasEnabled) gl.disable(gl.CULL_FACE);\n\t\t}\n\t}\n\n\tprivate static blendModesGL: { srcRgb: number, srcRgbPma: number, dstRgb: number, srcAlpha: number }[] = [\n\t\t{ srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_SRC_ALPHA, srcRgbPma: GL_ONE, dstRgb: GL_ONE, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_DST_COLOR, srcRgbPma: GL_DST_COLOR, dstRgb: GL_ONE_MINUS_SRC_ALPHA, srcAlpha: GL_ONE },\n\t\t{ srcRgb: GL_ONE, srcRgbPma: GL_ONE, dstRgb: GL_ONE_MINUS_SRC_COLOR, srcAlpha: GL_ONE }\n\t]\n\n\tsetBlendMode (blendMode: BlendMode, premultipliedAlpha: boolean) {\n\t\tconst blendModeGL = PolygonBatcher.blendModesGL[blendMode];\n\t\tconst srcColorBlend = premultipliedAlpha ? blendModeGL.srcRgbPma : blendModeGL.srcRgb;\n\t\tconst srcAlphaBlend = blendModeGL.srcAlpha;\n\t\tconst dstBlend = blendModeGL.dstRgb;\n\n\t\tif (this.srcColorBlend == srcColorBlend && this.srcAlphaBlend == srcAlphaBlend && this.dstBlend == dstBlend) return;\n\t\tthis.srcColorBlend = srcColorBlend;\n\t\tthis.srcAlphaBlend = srcAlphaBlend;\n\t\tthis.dstBlend = dstBlend;\n\t\tif (this.isDrawing) {\n\t\t\tthis.flush();\n\t\t}\n\t\tlet gl = this.context.gl;\n\t\tgl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend);\n\t}\n\n\tdraw (texture: GLTexture, vertices: ArrayLike, indices: Array) {\n\t\tif (texture != this.lastTexture) {\n\t\t\tthis.flush();\n\t\t\tthis.lastTexture = texture;\n\t\t} else if (this.verticesLength + vertices.length > this.mesh.getVertices().length ||\n\t\t\tthis.indicesLength + indices.length > this.mesh.getIndices().length) {\n\t\t\tthis.flush();\n\t\t}\n\n\t\tlet indexStart = this.mesh.numVertices();\n\t\tthis.mesh.getVertices().set(vertices, this.verticesLength);\n\t\tthis.verticesLength += vertices.length;\n\t\tthis.mesh.setVerticesLength(this.verticesLength)\n\n\t\tlet indicesArray = this.mesh.getIndices();\n\t\tfor (let i = this.indicesLength, j = 0; j < indices.length; i++, j++)\n\t\t\tindicesArray[i] = indices[j] + indexStart;\n\t\tthis.indicesLength += indices.length;\n\t\tthis.mesh.setIndicesLength(this.indicesLength);\n\t}\n\n\tflush () {\n\t\tif (this.verticesLength == 0) return;\n\t\tif (!this.lastTexture) throw new Error(\"No texture set.\");\n\t\tif (!this.shader) throw new Error(\"No shader set.\");\n\t\tthis.lastTexture.bind();\n\t\tthis.mesh.draw(this.shader, this.context.gl.TRIANGLES);\n\n\t\tthis.verticesLength = 0;\n\t\tthis.indicesLength = 0;\n\t\tthis.mesh.setVerticesLength(0);\n\t\tthis.mesh.setIndicesLength(0);\n\t\tthis.drawCalls++;\n\t\tPolygonBatcher.globalDrawCalls++;\n\t}\n\n\tend () {\n\t\tif (!this.isDrawing) throw new Error(\"PolygonBatch is not drawing. Call PolygonBatch.begin() before calling PolygonBatch.end()\");\n\t\tif (this.verticesLength > 0 || this.indicesLength > 0) this.flush();\n\t\tthis.shader = null;\n\t\tthis.lastTexture = null;\n\t\tthis.isDrawing = false;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.disable(gl.BLEND);\n\t\tif (PolygonBatcher.disableCulling) {\n\t\t\tif (this.cullWasEnabled) gl.enable(gl.CULL_FACE);\n\t\t}\n\t}\n\n\tgetDrawCalls () {\n\t\treturn this.drawCalls;\n\t}\n\n\tstatic getAndResetGlobalDrawCalls () {\n\t\tlet result = PolygonBatcher.globalDrawCalls;\n\t\tPolygonBatcher.globalDrawCalls = 0;\n\t\treturn result;\n\t}\n\n\tdispose () {\n\t\tthis.mesh.dispose();\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Color, Vector2, MathUtils } from \"@esotericsoftware/spine-core\";\nimport { Mesh, Position2Attribute, ColorAttribute } from \"./Mesh.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class ShapeRenderer implements Disposable {\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate isDrawing = false;\n\tprivate mesh: Mesh;\n\tprivate shapeType = ShapeType.Filled;\n\tprivate color = new Color(1, 1, 1, 1);\n\tprivate shader: Shader | null = null;\n\tprivate vertexIndex = 0;\n\tprivate tmp = new Vector2();\n\tprivate srcColorBlend: number;\n\tprivate srcAlphaBlend: number;\n\tprivate dstBlend: number;\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext, maxVertices: number = 10920) {\n\t\tif (maxVertices > 10920) throw new Error(\"Can't have more than 10920 triangles per batch: \" + maxVertices);\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.mesh = new Mesh(context, [new Position2Attribute(), new ColorAttribute()], maxVertices, 0);\n\t\tlet gl = this.context.gl;\n\t\tthis.srcColorBlend = gl.SRC_ALPHA;\n\t\tthis.srcAlphaBlend = gl.ONE;\n\t\tthis.dstBlend = gl.ONE_MINUS_SRC_ALPHA;\n\t}\n\n\tbegin (shader: Shader) {\n\t\tif (this.isDrawing) throw new Error(\"ShapeRenderer.begin() has already been called\");\n\t\tthis.shader = shader;\n\t\tthis.vertexIndex = 0;\n\t\tthis.isDrawing = true;\n\n\t\tlet gl = this.context.gl;\n\t\tgl.enable(gl.BLEND);\n\t\tgl.blendFuncSeparate(this.srcColorBlend, this.dstBlend, this.srcAlphaBlend, this.dstBlend);\n\t}\n\n\tsetBlendMode (srcColorBlend: number, srcAlphaBlend: number, dstBlend: number) {\n\t\tthis.srcColorBlend = srcColorBlend;\n\t\tthis.srcAlphaBlend = srcAlphaBlend;\n\t\tthis.dstBlend = dstBlend;\n\t\tif (this.isDrawing) {\n\t\t\tthis.flush();\n\t\t\tlet gl = this.context.gl;\n\t\t\tgl.blendFuncSeparate(srcColorBlend, dstBlend, srcAlphaBlend, dstBlend);\n\t\t}\n\t}\n\n\tsetColor (color: Color) {\n\t\tthis.color.setFromColor(color);\n\t}\n\n\tsetColorWith (r: number, g: number, b: number, a: number) {\n\t\tthis.color.set(r, g, b, a);\n\t}\n\n\tpoint (x: number, y: number, color?: Color) {\n\t\tthis.check(ShapeType.Point, 1);\n\t\tif (!color) color = this.color;\n\t\tthis.vertex(x, y, color);\n\t}\n\n\tline (x: number, y: number, x2: number, y2: number, color?: Color) {\n\t\tthis.check(ShapeType.Line, 2);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tthis.vertex(x, y, color);\n\t\tthis.vertex(x2, y2, color);\n\t}\n\n\ttriangle (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tif (!color2) color2 = this.color;\n\t\tif (!color3) color3 = this.color;\n\t\tif (filled) {\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x2, y2, color2);\n\t\t\tthis.vertex(x3, y3, color3);\n\t\t} else {\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x2, y2, color2);\n\n\t\t\tthis.vertex(x2, y2, color);\n\t\t\tthis.vertex(x3, y3, color2);\n\n\t\t\tthis.vertex(x3, y3, color);\n\t\t\tthis.vertex(x, y, color2);\n\t\t}\n\t}\n\n\tquad (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 3);\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\t\tif (!color) color = this.color;\n\t\tif (!color2) color2 = this.color;\n\t\tif (!color3) color3 = this.color;\n\t\tif (!color4) color4 = this.color;\n\t\tif (filled) {\n\t\t\tthis.vertex(x, y, color); this.vertex(x2, y2, color2); this.vertex(x3, y3, color3);\n\t\t\tthis.vertex(x3, y3, color3); this.vertex(x4, y4, color4); this.vertex(x, y, color);\n\t\t} else {\n\t\t\tthis.vertex(x, y, color); this.vertex(x2, y2, color2);\n\t\t\tthis.vertex(x2, y2, color2); this.vertex(x3, y3, color3);\n\t\t\tthis.vertex(x3, y3, color3); this.vertex(x4, y4, color4);\n\t\t\tthis.vertex(x4, y4, color4); this.vertex(x, y, color);\n\t\t}\n\t}\n\n\trect (filled: boolean, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.quad(filled, x, y, x + width, y, x + width, y + height, x, y + height, color, color, color, color);\n\t}\n\n\trectLine (filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color) {\n\t\tthis.check(filled ? ShapeType.Filled : ShapeType.Line, 8);\n\t\tif (!color) color = this.color;\n\t\tlet t = this.tmp.set(y2 - y1, x1 - x2);\n\t\tt.normalize();\n\t\twidth *= 0.5;\n\t\tlet tx = t.x * width;\n\t\tlet ty = t.y * width;\n\t\tif (!filled) {\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t} else {\n\t\t\tthis.vertex(x1 + tx, y1 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\n\t\t\tthis.vertex(x2 - tx, y2 - ty, color);\n\t\t\tthis.vertex(x2 + tx, y2 + ty, color);\n\t\t\tthis.vertex(x1 - tx, y1 - ty, color);\n\t\t}\n\t}\n\n\tx (x: number, y: number, size: number) {\n\t\tthis.line(x - size, y - size, x + size, y + size);\n\t\tthis.line(x - size, y + size, x + size, y - size);\n\t}\n\n\tpolygon (polygonVertices: ArrayLike, offset: number, count: number, color?: Color) {\n\t\tif (count < 3) throw new Error(\"Polygon must contain at least 3 vertices\");\n\t\tthis.check(ShapeType.Line, count * 2);\n\t\tif (!color) color = this.color;\n\t\tlet vertices = this.mesh.getVertices();\n\t\tlet idx = this.vertexIndex;\n\n\t\toffset <<= 1;\n\t\tcount <<= 1;\n\n\t\tlet firstX = polygonVertices[offset];\n\t\tlet firstY = polygonVertices[offset + 1];\n\t\tlet last = offset + count;\n\n\t\tfor (let i = offset, n = offset + count - 2; i < n; i += 2) {\n\t\t\tlet x1 = polygonVertices[i];\n\t\t\tlet y1 = polygonVertices[i + 1];\n\n\t\t\tlet x2 = 0;\n\t\t\tlet y2 = 0;\n\n\t\t\tif (i + 2 >= last) {\n\t\t\t\tx2 = firstX;\n\t\t\t\ty2 = firstY;\n\t\t\t} else {\n\t\t\t\tx2 = polygonVertices[i + 2];\n\t\t\t\ty2 = polygonVertices[i + 3];\n\t\t\t}\n\n\t\t\tthis.vertex(x1, y1, color!);\n\t\t\tthis.vertex(x2, y2, color!);\n\t\t}\n\t}\n\n\tcircle (filled: boolean, x: number, y: number, radius: number, color?: Color, segments: number = 0) {\n\t\tif (segments == 0) segments = Math.max(1, (6 * MathUtils.cbrt(radius)) | 0);\n\t\tif (segments <= 0) throw new Error(\"segments must be > 0.\");\n\t\tif (!color) color = this.color;\n\t\tlet angle = 2 * MathUtils.PI / segments;\n\t\tlet cos = Math.cos(angle);\n\t\tlet sin = Math.sin(angle);\n\t\tlet cx = radius, cy = 0;\n\t\tif (!filled) {\n\t\t\tthis.check(ShapeType.Line, segments * 2 + 2);\n\t\t\tfor (let i = 0; i < segments; i++) {\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t\tlet temp = cx;\n\t\t\t\tcx = cos * cx - sin * cy;\n\t\t\t\tcy = sin * temp + cos * cy;\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t}\n\t\t\t// Ensure the last segment is identical to the first.\n\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t} else {\n\t\t\tthis.check(ShapeType.Filled, segments * 3 + 3);\n\t\t\tsegments--;\n\t\t\tfor (let i = 0; i < segments; i++) {\n\t\t\t\tthis.vertex(x, y, color);\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t\tlet temp = cx;\n\t\t\t\tcx = cos * cx - sin * cy;\n\t\t\t\tcy = sin * temp + cos * cy;\n\t\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t\t}\n\t\t\t// Ensure the last segment is identical to the first.\n\t\t\tthis.vertex(x, y, color);\n\t\t\tthis.vertex(x + cx, y + cy, color);\n\t\t}\n\n\t\tlet temp = cx;\n\t\tcx = radius;\n\t\tcy = 0;\n\t\tthis.vertex(x + cx, y + cy, color);\n\t}\n\n\tcurve (x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color) {\n\t\tthis.check(ShapeType.Line, segments * 2 + 2);\n\t\tif (!color) color = this.color;\n\n\t\t// Algorithm from: http://www.antigrain.com/research/bezier_interpolation/index.html#PAGE_BEZIER_INTERPOLATION\n\t\tlet subdiv_step = 1 / segments;\n\t\tlet subdiv_step2 = subdiv_step * subdiv_step;\n\t\tlet subdiv_step3 = subdiv_step * subdiv_step * subdiv_step;\n\n\t\tlet pre1 = 3 * subdiv_step;\n\t\tlet pre2 = 3 * subdiv_step2;\n\t\tlet pre4 = 6 * subdiv_step2;\n\t\tlet pre5 = 6 * subdiv_step3;\n\n\t\tlet tmp1x = x1 - cx1 * 2 + cx2;\n\t\tlet tmp1y = y1 - cy1 * 2 + cy2;\n\n\t\tlet tmp2x = (cx1 - cx2) * 3 - x1 + x2;\n\t\tlet tmp2y = (cy1 - cy2) * 3 - y1 + y2;\n\n\t\tlet fx = x1;\n\t\tlet fy = y1;\n\n\t\tlet dfx = (cx1 - x1) * pre1 + tmp1x * pre2 + tmp2x * subdiv_step3;\n\t\tlet dfy = (cy1 - y1) * pre1 + tmp1y * pre2 + tmp2y * subdiv_step3;\n\n\t\tlet ddfx = tmp1x * pre4 + tmp2x * pre5;\n\t\tlet ddfy = tmp1y * pre4 + tmp2y * pre5;\n\n\t\tlet dddfx = tmp2x * pre5;\n\t\tlet dddfy = tmp2y * pre5;\n\n\t\twhile (segments-- > 0) {\n\t\t\tthis.vertex(fx, fy, color!);\n\t\t\tfx += dfx;\n\t\t\tfy += dfy;\n\t\t\tdfx += ddfx;\n\t\t\tdfy += ddfy;\n\t\t\tddfx += dddfx;\n\t\t\tddfy += dddfy;\n\t\t\tthis.vertex(fx, fy, color!);\n\t\t}\n\t\tthis.vertex(fx, fy, color!);\n\t\tthis.vertex(x2, y2, color!);\n\t}\n\n\tprivate vertex (x: number, y: number, color: Color) {\n\t\tlet idx = this.vertexIndex;\n\t\tlet vertices = this.mesh.getVertices();\n\t\tvertices[idx++] = x;\n\t\tvertices[idx++] = y;\n\t\tvertices[idx++] = color.r;\n\t\tvertices[idx++] = color.g;\n\t\tvertices[idx++] = color.b;\n\t\tvertices[idx++] = color.a;\n\t\tthis.vertexIndex = idx;\n\t}\n\n\tend () {\n\t\tif (!this.isDrawing) throw new Error(\"ShapeRenderer.begin() has not been called\");\n\t\tthis.flush();\n\t\tlet gl = this.context.gl;\n\t\tgl.disable(gl.BLEND);\n\t\tthis.isDrawing = false;\n\t}\n\n\tprivate flush () {\n\t\tif (this.vertexIndex == 0) return;\n\t\tif (!this.shader) throw new Error(\"No shader set.\");\n\t\tthis.mesh.setVerticesLength(this.vertexIndex);\n\t\tthis.mesh.draw(this.shader, this.shapeType);\n\t\tthis.vertexIndex = 0;\n\t}\n\n\tprivate check (shapeType: ShapeType, numVertices: number) {\n\t\tif (!this.isDrawing) throw new Error(\"ShapeRenderer.begin() has not been called\");\n\t\tif (this.shapeType == shapeType) {\n\t\t\tif (this.mesh.maxVertices() - this.mesh.numVertices() < numVertices) this.flush();\n\t\t\telse return;\n\t\t} else {\n\t\t\tthis.flush();\n\t\t\tthis.shapeType = shapeType;\n\t\t}\n\t}\n\n\tdispose () {\n\t\tthis.mesh.dispose();\n\t}\n}\n\nexport enum ShapeType {\n\tPoint = 0x0000,\n\tLine = 0x0001,\n\tFilled = 0x0004\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Disposable, Color, SkeletonBounds, Utils, Skeleton, RegionAttachment, MeshAttachment, PathAttachment, ClippingAttachment } from \"@esotericsoftware/spine-core\";\nimport { ShapeRenderer } from \"./ShapeRenderer.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\nexport class SkeletonDebugRenderer implements Disposable {\n\tboneLineColor = new Color(1, 0, 0, 1);\n\tboneOriginColor = new Color(0, 1, 0, 1);\n\tattachmentLineColor = new Color(0, 0, 1, 0.5);\n\ttriangleLineColor = new Color(1, 0.64, 0, 0.5);\n\tpathColor = new Color().setFromString(\"FF7F00\");\n\tclipColor = new Color(0.8, 0, 0, 2);\n\taabbColor = new Color(0, 1, 0, 0.5);\n\tdrawBones = true;\n\tdrawRegionAttachments = true;\n\tdrawBoundingBoxes = true;\n\tdrawMeshHull = true;\n\tdrawMeshTriangles = true;\n\tdrawPaths = true;\n\tdrawSkeletonXY = false;\n\tdrawClipping = true;\n\tpremultipliedAlpha = false;\n\tscale = 1;\n\tboneWidth = 2;\n\n\tprivate context: ManagedWebGLRenderingContext;\n\tprivate bounds = new SkeletonBounds();\n\tprivate temp = new Array();\n\tprivate vertices = Utils.newFloatArray(2 * 1024);\n\tprivate static LIGHT_GRAY = new Color(192 / 255, 192 / 255, 192 / 255, 1);\n\tprivate static GREEN = new Color(0, 1, 0, 1);\n\n\tconstructor (context: ManagedWebGLRenderingContext | WebGLRenderingContext) {\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t}\n\n\tdraw (shapes: ShapeRenderer, skeleton: Skeleton, ignoredBones?: Array) {\n\t\tlet skeletonX = skeleton.x;\n\t\tlet skeletonY = skeleton.y;\n\t\tlet gl = this.context.gl;\n\t\tlet srcFunc = this.premultipliedAlpha ? gl.ONE : gl.SRC_ALPHA;\n\t\tshapes.setBlendMode(srcFunc, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n\t\tlet bones = skeleton.bones;\n\t\tif (this.drawBones) {\n\t\t\tshapes.setColor(this.boneLineColor);\n\t\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\t\tlet bone = bones[i];\n\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;\n\t\t\t\tif (!bone.parent) continue;\n\t\t\t\tlet x = bone.data.length * bone.a + bone.worldX;\n\t\t\t\tlet y = bone.data.length * bone.c + bone.worldY;\n\t\t\t\tshapes.rectLine(true, bone.worldX, bone.worldY, x, y, this.boneWidth * this.scale);\n\t\t\t}\n\t\t\tif (this.drawSkeletonXY) shapes.x(skeletonX, skeletonY, 4 * this.scale);\n\t\t}\n\n\t\tif (this.drawRegionAttachments) {\n\t\t\tshapes.setColor(this.attachmentLineColor);\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\t\tlet regionAttachment = attachment;\n\t\t\t\t\tlet vertices = this.vertices;\n\t\t\t\t\tregionAttachment.computeWorldVertices(slot, vertices, 0, 2);\n\t\t\t\t\tshapes.line(vertices[0], vertices[1], vertices[2], vertices[3]);\n\t\t\t\t\tshapes.line(vertices[2], vertices[3], vertices[4], vertices[5]);\n\t\t\t\t\tshapes.line(vertices[4], vertices[5], vertices[6], vertices[7]);\n\t\t\t\t\tshapes.line(vertices[6], vertices[7], vertices[0], vertices[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawMeshHull || this.drawMeshTriangles) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof MeshAttachment)) continue;\n\t\t\t\tlet mesh = attachment;\n\t\t\t\tlet vertices = this.vertices;\n\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, 2);\n\t\t\t\tlet triangles = mesh.triangles;\n\t\t\t\tlet hullLength = mesh.hullLength;\n\t\t\t\tif (this.drawMeshTriangles) {\n\t\t\t\t\tshapes.setColor(this.triangleLineColor);\n\t\t\t\t\tfor (let ii = 0, nn = triangles.length; ii < nn; ii += 3) {\n\t\t\t\t\t\tlet v1 = triangles[ii] * 2, v2 = triangles[ii + 1] * 2, v3 = triangles[ii + 2] * 2;\n\t\t\t\t\t\tshapes.triangle(false, vertices[v1], vertices[v1 + 1], //\n\t\t\t\t\t\t\tvertices[v2], vertices[v2 + 1], //\n\t\t\t\t\t\t\tvertices[v3], vertices[v3 + 1] //\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.drawMeshHull && hullLength > 0) {\n\t\t\t\t\tshapes.setColor(this.attachmentLineColor);\n\t\t\t\t\thullLength = (hullLength >> 1) * 2;\n\t\t\t\t\tlet lastX = vertices[hullLength - 2], lastY = vertices[hullLength - 1];\n\t\t\t\t\tfor (let ii = 0, nn = hullLength; ii < nn; ii += 2) {\n\t\t\t\t\t\tlet x = vertices[ii], y = vertices[ii + 1];\n\t\t\t\t\t\tshapes.line(x, y, lastX, lastY);\n\t\t\t\t\t\tlastX = x;\n\t\t\t\t\t\tlastY = y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawBoundingBoxes) {\n\t\t\tlet bounds = this.bounds;\n\t\t\tbounds.update(skeleton, true);\n\t\t\tshapes.setColor(this.aabbColor);\n\t\t\tshapes.rect(false, bounds.minX, bounds.minY, bounds.getWidth(), bounds.getHeight());\n\t\t\tlet polygons = bounds.polygons;\n\t\t\tlet boxes = bounds.boundingBoxes;\n\t\t\tfor (let i = 0, n = polygons.length; i < n; i++) {\n\t\t\t\tlet polygon = polygons[i];\n\t\t\t\tshapes.setColor(boxes[i].color);\n\t\t\t\tshapes.polygon(polygon, 0, polygon.length);\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawPaths) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof PathAttachment)) continue;\n\t\t\t\tlet path = attachment;\n\t\t\t\tlet nn = path.worldVerticesLength;\n\t\t\t\tlet world = this.temp = Utils.setArraySize(this.temp, nn, 0);\n\t\t\t\tpath.computeWorldVertices(slot, 0, nn, world, 0, 2);\n\t\t\t\tlet color = this.pathColor;\n\t\t\t\tlet x1 = world[2], y1 = world[3], x2 = 0, y2 = 0;\n\t\t\t\tif (path.closed) {\n\t\t\t\t\tshapes.setColor(color);\n\t\t\t\t\tlet cx1 = world[0], cy1 = world[1], cx2 = world[nn - 2], cy2 = world[nn - 1];\n\t\t\t\t\tx2 = world[nn - 4];\n\t\t\t\t\ty2 = world[nn - 3];\n\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\n\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\n\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\n\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\n\t\t\t\t}\n\t\t\t\tnn -= 4;\n\t\t\t\tfor (let ii = 4; ii < nn; ii += 6) {\n\t\t\t\t\tlet cx1 = world[ii], cy1 = world[ii + 1], cx2 = world[ii + 2], cy2 = world[ii + 3];\n\t\t\t\t\tx2 = world[ii + 4];\n\t\t\t\t\ty2 = world[ii + 5];\n\t\t\t\t\tshapes.setColor(color);\n\t\t\t\t\tshapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, 32);\n\t\t\t\t\tshapes.setColor(SkeletonDebugRenderer.LIGHT_GRAY);\n\t\t\t\t\tshapes.line(x1, y1, cx1, cy1);\n\t\t\t\t\tshapes.line(x2, y2, cx2, cy2);\n\t\t\t\t\tx1 = x2;\n\t\t\t\t\ty1 = y2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawBones) {\n\t\t\tshapes.setColor(this.boneOriginColor);\n\t\t\tfor (let i = 0, n = bones.length; i < n; i++) {\n\t\t\t\tlet bone = bones[i];\n\t\t\t\tif (ignoredBones && ignoredBones.indexOf(bone.data.name) > -1) continue;\n\t\t\t\tshapes.circle(true, bone.worldX, bone.worldY, 3 * this.scale, this.boneOriginColor, 8);\n\t\t\t}\n\t\t}\n\n\t\tif (this.drawClipping) {\n\t\t\tlet slots = skeleton.slots;\n\t\t\tshapes.setColor(this.clipColor)\n\t\t\tfor (let i = 0, n = slots.length; i < n; i++) {\n\t\t\t\tlet slot = slots[i];\n\t\t\t\tif (!slot.bone.active) continue;\n\t\t\t\tlet attachment = slot.getAttachment();\n\t\t\t\tif (!(attachment instanceof ClippingAttachment)) continue;\n\t\t\t\tlet clip = attachment;\n\t\t\t\tlet nn = clip.worldVerticesLength;\n\t\t\t\tlet world = this.temp = Utils.setArraySize(this.temp, nn, 0);\n\t\t\t\tclip.computeWorldVertices(slot, 0, nn, world, 0, 2);\n\t\t\t\tfor (let i = 0, n = world.length; i < n; i += 2) {\n\t\t\t\t\tlet x = world[i];\n\t\t\t\t\tlet y = world[i + 1];\n\t\t\t\t\tlet x2 = world[(i + 2) % world.length];\n\t\t\t\t\tlet y2 = world[(i + 3) % world.length];\n\t\t\t\t\tshapes.line(x, y, x2, y2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdispose () {\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { NumberArrayLike, Color, SkeletonClipping, Vector2, Utils, Skeleton, BlendMode, RegionAttachment, TextureAtlasRegion, MeshAttachment, ClippingAttachment } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { PolygonBatcher } from \"./PolygonBatcher.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n\n\nclass Renderable {\n\tconstructor (public vertices: NumberArrayLike, public numVertices: number, public numFloats: number) { }\n};\n\nexport type VertexTransformer = (vertices: NumberArrayLike, numVertices: number, stride: number) => void;\n\nexport class SkeletonRenderer {\n\tstatic QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n\n\tpremultipliedAlpha = false;\n\tprivate tempColor = new Color();\n\tprivate tempColor2 = new Color();\n\tprivate vertices: NumberArrayLike;\n\tprivate vertexSize = 2 + 2 + 4;\n\tprivate twoColorTint = false;\n\tprivate renderable: Renderable = new Renderable([], 0, 0);\n\tprivate clipper: SkeletonClipping = new SkeletonClipping();\n\tprivate temp = new Vector2();\n\tprivate temp2 = new Vector2();\n\tprivate temp3 = new Color();\n\tprivate temp4 = new Color();\n\n\tconstructor (context: ManagedWebGLRenderingContext, twoColorTint: boolean = true) {\n\t\tthis.twoColorTint = twoColorTint;\n\t\tif (twoColorTint)\n\t\t\tthis.vertexSize += 4;\n\t\tthis.vertices = Utils.newFloatArray(this.vertexSize * 1024);\n\t}\n\n\tdraw (batcher: PolygonBatcher, skeleton: Skeleton, slotRangeStart: number = -1, slotRangeEnd: number = -1, transformer: VertexTransformer | null = null) {\n\t\tlet clipper = this.clipper;\n\t\tlet premultipliedAlpha = this.premultipliedAlpha;\n\t\tlet twoColorTint = this.twoColorTint;\n\t\tlet blendMode: BlendMode | null = null;\n\n\t\tlet renderable: Renderable = this.renderable;\n\t\tlet uvs: NumberArrayLike;\n\t\tlet triangles: Array;\n\t\tlet drawOrder = skeleton.drawOrder;\n\t\tlet attachmentColor: Color;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet vertexSize = twoColorTint ? 12 : 8;\n\t\tlet inRange = false;\n\t\tif (slotRangeStart == -1) inRange = true;\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet clippedVertexSize = clipper.isClipping() ? 2 : vertexSize;\n\t\t\tlet slot = drawOrder[i];\n\t\t\tif (!slot.bone.active) {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (slotRangeStart >= 0 && slotRangeStart == slot.data.index) {\n\t\t\t\tinRange = true;\n\t\t\t}\n\n\t\t\tif (!inRange) {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (slotRangeEnd >= 0 && slotRangeEnd == slot.data.index) {\n\t\t\t\tinRange = false;\n\t\t\t}\n\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tlet texture: GLTexture;\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tlet region = attachment;\n\t\t\t\trenderable.vertices = this.vertices;\n\t\t\t\trenderable.numVertices = 4;\n\t\t\t\trenderable.numFloats = clippedVertexSize << 2;\n\t\t\t\tregion.computeWorldVertices(slot, renderable.vertices, 0, clippedVertexSize);\n\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\n\t\t\t\tuvs = region.uvs;\n\t\t\t\ttexture = region.region!.texture;\n\t\t\t\tattachmentColor = region.color;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = attachment;\n\t\t\t\trenderable.vertices = this.vertices;\n\t\t\t\trenderable.numVertices = (mesh.worldVerticesLength >> 1);\n\t\t\t\trenderable.numFloats = renderable.numVertices * clippedVertexSize;\n\t\t\t\tif (renderable.numFloats > renderable.vertices.length) {\n\t\t\t\t\trenderable.vertices = this.vertices = Utils.newFloatArray(renderable.numFloats);\n\t\t\t\t}\n\t\t\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, renderable.vertices, 0, clippedVertexSize);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t\ttexture = mesh.region!.texture;\n\t\t\t\tuvs = mesh.uvs;\n\t\t\t\tattachmentColor = mesh.color;\n\t\t\t} else if (attachment instanceof ClippingAttachment) {\n\t\t\t\tlet clip = (attachment);\n\t\t\t\tclipper.clipStart(slot, clip);\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tclipper.clipEndWithSlot(slot);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (texture) {\n\t\t\t\tlet slotColor = slot.color;\n\t\t\t\tlet finalColor = this.tempColor;\n\t\t\t\tfinalColor.r = skeletonColor.r * slotColor.r * attachmentColor.r;\n\t\t\t\tfinalColor.g = skeletonColor.g * slotColor.g * attachmentColor.g;\n\t\t\t\tfinalColor.b = skeletonColor.b * slotColor.b * attachmentColor.b;\n\t\t\t\tfinalColor.a = skeletonColor.a * slotColor.a * attachmentColor.a;\n\t\t\t\tif (premultipliedAlpha) {\n\t\t\t\t\tfinalColor.r *= finalColor.a;\n\t\t\t\t\tfinalColor.g *= finalColor.a;\n\t\t\t\t\tfinalColor.b *= finalColor.a;\n\t\t\t\t}\n\t\t\t\tlet darkColor = this.tempColor2;\n\t\t\t\tif (!slot.darkColor)\n\t\t\t\t\tdarkColor.set(0, 0, 0, 1.0);\n\t\t\t\telse {\n\t\t\t\t\tif (premultipliedAlpha) {\n\t\t\t\t\t\tdarkColor.r = slot.darkColor.r * finalColor.a;\n\t\t\t\t\t\tdarkColor.g = slot.darkColor.g * finalColor.a;\n\t\t\t\t\t\tdarkColor.b = slot.darkColor.b * finalColor.a;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdarkColor.setFromColor(slot.darkColor);\n\t\t\t\t\t}\n\t\t\t\t\tdarkColor.a = premultipliedAlpha ? 1.0 : 0.0;\n\t\t\t\t}\n\n\t\t\t\tlet slotBlendMode = slot.data.blendMode;\n\t\t\t\tif (slotBlendMode != blendMode) {\n\t\t\t\t\tblendMode = slotBlendMode;\n\t\t\t\t\tbatcher.setBlendMode(blendMode, premultipliedAlpha);\n\t\t\t\t}\n\n\t\t\t\tif (clipper.isClipping()) {\n\t\t\t\t\tclipper.clipTriangles(renderable.vertices, triangles, triangles.length, uvs, finalColor, darkColor, twoColorTint);\n\t\t\t\t\tlet clippedVertices = new Float32Array(clipper.clippedVertices);\n\t\t\t\t\tlet clippedTriangles = clipper.clippedTriangles;\n\t\t\t\t\tif (transformer) transformer(clippedVertices, clippedVertices.length, vertexSize);\n\t\t\t\t\tbatcher.draw(texture, clippedVertices, clippedTriangles);\n\t\t\t\t} else {\n\t\t\t\t\tlet verts = renderable.vertices;\n\t\t\t\t\tif (!twoColorTint) {\n\t\t\t\t\t\tfor (let v = 2, u = 0, n = renderable.numFloats; v < n; v += vertexSize, u += 2) {\n\t\t\t\t\t\t\tverts[v] = finalColor.r;\n\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\n\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\n\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\n\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\n\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (let v = 2, u = 0, n = renderable.numFloats; v < n; v += vertexSize, u += 2) {\n\t\t\t\t\t\t\tverts[v] = finalColor.r;\n\t\t\t\t\t\t\tverts[v + 1] = finalColor.g;\n\t\t\t\t\t\t\tverts[v + 2] = finalColor.b;\n\t\t\t\t\t\t\tverts[v + 3] = finalColor.a;\n\t\t\t\t\t\t\tverts[v + 4] = uvs[u];\n\t\t\t\t\t\t\tverts[v + 5] = uvs[u + 1];\n\t\t\t\t\t\t\tverts[v + 6] = darkColor.r;\n\t\t\t\t\t\t\tverts[v + 7] = darkColor.g;\n\t\t\t\t\t\t\tverts[v + 8] = darkColor.b;\n\t\t\t\t\t\t\tverts[v + 9] = darkColor.a;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tlet view = (renderable.vertices as Float32Array).subarray(0, renderable.numFloats);\n\t\t\t\t\tif (transformer) transformer(renderable.vertices, renderable.numFloats, vertexSize);\n\t\t\t\t\tbatcher.draw(texture, view, triangles);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclipper.clipEndWithSlot(slot);\n\t\t}\n\t\tclipper.clipEnd();\n\t}\n\n\t/** Returns the {@link SkeletonClipping} used by this renderer for use with e.g. {@link Skeleton.getBounds} **/\n\tpublic getSkeletonClipping (): SkeletonClipping {\n\t\treturn this.clipper;\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Color, Disposable, Skeleton, MathUtils, TextureAtlasRegion } from \"@esotericsoftware/spine-core\";\nimport { OrthoCamera } from \"./Camera.js\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { PolygonBatcher } from \"./PolygonBatcher.js\";\nimport { Shader } from \"./Shader.js\";\nimport { ShapeRenderer } from \"./ShapeRenderer.js\";\nimport { SkeletonDebugRenderer } from \"./SkeletonDebugRenderer.js\";\nimport { SkeletonRenderer, VertexTransformer } from \"./SkeletonRenderer.js\";\nimport { ManagedWebGLRenderingContext } from \"./WebGL.js\";\n;\n\nconst quad = [\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n\t0, 0, 1, 1, 1, 1, 0, 0,\n];\nconst QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\nconst WHITE = new Color(1, 1, 1, 1);\n\nexport class SceneRenderer implements Disposable {\n\tcontext: ManagedWebGLRenderingContext;\n\tcanvas: HTMLCanvasElement;\n\tcamera: OrthoCamera;\n\tbatcher: PolygonBatcher;\n\tprivate twoColorTint = false;\n\tprivate batcherShader: Shader;\n\tprivate shapes: ShapeRenderer;\n\tprivate shapesShader: Shader;\n\tprivate activeRenderer: PolygonBatcher | ShapeRenderer | SkeletonDebugRenderer | null = null;\n\tskeletonRenderer: SkeletonRenderer;\n\tskeletonDebugRenderer: SkeletonDebugRenderer;\n\n\tconstructor (canvas: HTMLCanvasElement, context: ManagedWebGLRenderingContext | WebGLRenderingContext, twoColorTint: boolean = true) {\n\t\tthis.canvas = canvas;\n\t\tthis.context = context instanceof ManagedWebGLRenderingContext ? context : new ManagedWebGLRenderingContext(context);\n\t\tthis.twoColorTint = twoColorTint;\n\t\tthis.camera = new OrthoCamera(canvas.width, canvas.height);\n\t\tthis.batcherShader = twoColorTint ? Shader.newTwoColoredTextured(this.context) : Shader.newColoredTextured(this.context);\n\t\tthis.batcher = new PolygonBatcher(this.context, twoColorTint);\n\t\tthis.shapesShader = Shader.newColored(this.context);\n\t\tthis.shapes = new ShapeRenderer(this.context);\n\t\tthis.skeletonRenderer = new SkeletonRenderer(this.context, twoColorTint);\n\t\tthis.skeletonDebugRenderer = new SkeletonDebugRenderer(this.context);\n\t}\n\n\tdispose () {\n\t\tthis.batcher.dispose();\n\t\tthis.batcherShader.dispose();\n\t\tthis.shapes.dispose();\n\t\tthis.shapesShader.dispose();\n\t\tthis.skeletonDebugRenderer.dispose();\n\t}\n\n\tbegin () {\n\t\tthis.camera.update();\n\t\tthis.enableRenderer(this.batcher);\n\t}\n\n\tdrawSkeleton (skeleton: Skeleton, premultipliedAlpha = false, slotRangeStart = -1, slotRangeEnd = -1, transform: VertexTransformer | null = null) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tthis.skeletonRenderer.premultipliedAlpha = premultipliedAlpha;\n\t\tthis.skeletonRenderer.draw(this.batcher, skeleton, slotRangeStart, slotRangeEnd, transform);\n\t}\n\n\tdrawSkeletonDebug (skeleton: Skeleton, premultipliedAlpha = false, ignoredBones?: Array) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.skeletonDebugRenderer.premultipliedAlpha = premultipliedAlpha;\n\t\tthis.skeletonDebugRenderer.draw(this.shapes, skeleton, ignoredBones);\n\t}\n\n\tdrawTexture (texture: GLTexture, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawTextureUV (texture: GLTexture, x: number, y: number, width: number, height: number, u: number, v: number, u2: number, v2: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u;\n\t\tquad[i++] = v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u2;\n\t\tquad[i++] = v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u2;\n\t\tquad[i++] = v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = u;\n\t\tquad[i++] = v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawTextureRotated (texture: GLTexture, x: number, y: number, width: number, height: number, pivotX: number, pivotY: number, angle: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\n\t\t// bottom left and top right corner points relative to origin\n\t\tlet worldOriginX = x + pivotX;\n\t\tlet worldOriginY = y + pivotY;\n\t\tlet fx = -pivotX;\n\t\tlet fy = -pivotY;\n\t\tlet fx2 = width - pivotX;\n\t\tlet fy2 = height - pivotY;\n\n\t\t// construct corner points, start from top left and go counter clockwise\n\t\tlet p1x = fx;\n\t\tlet p1y = fy;\n\t\tlet p2x = fx;\n\t\tlet p2y = fy2;\n\t\tlet p3x = fx2;\n\t\tlet p3y = fy2;\n\t\tlet p4x = fx2;\n\t\tlet p4y = fy;\n\n\t\tlet x1 = 0;\n\t\tlet y1 = 0;\n\t\tlet x2 = 0;\n\t\tlet y2 = 0;\n\t\tlet x3 = 0;\n\t\tlet y3 = 0;\n\t\tlet x4 = 0;\n\t\tlet y4 = 0;\n\n\t\t// rotate\n\t\tif (angle != 0) {\n\t\t\tlet cos = MathUtils.cosDeg(angle);\n\t\t\tlet sin = MathUtils.sinDeg(angle);\n\n\t\t\tx1 = cos * p1x - sin * p1y;\n\t\t\ty1 = sin * p1x + cos * p1y;\n\n\t\t\tx4 = cos * p2x - sin * p2y;\n\t\t\ty4 = sin * p2x + cos * p2y;\n\n\t\t\tx3 = cos * p3x - sin * p3y;\n\t\t\ty3 = sin * p3x + cos * p3y;\n\n\t\t\tx2 = x3 + (x1 - x4);\n\t\t\ty2 = y3 + (y1 - y4);\n\t\t} else {\n\t\t\tx1 = p1x;\n\t\t\ty1 = p1y;\n\n\t\t\tx4 = p2x;\n\t\t\ty4 = p2y;\n\n\t\t\tx3 = p3x;\n\t\t\ty3 = p3y;\n\n\t\t\tx2 = p4x;\n\t\t\ty2 = p4y;\n\t\t}\n\n\t\tx1 += worldOriginX;\n\t\ty1 += worldOriginY;\n\t\tx2 += worldOriginX;\n\t\ty2 += worldOriginY;\n\t\tx3 += worldOriginX;\n\t\ty3 += worldOriginY;\n\t\tx4 += worldOriginX;\n\t\ty4 += worldOriginY;\n\n\t\tvar i = 0;\n\t\tquad[i++] = x1;\n\t\tquad[i++] = y1;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x2;\n\t\tquad[i++] = y2;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 1;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x3;\n\t\tquad[i++] = y3;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 1;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x4;\n\t\tquad[i++] = y4;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = 0;\n\t\tquad[i++] = 0;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tdrawRegion (region: TextureAtlasRegion, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.batcher);\n\t\tif (!color) color = WHITE;\n\t\tvar i = 0;\n\t\tquad[i++] = x;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u;\n\t\tquad[i++] = region.v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u2;\n\t\tquad[i++] = region.v2;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x + width;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u2;\n\t\tquad[i++] = region.v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t}\n\t\tquad[i++] = x;\n\t\tquad[i++] = y + height;\n\t\tquad[i++] = color.r;\n\t\tquad[i++] = color.g;\n\t\tquad[i++] = color.b;\n\t\tquad[i++] = color.a;\n\t\tquad[i++] = region.u;\n\t\tquad[i++] = region.v;\n\t\tif (this.twoColorTint) {\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i++] = 0;\n\t\t\tquad[i] = 0;\n\t\t}\n\t\tthis.batcher.draw(region.page.texture, quad, QUAD_TRIANGLES);\n\t}\n\n\tline (x: number, y: number, x2: number, y2: number, color?: Color, color2?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.line(x, y, x2, y2, color);\n\t}\n\n\ttriangle (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, color?: Color, color2?: Color, color3?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.triangle(filled, x, y, x2, y2, x3, y3, color, color2, color3);\n\t}\n\n\tquad (filled: boolean, x: number, y: number, x2: number, y2: number, x3: number, y3: number, x4: number, y4: number, color?: Color, color2?: Color, color3?: Color, color4?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.quad(filled, x, y, x2, y2, x3, y3, x4, y4, color, color2, color3, color4);\n\t}\n\n\trect (filled: boolean, x: number, y: number, width: number, height: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.rect(filled, x, y, width, height, color);\n\t}\n\n\trectLine (filled: boolean, x1: number, y1: number, x2: number, y2: number, width: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.rectLine(filled, x1, y1, x2, y2, width, color);\n\t}\n\n\tpolygon (polygonVertices: ArrayLike, offset: number, count: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.polygon(polygonVertices, offset, count, color);\n\t}\n\n\tcircle (filled: boolean, x: number, y: number, radius: number, color?: Color, segments: number = 0) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.circle(filled, x, y, radius, color, segments);\n\t}\n\n\tcurve (x1: number, y1: number, cx1: number, cy1: number, cx2: number, cy2: number, x2: number, y2: number, segments: number, color?: Color) {\n\t\tthis.enableRenderer(this.shapes);\n\t\tthis.shapes.curve(x1, y1, cx1, cy1, cx2, cy2, x2, y2, segments, color);\n\t}\n\n\tend () {\n\t\tif (this.activeRenderer === this.batcher) this.batcher.end();\n\t\telse if (this.activeRenderer === this.shapes) this.shapes.end();\n\t\tthis.activeRenderer = null;\n\t}\n\n\tresize (resizeMode: ResizeMode) {\n\t\tlet canvas = this.canvas;\n\t\tvar dpr = window.devicePixelRatio || 1;\n\t\tvar w = Math.round(canvas.clientWidth * dpr);\n\t\tvar h = Math.round(canvas.clientHeight * dpr);\n\n\t\tif (canvas.width != w || canvas.height != h) {\n\t\t\tcanvas.width = w;\n\t\t\tcanvas.height = h;\n\t\t}\n\t\tthis.context.gl.viewport(0, 0, canvas.width, canvas.height);\n\n\t\t// Nothing to do for stretch, we simply apply the viewport size of the camera.\n\t\tif (resizeMode === ResizeMode.Expand)\n\t\t\tthis.camera.setViewport(w, h);\n\t\telse if (resizeMode === ResizeMode.Fit) {\n\t\t\tlet sourceWidth = canvas.width, sourceHeight = canvas.height;\n\t\t\tlet targetWidth = this.camera.viewportWidth, targetHeight = this.camera.viewportHeight;\n\t\t\tlet targetRatio = targetHeight / targetWidth;\n\t\t\tlet sourceRatio = sourceHeight / sourceWidth;\n\t\t\tlet scale = targetRatio < sourceRatio ? targetWidth / sourceWidth : targetHeight / sourceHeight;\n\t\t\tthis.camera.setViewport(sourceWidth * scale, sourceHeight * scale);\n\t\t}\n\t\tthis.camera.update();\n\t}\n\n\tprivate enableRenderer (renderer: PolygonBatcher | ShapeRenderer | SkeletonDebugRenderer) {\n\t\tif (this.activeRenderer === renderer) return;\n\t\tthis.end();\n\t\tif (renderer instanceof PolygonBatcher) {\n\t\t\tthis.batcherShader.bind();\n\t\t\tthis.batcherShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values);\n\t\t\tthis.batcherShader.setUniformi(\"u_texture\", 0);\n\t\t\tthis.batcher.begin(this.batcherShader);\n\t\t\tthis.activeRenderer = this.batcher;\n\t\t} else if (renderer instanceof ShapeRenderer) {\n\t\t\tthis.shapesShader.bind();\n\t\t\tthis.shapesShader.setUniform4x4f(Shader.MVP_MATRIX, this.camera.projectionView.values);\n\t\t\tthis.shapes.begin(this.shapesShader);\n\t\t\tthis.activeRenderer = this.shapes;\n\t\t} else\n\t\t\tthis.activeRenderer = this.skeletonDebugRenderer;\n\t}\n}\n\nexport enum ResizeMode {\n\tStretch,\n\tExpand,\n\tFit\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { BlendMode, Color, Disposable, TimeKeeper } from \"@esotericsoftware/spine-core\";\nimport { GLTexture } from \"./GLTexture.js\";\nimport { ResizeMode, SceneRenderer } from \"./SceneRenderer.js\";\n\nlet spinnerImage: HTMLImageElement;\nlet logoImage: HTMLImageElement;\nlet loaded = 0;\n\nconst FADE_IN = 1, FADE_OUT = 1;\nconst logoWidth = 165, logoHeight = 108, spinnerSize = 163;\n\nexport class LoadingScreen implements Disposable {\n\tprivate renderer: SceneRenderer;\n\tprivate logo: GLTexture | null = null;\n\tprivate spinner: GLTexture | null = null;\n\tprivate angle = 0;\n\tprivate fadeOut = 0;\n\tprivate fadeIn = 0;\n\tprivate timeKeeper = new TimeKeeper();\n\tbackgroundColor = new Color(0.135, 0.135, 0.135, 1);\n\tprivate tempColor = new Color();\n\n\tconstructor (renderer: SceneRenderer) {\n\t\tthis.renderer = renderer;\n\n\t\tthis.timeKeeper.maxDelta = 9;\n\n\t\tif (!logoImage) {\n\t\t\tlet isSafari = navigator.userAgent.indexOf(\"Safari\") > -1; // Thank you Apple Inc.\n\t\t\tlet onload = () => loaded++;\n\n\t\t\tlogoImage = new Image();\n\t\t\tlogoImage.src = SPINE_LOGO_DATA;\n\t\t\tif (!isSafari) logoImage.crossOrigin = \"anonymous\";\n\t\t\tlogoImage.onload = onload;\n\n\t\t\tspinnerImage = new Image();\n\t\t\tspinnerImage.src = SPINNER_DATA;\n\t\t\tif (!isSafari) spinnerImage.crossOrigin = \"anonymous\";\n\t\t\tspinnerImage.onload = onload;\n\t\t}\n\t}\n\tdispose (): void {\n\t\tthis.logo?.dispose();\n\t\tthis.spinner?.dispose();\n\t}\n\n\tdraw (complete = false) {\n\t\tif (loaded < 2 || (complete && this.fadeOut > FADE_OUT)) return;\n\n\t\tthis.timeKeeper.update();\n\t\tlet a = Math.abs(Math.sin(this.timeKeeper.totalTime + 0.25));\n\t\tthis.angle -= this.timeKeeper.delta * 200 * (1 + 1.5 * Math.pow(a, 5));\n\n\t\tlet tempColor = this.tempColor;\n\t\tlet renderer = this.renderer;\n\t\tlet canvas = renderer.canvas;\n\t\tlet gl = renderer.context.gl;\n\n\t\trenderer.resize(ResizeMode.Expand);\n\t\trenderer.camera.position.set(canvas.width / 2, canvas.height / 2, 0);\n\t\trenderer.batcher.setBlendMode(BlendMode.Normal, true);\n\n\t\tif (complete) {\n\t\t\tthis.fadeOut += this.timeKeeper.delta * (this.timeKeeper.totalTime < 1 ? 2 : 1);\n\t\t\tif (this.fadeOut > FADE_OUT) return;\n\t\t\ttempColor.setFromColor(this.backgroundColor);\n\t\t\ta = 1 - this.fadeOut / FADE_OUT;\n\t\t\ta = 1 - (a - 1) * (a - 1);\n\t\t\ttempColor.a *= a;\n\t\t\tif (tempColor.a > 0) {\n\t\t\t\trenderer.camera.zoom = 1;\n\t\t\t\trenderer.begin();\n\t\t\t\trenderer.quad(true, 0, 0, canvas.width, 0, canvas.width, canvas.height, 0, canvas.height,\n\t\t\t\t\ttempColor, tempColor, tempColor, tempColor);\n\t\t\t\trenderer.end();\n\t\t\t}\n\t\t} else {\n\t\t\tthis.fadeIn += this.timeKeeper.delta;\n\t\t\tif (this.backgroundColor.a > 0) {\n\t\t\t\tgl.clearColor(this.backgroundColor.r, this.backgroundColor.g, this.backgroundColor.b, this.backgroundColor.a);\n\t\t\t\tgl.clear(gl.COLOR_BUFFER_BIT);\n\t\t\t}\n\t\t\ta = 1;\n\t\t}\n\t\ta *= Math.min(this.fadeIn / FADE_IN, 1);\n\t\ttempColor.set(a, a, a, a);\n\n\t\tif (!this.logo) {\n\t\t\tthis.logo = new GLTexture(renderer.context, logoImage);\n\t\t\tthis.spinner = new GLTexture(renderer.context, spinnerImage);\n\t\t}\n\t\trenderer.camera.zoom = Math.max(1, spinnerSize / canvas.height);\n\t\trenderer.begin();\n\t\trenderer.drawTexture(this.logo, (canvas.width - logoWidth) / 2, (canvas.height - logoHeight) / 2, logoWidth, logoHeight, tempColor);\n\t\tif (this.spinner) renderer.drawTextureRotated(this.spinner, (canvas.width - spinnerSize) / 2, (canvas.height - spinnerSize) / 2, spinnerSize, spinnerSize, spinnerSize / 2, spinnerSize / 2, this.angle, tempColor);\n\t\trenderer.end();\n\t}\n}\n\nlet SPINNER_DATA = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKMAAACjCAYAAADmbK6AAAALKElEQVR42u2de2iW5R/GPzuqcwfnnKfNmafl5tTNHWzqNi3DEMQykcAoJSsySkspjSIk0iD/07Kf4R+FnVBDUTshZGpWUEJaaiWFgZlUFmXmIe3HNXthyebeZ77P9H13ffBG8Y8H7ut7vff93N/7fu4vGGPiFZiez/Qtw9lytJajfzfw9z/j+efPOv7cV8W+lUNY2a8T/ayTCRsWFLJA5rtUO1LLkV5p9LJeJizQiHeqnlOtmVFtdTGrrZkJCxYXsTgaI6r9MY4/UpNItW4mFDaXsTlaM6qVZlBq3UwofFrJp0HMWJ9DvXUzobCznJ1BzFjWlTLrZkJh/TDWBzFjTgo51s2EgnKI0Rrx+FiOWzNzVaym91Syx5qZsGBWb2ZFa0ZN6dbMhAWTcpkUrRmXD2K5NTNhgVbH0Zpxbl/mWjMTFvRIo0e0ZpzcncnWzISKtvmiMWNRJ4qslwmVXRXsas2Ix8ZwzFqZsGFREYtaM+Oaa1ljrUzYkJ9G/ok6TlzKjJWZVFor0y7c1Zu7WjLiqiGsskamXdHopyT4vALmzS9k/t19uHtKHlOSIMn6xAtARjIZ1sFcUSZ0Y4La+G6M18hS2IlCn4a+WoC0JNL0d/dUupdnUj40g6EJ2VEdMnhrOG/p5f/jUXz8SgmvaGU6KpNRNsLVQV0OdXf24s63h/P2gW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QoTG7W5ODkAF1CnVgm2JQx4okPA+gCMTbGskBGgRmaOblAh5GTORIrfKFx4VH4EIAxIXIxlg2SBbMvECY3e7oApbDaIgQu5/2HmeEKEINYiwSRi7EQkLFgumZOCuggctKGI4ULZN/vMeSLj0AYMytWEqMLzFg4fYDaoKaC6wvOFR4FkIPQFaILxrJAOsHsc/zlfYDWXE8qF22s8Pz5KHxcgEVALBtjJXBSSEOwFhk1Zgy4hitCT4hVw+gFs8/zwxqIBbUgyK7fcyA0PD9XX4iVxhiC0xdof6STWCsoBmKF7+cVCWFXQYyBMxRpf+STX1b0x45AhN0OMSrOGEirhrY/dfQAdjvS7oy+WCF6r1RIFxXWvlTRg1YVqFWBmxZbD99ig9pt0YPQw9rD1nstVri9V+/Ve3XrS/wfim4P5fIFxLoAAAAASUVORK5CYII=\";\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { TimeKeeper, AssetManager, ManagedWebGLRenderingContext, SceneRenderer, Input, StringMap } from \"./index.js\";\n\n/** An app running inside a {@link SpineCanvas}. The app life-cycle\n * is as follows:\n *\n * 1. `loadAssets()` is called. The app can queue assets for loading via {@link SpineCanvas.assetManager}.\n * 2. `initialize()` is called when all assets are loaded. The app can setup anything it needs to enter the main application logic.\n * 3. `update()` is called periodically at screen refresh rate. The app can update its state.\n * 4. `render()` is called periodically at screen refresh rate. The app can render its state via {@link SpineCanvas.renderer} or directly via the WebGL context in {@link SpineCanvas.gl}.\n *\n * The `error()` method is called in case the assets could not be loaded. The `dispose()` method is called in case the canvas has been disposed via {@link SpineCanvas.dispose}.\n */\nexport interface SpineCanvasApp {\n\tloadAssets?(canvas: SpineCanvas): void;\n\tinitialize?(canvas: SpineCanvas): void;\n\tupdate?(canvas: SpineCanvas, delta: number): void;\n\trender?(canvas: SpineCanvas): void;\n\terror?(canvas: SpineCanvas, errors: StringMap): void;\n\tdispose?(canvas: SpineCanvas): void;\n}\n\n/** Configuration passed to the {@link SpineCanvas} constructor */\nexport interface SpineCanvasConfig {\n\t/* The {@link SpineCanvasApp} to be run in the canvas. */\n\tapp: SpineCanvasApp;\n\t/* The path prefix to be used by the {@link AssetManager}. */\n\tpathPrefix?: string;\n\t/* The WebGL context configuration */\n\twebglConfig?: any;\n}\n\n/** Manages the life-cycle and WebGL context of a {@link SpineCanvasApp}. The app loads\n * assets and initializes itself, then updates and renders its state at the screen refresh rate. */\nexport class SpineCanvas {\n\treadonly context: ManagedWebGLRenderingContext;\n\n\t/** Tracks the current time, delta, and other time related statistics. */\n\treadonly time = new TimeKeeper();\n\t/** The HTML canvas to render to. */\n\treadonly htmlCanvas: HTMLCanvasElement;\n\t/** The WebGL rendering context. */\n\treadonly gl: WebGLRenderingContext;\n\t/** The scene renderer for easy drawing of skeletons, shapes, and images. */\n\treadonly renderer: SceneRenderer;\n\t/** The asset manager to load assets with. */\n\treadonly assetManager: AssetManager;\n\t/** The input processor used to listen to mouse, touch, and keyboard events. */\n\treadonly input: Input;\n\n\tprivate disposed = false;\n\n\t/** Constructs a new spine canvas, rendering to the provided HTML canvas. */\n\tconstructor (canvas: HTMLCanvasElement, private config: SpineCanvasConfig) {\n\t\tif (!config.pathPrefix) config.pathPrefix = \"\";\n\t\tif (!config.app) config.app = {\n\t\t\tloadAssets: () => { },\n\t\t\tinitialize: () => { },\n\t\t\tupdate: () => { },\n\t\t\trender: () => { },\n\t\t\terror: () => { },\n\t\t\tdispose: () => { },\n\t\t}\n\t\tif (!config.webglConfig) config.webglConfig = { alpha: true };\n\n\t\tthis.htmlCanvas = canvas;\n\t\tthis.context = new ManagedWebGLRenderingContext(canvas, config.webglConfig);\n\t\tthis.renderer = new SceneRenderer(canvas, this.context);\n\t\tthis.gl = this.context.gl;\n\t\tthis.assetManager = new AssetManager(this.context, config.pathPrefix);\n\t\tthis.input = new Input(canvas);\n\n\t\tif (config.app.loadAssets) config.app.loadAssets(this);\n\n\t\tlet loop = () => {\n\t\t\tif (this.disposed) return;\n\t\t\trequestAnimationFrame(loop);\n\t\t\tthis.time.update();\n\t\t\tif (config.app.update) config.app.update(this, this.time.delta);\n\t\t\tif (config.app.render) config.app.render(this);\n\t\t}\n\n\t\tlet waitForAssets = () => {\n\t\t\tif (this.disposed) return;\n\t\t\tif (this.assetManager.isLoadingComplete()) {\n\t\t\t\tif (this.assetManager.hasErrors()) {\n\t\t\t\t\tif (config.app.error) config.app.error(this, this.assetManager.getErrors());\n\t\t\t\t} else {\n\t\t\t\t\tif (config.app.initialize) config.app.initialize(this);\n\t\t\t\t\tloop();\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\trequestAnimationFrame(waitForAssets);\n\t\t}\n\t\trequestAnimationFrame(waitForAssets);\n\t}\n\n\t/** Clears the canvas with the given color. The color values are given in the range [0,1]. */\n\tclear (r: number, g: number, b: number, a: number) {\n\t\tthis.gl.clearColor(r, g, b, a);\n\t\tthis.gl.clear(this.gl.COLOR_BUFFER_BIT);\n\t}\n\n\t/** Disposes the app, so the update() and render() functions are no longer called. Calls the dispose() callback.*/\n\tdispose () {\n\t\tif (this.config.app.dispose) this.config.app.dispose(this);\n\t\tthis.disposed = true;\n\t}\n}\n", "/*\nThe MIT License (MIT)\n\nCopyright (c) 2021-present AgogPixel\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\n\n// Adapted from https://github.com/agogpixel/phaser3-ts-utils/tree/main\n\nlet components = (Phaser.GameObjects.Components as any);\nexport const ComputedSize = components.ComputedSize;\nexport const Depth = components.Depth;\nexport const Flip = components.Flip;\nexport const ScrollFactor = components.ScrollFactor;\nexport const Transform = components.Transform;\nexport const Visible = components.Visible;\nexport const Origin = components.Origin;\nexport const Alpha = components.Alpha;\n\nexport interface Type<\n\tT,\n\tP extends any[] = any[]\n\t> extends Function {\n\tnew(...args: P): T;\n}\n\nexport type Mixin = <\n\tGameObjectType extends Type\n\t>(\n\tBaseGameObject: GameObjectType\n) => GameObjectType & Type;\n\nexport function createMixin<\n\tGameObjectComponent,\n\tGameObjectConstraint extends Phaser.GameObjects.GameObject = Phaser.GameObjects.GameObject\n> (\n\t...component: GameObjectComponent[]\n): Mixin {\n\treturn (BaseGameObject) => {\n\t\t(Phaser as any).Class.mixin(BaseGameObject, component);\n\t\treturn BaseGameObject as any;\n\t};\n}\n\ntype ComputedSizeMixin = Mixin;\nexport const ComputedSizeMixin: ComputedSizeMixin = createMixin(ComputedSize);\n\ntype DepthMixin = Mixin;\nexport const DepthMixin: DepthMixin = createMixin(Depth);\n\ntype FlipMixin = Mixin;\nexport const FlipMixin: FlipMixin = createMixin(Flip);\n\ntype ScrollFactorMixin = Mixin;\nexport const ScrollFactorMixin: ScrollFactorMixin = createMixin(ScrollFactor);\n\ntype TransformMixin = Mixin;\nexport const TransformMixin: TransformMixin = createMixin(Transform);\n\ntype VisibleMixin = Mixin;\nexport const VisibleMixin: VisibleMixin = createMixin(Visible);\n\ntype OriginMixin = Mixin;\nexport const OriginMixin: OriginMixin = createMixin(Origin);\n\ntype AlphaMixin = Mixin;\nexport const AlphaMixin: AlphaMixin = createMixin(Alpha);", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { SPINE_GAME_OBJECT_TYPE } from \"./keys.js\";\nimport { SpinePlugin } from \"./SpinePlugin.js\";\nimport {\n\tComputedSizeMixin,\n\tDepthMixin,\n\tFlipMixin,\n\tScrollFactorMixin,\n\tTransformMixin,\n\tVisibleMixin,\n\tAlphaMixin,\n\tOriginMixin,\n} from \"./mixins.js\";\nimport {\n\tAnimationState,\n\tAnimationStateData,\n\tBone,\n\tMathUtils,\n\tPhysics,\n\tSkeleton,\n\tSkeletonClipping,\n\tSkin,\n\tVector2,\n} from \"@esotericsoftware/spine-core\";\n\nclass BaseSpineGameObject extends Phaser.GameObjects.GameObject {\n\tconstructor (scene: Phaser.Scene, type: string) {\n\t\tsuper(scene, type);\n\t}\n}\n\n/** A bounds provider calculates the bounding box for a skeleton, which is then assigned as the size of the SpineGameObject. */\nexport interface SpineGameObjectBoundsProvider {\n\t// Returns the bounding box for the skeleton, in skeleton space.\n\tcalculateBounds (gameObject: SpineGameObject): {\n\t\tx: number;\n\t\ty: number;\n\t\twidth: number;\n\t\theight: number;\n\t};\n}\n\n/** A bounds provider that calculates the bounding box from the setup pose. */\nexport class SetupPoseBoundsProvider implements SpineGameObjectBoundsProvider {\n\t/**\n\t * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.\n\t */\n\tconstructor (\n\t\tprivate clipping = false,\n\t) { }\n\n\tcalculateBounds (gameObject: SpineGameObject) {\n\t\tif (!gameObject.skeleton) return { x: 0, y: 0, width: 0, height: 0 };\n\t\t// Make a copy of animation state and skeleton as this might be called while\n\t\t// the skeleton in the GameObject has already been heavily modified. We can not\n\t\t// reconstruct that state.\n\t\tconst skeleton = new Skeleton(gameObject.skeleton.data);\n\t\tskeleton.setToSetupPose();\n\t\tskeleton.updateWorldTransform(Physics.update);\n\t\tconst bounds = skeleton.getBoundsRect(this.clipping ? new SkeletonClipping() : undefined);\n\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t: bounds;\n\t}\n}\n\n/** A bounds provider that calculates the bounding box by taking the maximumg bounding box for a combination of skins and specific animation. */\nexport class SkinsAndAnimationBoundsProvider\n\timplements SpineGameObjectBoundsProvider {\n\t/**\n\t * @param animation The animation to use for calculating the bounds. If null, the setup pose is used.\n\t * @param skins The skins to use for calculating the bounds. If empty, the default skin is used.\n\t * @param timeStep The time step to use for calculating the bounds. A smaller time step means more precision, but slower calculation.\n\t * @param clipping If true, clipping attachments are used to compute the bounds. False, by default.\n\t */\n\tconstructor (\n\t\tprivate animation: string | null,\n\t\tprivate skins: string[] = [],\n\t\tprivate timeStep: number = 0.05,\n\t\tprivate clipping = false,\n\t) { }\n\n\tcalculateBounds (gameObject: SpineGameObject): {\n\t\tx: number;\n\t\ty: number;\n\t\twidth: number;\n\t\theight: number;\n\t} {\n\t\tif (!gameObject.skeleton || !gameObject.animationState)\n\t\t\treturn { x: 0, y: 0, width: 0, height: 0 };\n\t\t// Make a copy of animation state and skeleton as this might be called while\n\t\t// the skeleton in the GameObject has already been heavily modified. We can not\n\t\t// reconstruct that state.\n\t\tconst animationState = new AnimationState(gameObject.animationState.data);\n\t\tconst skeleton = new Skeleton(gameObject.skeleton.data);\n\t\tconst clipper = this.clipping ? new SkeletonClipping() : undefined;\n\t\tconst data = skeleton.data;\n\t\tif (this.skins.length > 0) {\n\t\t\tlet customSkin = new Skin(\"custom-skin\");\n\t\t\tfor (const skinName of this.skins) {\n\t\t\t\tconst skin = data.findSkin(skinName);\n\t\t\t\tif (skin == null) continue;\n\t\t\t\tcustomSkin.addSkin(skin);\n\t\t\t}\n\t\t\tskeleton.setSkin(customSkin);\n\t\t}\n\t\tskeleton.setToSetupPose();\n\n\t\tconst animation =\n\t\t\tthis.animation != null ? data.findAnimation(this.animation!) : null;\n\t\tif (animation == null) {\n\t\t\tskeleton.updateWorldTransform(Physics.update);\n\t\t\tconst bounds = skeleton.getBoundsRect(clipper);\n\t\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t\t: bounds;\n\t\t} else {\n\t\t\tlet minX = Number.POSITIVE_INFINITY,\n\t\t\t\tminY = Number.POSITIVE_INFINITY,\n\t\t\t\tmaxX = Number.NEGATIVE_INFINITY,\n\t\t\t\tmaxY = Number.NEGATIVE_INFINITY;\n\t\t\tanimationState.clearTracks();\n\t\t\tanimationState.setAnimationWith(0, animation, false);\n\t\t\tconst steps = Math.max(animation.duration / this.timeStep, 1.0);\n\t\t\tfor (let i = 0; i < steps; i++) {\n\t\t\t\tconst delta = i > 0 ? this.timeStep : 0;\n\t\t\t\tanimationState.update(delta);\n\t\t\t\tanimationState.apply(skeleton);\n\t\t\t\tskeleton.update(delta);\n\t\t\t\tskeleton.updateWorldTransform(Physics.update);\n\n\t\t\t\tconst bounds = skeleton.getBoundsRect(clipper);\n\t\t\t\tminX = Math.min(minX, bounds.x);\n\t\t\t\tminY = Math.min(minY, bounds.y);\n\t\t\t\tmaxX = Math.max(maxX, bounds.x + bounds.width);\n\t\t\t\tmaxY = Math.max(maxY, bounds.y + bounds.height);\n\t\t\t}\n\t\t\tconst bounds = {\n\t\t\t\tx: minX,\n\t\t\t\ty: minY,\n\t\t\t\twidth: maxX - minX,\n\t\t\t\theight: maxY - minY,\n\t\t\t};\n\t\t\treturn bounds.width == Number.NEGATIVE_INFINITY\n\t\t\t\t? { x: 0, y: 0, width: 0, height: 0 }\n\t\t\t\t: bounds;\n\t\t}\n\t}\n}\n\n/**\n * A SpineGameObject is a Phaser {@link GameObject} that can be added to a Phaser Scene and render a Spine skeleton.\n *\n * The Spine GameObject is a thin wrapper around a Spine {@link Skeleton}, {@link AnimationState} and {@link AnimationStateData}. It is responsible for:\n * - updating the animation state\n * - applying the animation state to the skeleton's bones, slots, attachments, and draw order.\n * - updating the skeleton's bone world transforms\n * - rendering the skeleton\n *\n * See the {@link SpinePlugin} class for more information on how to create a `SpineGameObject`.\n *\n * The skeleton, animation state, and animation state data can be accessed via the repsective fields. They can be manually updated via {@link updatePose}.\n *\n * To modify the bone hierarchy before the world transforms are computed, a callback can be set via the {@link beforeUpdateWorldTransforms} field.\n *\n * To modify the bone hierarchy after the world transforms are computed, a callback can be set via the {@link afterUpdateWorldTransforms} field.\n *\n * The class also features methods to convert between the skeleton coordinate system and the Phaser coordinate system.\n *\n * See {@link skeletonToPhaserWorldCoordinates}, {@link phaserWorldCoordinatesToSkeleton}, and {@link phaserWorldCoordinatesToBoneLocal.}\n */\nexport class SpineGameObject extends DepthMixin(\n\tOriginMixin(\n\t\tComputedSizeMixin(\n\t\t\tFlipMixin(\n\t\t\t\tScrollFactorMixin(\n\t\t\t\t\tTransformMixin(VisibleMixin(AlphaMixin(BaseSpineGameObject)))\n\t\t\t\t)\n\t\t\t)\n\t\t)\n\t)\n) {\n\tblendMode = -1;\n\tskeleton: Skeleton;\n\tanimationStateData: AnimationStateData;\n\tanimationState: AnimationState;\n\tbeforeUpdateWorldTransforms: (object: SpineGameObject) => void = () => { };\n\tafterUpdateWorldTransforms: (object: SpineGameObject) => void = () => { };\n\tprivate premultipliedAlpha = false;\n\n\tconstructor (\n\t\tscene: Phaser.Scene,\n\t\tprivate plugin: SpinePlugin,\n\t\tx: number,\n\t\ty: number,\n\t\tdataKey: string,\n\t\tatlasKey: string,\n\t\tpublic boundsProvider: SpineGameObjectBoundsProvider = new SetupPoseBoundsProvider()\n\t) {\n\t\tsuper(scene, (window as any).SPINE_GAME_OBJECT_TYPE ? (window as any).SPINE_GAME_OBJECT_TYPE : SPINE_GAME_OBJECT_TYPE);\n\t\tthis.setPosition(x, y);\n\n\t\tthis.premultipliedAlpha = this.plugin.isAtlasPremultiplied(atlasKey);\n\t\tthis.skeleton = this.plugin.createSkeleton(dataKey, atlasKey);\n\t\tthis.animationStateData = new AnimationStateData(this.skeleton.data);\n\t\tthis.animationState = new AnimationState(this.animationStateData);\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\t\tthis.updateSize();\n\t}\n\n\tupdateSize () {\n\t\tif (!this.skeleton) return;\n\t\tlet bounds = this.boundsProvider.calculateBounds(this);\n\t\t// For some reason the TS compiler and the ComputedSize mixin don't work well together and we have\n\t\t// to cast to any.\n\t\tlet self = this as any;\n\t\tself.width = bounds.width;\n\t\tself.height = bounds.height;\n\t\tthis.displayOriginX = -bounds.x;\n\t\tthis.displayOriginY = -bounds.y;\n\t}\n\n\t/** Converts a point from the skeleton coordinate system to the Phaser world coordinate system. */\n\tskeletonToPhaserWorldCoordinates (point: { x: number; y: number }) {\n\t\tlet transform = this.getWorldTransformMatrix();\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tlet x = point.x;\n\t\tlet y = point.y;\n\t\tpoint.x = x * a + y * c + tx;\n\t\tpoint.y = x * b + y * d + ty;\n\t}\n\n\t/** Converts a point from the Phaser world coordinate system to the skeleton coordinate system. */\n\tphaserWorldCoordinatesToSkeleton (point: { x: number; y: number }) {\n\t\tlet transform = this.getWorldTransformMatrix();\n\t\ttransform = transform.invert();\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tlet x = point.x;\n\t\tlet y = point.y;\n\t\tpoint.x = x * a + y * c + tx;\n\t\tpoint.y = x * b + y * d + ty;\n\t}\n\n\t/** Converts a point from the Phaser world coordinate system to the bone's local coordinate system. */\n\tphaserWorldCoordinatesToBone (point: { x: number; y: number }, bone: Bone) {\n\t\tthis.phaserWorldCoordinatesToSkeleton(point);\n\t\tif (bone.parent) {\n\t\t\tbone.parent.worldToLocal(point as Vector2);\n\t\t} else {\n\t\t\tbone.worldToLocal(point as Vector2);\n\t\t}\n\t}\n\n\t/**\n\t * Updates the {@link AnimationState}, applies it to the {@link Skeleton}, then updates the world transforms of all bones.\n\t * @param delta The time delta in milliseconds\n\t */\n\tupdatePose (delta: number) {\n\t\tthis.animationState.update(delta / 1000);\n\t\tthis.animationState.apply(this.skeleton);\n\t\tthis.beforeUpdateWorldTransforms(this);\n\t\tthis.skeleton.update(delta / 1000);\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\t\tthis.afterUpdateWorldTransforms(this);\n\t}\n\n\tpreUpdate (time: number, delta: number) {\n\t\tif (!this.skeleton || !this.animationState) return;\n\t\tthis.updatePose(delta);\n\t}\n\n\tpreDestroy () {\n\t\t// FIXME tear down any event emitters\n\t}\n\n\twillRender (camera: Phaser.Cameras.Scene2D.Camera) {\n\t\tvar GameObjectRenderMask = 0xf;\n\t\tvar result = !this.skeleton || !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && this.cameraFilter & camera.id));\n\t\tif (!this.visible) result = false;\n\n\t\tif (!result && this.parentContainer && this.plugin.webGLRenderer) {\n\t\t\tvar sceneRenderer = this.plugin.webGLRenderer;\n\n\t\t\tif (this.plugin.gl && this.plugin.phaserRenderer instanceof Phaser.Renderer.WebGL.WebGLRenderer && sceneRenderer.batcher.isDrawing) {\n\t\t\t\tsceneRenderer.end();\n\t\t\t\tthis.plugin.phaserRenderer.pipelines.rebind();\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\trenderWebGL (\n\t\trenderer: Phaser.Renderer.WebGL.WebGLRenderer,\n\t\tsrc: SpineGameObject,\n\t\tcamera: Phaser.Cameras.Scene2D.Camera,\n\t\tparentMatrix: Phaser.GameObjects.Components.TransformMatrix\n\t) {\n\t\tif (!this.skeleton || !this.animationState || !this.plugin.webGLRenderer)\n\t\t\treturn;\n\n\t\tlet sceneRenderer = this.plugin.webGLRenderer;\n\t\tif (renderer.newType) {\n\t\t\trenderer.pipelines.clear();\n\t\t\tsceneRenderer.begin();\n\t\t}\n\n\t\tcamera.addToRenderList(src);\n\t\tlet transform = Phaser.GameObjects.GetCalcMatrix(\n\t\t\tsrc,\n\t\t\tcamera,\n\t\t\tparentMatrix\n\t\t).calc;\n\t\tlet a = transform.a,\n\t\t\tb = transform.b,\n\t\t\tc = transform.c,\n\t\t\td = transform.d,\n\t\t\ttx = transform.tx,\n\t\t\tty = transform.ty;\n\t\tsceneRenderer.drawSkeleton(\n\t\t\tthis.skeleton,\n\t\t\tthis.premultipliedAlpha,\n\t\t\t-1,\n\t\t\t-1,\n\t\t\t(vertices, numVertices, stride) => {\n\t\t\t\tfor (let i = 0; i < numVertices; i += stride) {\n\t\t\t\t\tlet vx = vertices[i];\n\t\t\t\t\tlet vy = vertices[i + 1];\n\t\t\t\t\tvertices[i] = vx * a + vy * c + tx;\n\t\t\t\t\tvertices[i + 1] = vx * b + vy * d + ty;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tif (!renderer.nextTypeMatch) {\n\t\t\tsceneRenderer.end();\n\t\t\trenderer.pipelines.rebind();\n\t\t}\n\t}\n\n\trenderCanvas (\n\t\trenderer: Phaser.Renderer.Canvas.CanvasRenderer,\n\t\tsrc: SpineGameObject,\n\t\tcamera: Phaser.Cameras.Scene2D.Camera,\n\t\tparentMatrix: Phaser.GameObjects.Components.TransformMatrix\n\t) {\n\t\tif (!this.skeleton || !this.animationState || !this.plugin.canvasRenderer)\n\t\t\treturn;\n\n\t\tlet context = renderer.currentContext;\n\t\tlet skeletonRenderer = this.plugin.canvasRenderer;\n\t\t(skeletonRenderer as any).ctx = context;\n\n\t\tcamera.addToRenderList(src);\n\t\tlet transform = Phaser.GameObjects.GetCalcMatrix(\n\t\t\tsrc,\n\t\t\tcamera,\n\t\t\tparentMatrix\n\t\t).calc;\n\t\tlet skeleton = this.skeleton;\n\t\tskeleton.x = transform.tx;\n\t\tskeleton.y = transform.ty;\n\t\tskeleton.scaleX = transform.scaleX;\n\t\tskeleton.scaleY = transform.scaleY;\n\t\tlet root = skeleton.getRootBone()!;\n\t\troot.rotation = -MathUtils.radiansToDegrees * transform.rotationNormalized;\n\t\tthis.skeleton.updateWorldTransform(Physics.update);\n\n\t\tcontext.save();\n\t\tskeletonRenderer.draw(skeleton);\n\t\tcontext.restore();\n\t}\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Texture, TextureFilter, TextureWrap } from \"@esotericsoftware/spine-core\";\n\nexport class CanvasTexture extends Texture {\n\tconstructor (image: HTMLImageElement | ImageBitmap) {\n\t\tsuper(image);\n\t}\n\n\tsetFilters (minFilter: TextureFilter, magFilter: TextureFilter) { }\n\tsetWraps (uWrap: TextureWrap, vWrap: TextureWrap) { }\n\tdispose () { }\n}\n", "/******************************************************************************\n * Spine Runtimes License Agreement\n * Last updated July 28, 2023. Replaces all prior versions.\n *\n * Copyright (c) 2013-2023, Esoteric Software LLC\n *\n * Integration of the Spine Runtimes into software or otherwise creating\n * derivative works of the Spine Runtimes is permitted under the terms and\n * conditions of Section 2 of the Spine Editor License Agreement:\n * http://esotericsoftware.com/spine-editor-license\n *\n * Otherwise, it is permitted to integrate the Spine Runtimes into software or\n * otherwise create derivative works of the Spine Runtimes (collectively,\n * \"Products\"), provided that each user of the Products must obtain their own\n * Spine Editor license and redistribution of the Products in any form must\n * include this license and copyright notice.\n *\n * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC \"AS IS\" AND ANY\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY\n * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES,\n * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND\n * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE\n * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *****************************************************************************/\n\nimport { Utils, Color, Skeleton, RegionAttachment, BlendMode, MeshAttachment, Slot, TextureRegion, TextureAtlasRegion } from \"@esotericsoftware/spine-core\";\nimport { CanvasTexture } from \"./CanvasTexture.js\";\n\nconst worldVertices = Utils.newFloatArray(8);\n\nexport class SkeletonRenderer {\n\tstatic QUAD_TRIANGLES = [0, 1, 2, 2, 3, 0];\n\tstatic VERTEX_SIZE = 2 + 2 + 4;\n\n\tprivate ctx: CanvasRenderingContext2D;\n\n\tpublic triangleRendering = false;\n\tpublic debugRendering = false;\n\tprivate vertices = Utils.newFloatArray(8 * 1024);\n\tprivate tempColor = new Color();\n\n\tconstructor (context: CanvasRenderingContext2D) {\n\t\tthis.ctx = context;\n\t}\n\n\tdraw (skeleton: Skeleton) {\n\t\tif (this.triangleRendering) this.drawTriangles(skeleton);\n\t\telse this.drawImages(skeleton);\n\t}\n\n\tprivate drawImages (skeleton: Skeleton) {\n\t\tlet ctx = this.ctx;\n\t\tlet color = this.tempColor;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet drawOrder = skeleton.drawOrder;\n\n\t\tif (this.debugRendering) ctx.strokeStyle = \"green\";\n\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tlet bone = slot.bone;\n\t\t\tif (!bone.active) continue;\n\n\t\t\tlet attachment = slot.getAttachment();\n\t\t\tif (!(attachment instanceof RegionAttachment)) continue;\n\t\t\tattachment.computeWorldVertices(slot, worldVertices, 0, 2);\n\t\t\tlet region: TextureRegion = attachment.region;\n\n\t\t\tlet image: HTMLImageElement = (region.texture).getImage() as HTMLImageElement;\n\n\t\t\tlet slotColor = slot.color;\n\t\t\tlet regionColor = attachment.color;\n\t\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r,\n\t\t\t\tskeletonColor.g * slotColor.g * regionColor.g,\n\t\t\t\tskeletonColor.b * slotColor.b * regionColor.b,\n\t\t\t\tskeletonColor.a * slotColor.a * regionColor.a);\n\n\t\t\tctx.save();\n\t\t\tctx.transform(bone.a, bone.c, bone.b, bone.d, bone.worldX, bone.worldY);\n\t\t\tctx.translate(attachment.offset[0], attachment.offset[1]);\n\t\t\tctx.rotate(attachment.rotation * Math.PI / 180);\n\n\t\t\tlet atlasScale = attachment.width / region.originalWidth;\n\t\t\tctx.scale(atlasScale * attachment.scaleX, atlasScale * attachment.scaleY);\n\n\t\t\tlet w = region.width, h = region.height;\n\t\t\tctx.translate(w / 2, h / 2);\n\t\t\tif (attachment.region!.degrees == 90) {\n\t\t\t\tlet t = w;\n\t\t\t\tw = h;\n\t\t\t\th = t;\n\t\t\t\tctx.rotate(-Math.PI / 2);\n\t\t\t}\n\t\t\tctx.scale(1, -1);\n\t\t\tctx.translate(-w / 2, -h / 2);\n\n\t\t\tctx.globalAlpha = color.a;\n\t\t\tctx.drawImage(image, image.width * region.u, image.height * region.v, w, h, 0, 0, w, h);\n\t\t\tif (this.debugRendering) ctx.strokeRect(0, 0, w, h);\n\t\t\tctx.restore();\n\t\t}\n\t}\n\n\tprivate drawTriangles (skeleton: Skeleton) {\n\t\tlet ctx = this.ctx;\n\t\tlet color = this.tempColor;\n\t\tlet skeletonColor = skeleton.color;\n\t\tlet drawOrder = skeleton.drawOrder;\n\n\t\tlet blendMode: BlendMode | null = null;\n\t\tlet vertices: ArrayLike = this.vertices;\n\t\tlet triangles: Array | null = null;\n\n\t\tfor (let i = 0, n = drawOrder.length; i < n; i++) {\n\t\t\tlet slot = drawOrder[i];\n\t\t\tlet attachment = slot.getAttachment();\n\n\t\t\tlet texture: HTMLImageElement;\n\t\t\tlet region: TextureAtlasRegion;\n\t\t\tif (attachment instanceof RegionAttachment) {\n\t\t\t\tlet regionAttachment = attachment;\n\t\t\t\tvertices = this.computeRegionVertices(slot, regionAttachment, false);\n\t\t\t\ttriangles = SkeletonRenderer.QUAD_TRIANGLES;\n\t\t\t\ttexture = (regionAttachment.region!.texture).getImage() as HTMLImageElement;\n\t\t\t} else if (attachment instanceof MeshAttachment) {\n\t\t\t\tlet mesh = attachment;\n\t\t\t\tvertices = this.computeMeshVertices(slot, mesh, false);\n\t\t\t\ttriangles = mesh.triangles;\n\t\t\t\ttexture = (mesh.region!.texture).getImage() as HTMLImageElement;\n\t\t\t} else\n\t\t\t\tcontinue;\n\n\t\t\tif (texture) {\n\t\t\t\tif (slot.data.blendMode != blendMode) blendMode = slot.data.blendMode;\n\n\t\t\t\tlet slotColor = slot.color;\n\t\t\t\tlet attachmentColor = attachment.color;\n\t\t\t\tcolor.set(skeletonColor.r * slotColor.r * attachmentColor.r,\n\t\t\t\t\tskeletonColor.g * slotColor.g * attachmentColor.g,\n\t\t\t\t\tskeletonColor.b * slotColor.b * attachmentColor.b,\n\t\t\t\t\tskeletonColor.a * slotColor.a * attachmentColor.a);\n\n\t\t\t\tctx.globalAlpha = color.a;\n\n\t\t\t\tfor (var j = 0; j < triangles.length; j += 3) {\n\t\t\t\t\tlet t1 = triangles[j] * 8, t2 = triangles[j + 1] * 8, t3 = triangles[j + 2] * 8;\n\n\t\t\t\t\tlet x0 = vertices[t1], y0 = vertices[t1 + 1], u0 = vertices[t1 + 6], v0 = vertices[t1 + 7];\n\t\t\t\t\tlet x1 = vertices[t2], y1 = vertices[t2 + 1], u1 = vertices[t2 + 6], v1 = vertices[t2 + 7];\n\t\t\t\t\tlet x2 = vertices[t3], y2 = vertices[t3 + 1], u2 = vertices[t3 + 6], v2 = vertices[t3 + 7];\n\n\t\t\t\t\tthis.drawTriangle(texture, x0, y0, u0, v0, x1, y1, u1, v1, x2, y2, u2, v2);\n\n\t\t\t\t\tif (this.debugRendering) {\n\t\t\t\t\t\tctx.strokeStyle = \"green\";\n\t\t\t\t\t\tctx.beginPath();\n\t\t\t\t\t\tctx.moveTo(x0, y0);\n\t\t\t\t\t\tctx.lineTo(x1, y1);\n\t\t\t\t\t\tctx.lineTo(x2, y2);\n\t\t\t\t\t\tctx.lineTo(x0, y0);\n\t\t\t\t\t\tctx.stroke();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.ctx.globalAlpha = 1;\n\t}\n\n\t// Adapted from http://extremelysatisfactorytotalitarianism.com/blog/?p=2120\n\t// Apache 2 licensed\n\tprivate drawTriangle (img: HTMLImageElement, x0: number, y0: number, u0: number, v0: number,\n\t\tx1: number, y1: number, u1: number, v1: number,\n\t\tx2: number, y2: number, u2: number, v2: number) {\n\t\tlet ctx = this.ctx;\n\n\t\tconst width = img.width - 1;\n\t\tconst height = img.height - 1;\n\t\tu0 *= width;\n\t\tv0 *= height;\n\t\tu1 *= width;\n\t\tv1 *= height;\n\t\tu2 *= width;\n\t\tv2 *= height;\n\n\t\tctx.beginPath();\n\t\tctx.moveTo(x0, y0);\n\t\tctx.lineTo(x1, y1);\n\t\tctx.lineTo(x2, y2);\n\t\tctx.closePath();\n\n\t\tx1 -= x0;\n\t\ty1 -= y0;\n\t\tx2 -= x0;\n\t\ty2 -= y0;\n\n\t\tu1 -= u0;\n\t\tv1 -= v0;\n\t\tu2 -= u0;\n\t\tv2 -= v0;\n\n\t\tlet det = u1 * v2 - u2 * v1;\n\t\tif (det == 0) return;\n\t\tdet = 1 / det;\n\n\t\t// linear transformation\n\t\tconst a = (v2 * x1 - v1 * x2) * det;\n\t\tconst b = (v2 * y1 - v1 * y2) * det;\n\t\tconst c = (u1 * x2 - u2 * x1) * det;\n\t\tconst d = (u1 * y2 - u2 * y1) * det;\n\n\t\t// translation\n\t\tconst e = x0 - a * u0 - c * v0;\n\t\tconst f = y0 - b * u0 - d * v0;\n\n\t\tctx.save();\n\t\tctx.transform(a, b, c, d, e, f);\n\t\tctx.clip();\n\t\tctx.drawImage(img, 0, 0);\n\t\tctx.restore();\n\t}\n\n\tprivate computeRegionVertices (slot: Slot, region: RegionAttachment, pma: boolean) {\n\t\tlet skeletonColor = slot.bone.skeleton.color;\n\t\tlet slotColor = slot.color;\n\t\tlet regionColor = region.color;\n\t\tlet alpha = skeletonColor.a * slotColor.a * regionColor.a;\n\t\tlet multiplier = pma ? alpha : 1;\n\t\tlet color = this.tempColor;\n\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier,\n\t\t\tskeletonColor.g * slotColor.g * regionColor.g * multiplier,\n\t\t\tskeletonColor.b * slotColor.b * regionColor.b * multiplier,\n\t\t\talpha);\n\n\t\tregion.computeWorldVertices(slot, this.vertices, 0, SkeletonRenderer.VERTEX_SIZE);\n\n\t\tlet vertices = this.vertices;\n\t\tlet uvs = region.uvs;\n\n\t\tvertices[RegionAttachment.C1R] = color.r;\n\t\tvertices[RegionAttachment.C1G] = color.g;\n\t\tvertices[RegionAttachment.C1B] = color.b;\n\t\tvertices[RegionAttachment.C1A] = color.a;\n\t\tvertices[RegionAttachment.U1] = uvs[0];\n\t\tvertices[RegionAttachment.V1] = uvs[1];\n\n\t\tvertices[RegionAttachment.C2R] = color.r;\n\t\tvertices[RegionAttachment.C2G] = color.g;\n\t\tvertices[RegionAttachment.C2B] = color.b;\n\t\tvertices[RegionAttachment.C2A] = color.a;\n\t\tvertices[RegionAttachment.U2] = uvs[2];\n\t\tvertices[RegionAttachment.V2] = uvs[3];\n\n\t\tvertices[RegionAttachment.C3R] = color.r;\n\t\tvertices[RegionAttachment.C3G] = color.g;\n\t\tvertices[RegionAttachment.C3B] = color.b;\n\t\tvertices[RegionAttachment.C3A] = color.a;\n\t\tvertices[RegionAttachment.U3] = uvs[4];\n\t\tvertices[RegionAttachment.V3] = uvs[5];\n\n\t\tvertices[RegionAttachment.C4R] = color.r;\n\t\tvertices[RegionAttachment.C4G] = color.g;\n\t\tvertices[RegionAttachment.C4B] = color.b;\n\t\tvertices[RegionAttachment.C4A] = color.a;\n\t\tvertices[RegionAttachment.U4] = uvs[6];\n\t\tvertices[RegionAttachment.V4] = uvs[7];\n\n\t\treturn vertices;\n\t}\n\n\tprivate computeMeshVertices (slot: Slot, mesh: MeshAttachment, pma: boolean) {\n\t\tlet skeletonColor = slot.bone.skeleton.color;\n\t\tlet slotColor = slot.color;\n\t\tlet regionColor = mesh.color;\n\t\tlet alpha = skeletonColor.a * slotColor.a * regionColor.a;\n\t\tlet multiplier = pma ? alpha : 1;\n\t\tlet color = this.tempColor;\n\t\tcolor.set(skeletonColor.r * slotColor.r * regionColor.r * multiplier,\n\t\t\tskeletonColor.g * slotColor.g * regionColor.g * multiplier,\n\t\t\tskeletonColor.b * slotColor.b * regionColor.b * multiplier,\n\t\t\talpha);\n\n\t\tlet vertexCount = mesh.worldVerticesLength / 2;\n\t\tlet vertices = this.vertices;\n\t\tif (vertices.length < mesh.worldVerticesLength) this.vertices = vertices = Utils.newFloatArray(mesh.worldVerticesLength);\n\t\tmesh.computeWorldVertices(slot, 0, mesh.worldVerticesLength, vertices, 0, SkeletonRenderer.VERTEX_SIZE);\n\n\t\tlet uvs = mesh.uvs;\n\t\tfor (let i = 0, u = 0, v = 2; i < vertexCount; i++) {\n\t\t\tvertices[v++] = color.r;\n\t\t\tvertices[v++] = color.g;\n\t\t\tvertices[v++] = color.b;\n\t\t\tvertices[v++] = color.a;\n\t\t\tvertices[v++] = uvs[u++];\n\t\t\tvertices[v++] = uvs[u++];\n\t\t\tv += 2;\n\t\t}\n\n\t\treturn vertices;\n\t}\n}\n"], - "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAAA;AAAA,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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"i", "n", "timeline", "EventType", "TextureFilter", "TextureWrap", "page", "worldVertices", "worldVertices", "Inherit", "s", "PositionMode", "SpacingMode", "RotateMode", "closed", "pathLength", "multiplier", "Physics", "BlendMode", "closed", "AttachmentType", "n", "LinkedMesh", "readTimeline1", "readTimeline2", "timeline", "Matrix4", "Matrix4", "VertexAttributeType", "temp", "ShapeType", "i", "n", "n", "ResizeMode", "bounds", "_SkeletonRenderer", "SkeletonRenderer", "SkeletonRenderer", "SpineSkeletonDataFileType"] -} diff --git a/spine-ts/spine-phaser-v3/dist/index.d.ts b/spine-ts/spine-phaser-v3/dist/index.d.ts deleted file mode 100644 index f4f58dede..000000000 --- a/spine-ts/spine-phaser-v3/dist/index.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -export * from "./require-shim.js"; -export * from "./SpinePlugin.js"; -export * from "./SpineGameObject.js"; -export * from "./mixins.js"; -export * from "@esotericsoftware/spine-core"; -export * from "@esotericsoftware/spine-webgl"; -import { SpineGameObjectConfig, SpinePlugin } from "./SpinePlugin.js"; -import { SpineGameObject, SpineGameObjectBoundsProvider } from "./SpineGameObject.js"; -declare global { - namespace Phaser.Loader { - interface LoaderPlugin { - spineJson(key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; - spineBinary(key: string, url: string, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; - spineAtlas(key: string, url: string, premultipliedAlpha?: boolean, xhrSettings?: Phaser.Types.Loader.XHRSettingsObject): LoaderPlugin; - } - } - namespace Phaser.GameObjects { - interface GameObjectFactory { - spine(x: number, y: number, dataKey: string, atlasKey: string, boundsProvider?: SpineGameObjectBoundsProvider): SpineGameObject; - } - interface GameObjectCreator { - spine(config: SpineGameObjectConfig, addToScene?: boolean): SpineGameObject; - } - } - namespace Phaser { - interface Scene { - spine: SpinePlugin; - } - } -} diff --git a/spine-ts/spine-phaser-v3/dist/index.js b/spine-ts/spine-phaser-v3/dist/index.js deleted file mode 100644 index e82948b73..000000000 --- a/spine-ts/spine-phaser-v3/dist/index.js +++ /dev/null @@ -1,38 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -export * from "./require-shim.js"; -export * from "./SpinePlugin.js"; -export * from "./SpineGameObject.js"; -export * from "./mixins.js"; -export * from "@esotericsoftware/spine-core"; -export * from "@esotericsoftware/spine-webgl"; -import { SpinePlugin } from "./SpinePlugin.js"; -window.spine = { SpinePlugin: SpinePlugin }; -window["spine.SpinePlugin"] = SpinePlugin; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs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jdEJvdW5kc1Byb3ZpZGVyKTogU3BpbmVHYW1lT2JqZWN0O1xuXHRcdH1cblxuXHRcdGV4cG9ydCBpbnRlcmZhY2UgR2FtZU9iamVjdENyZWF0b3Ige1xuXHRcdFx0c3BpbmUgKGNvbmZpZzogU3BpbmVHYW1lT2JqZWN0Q29uZmlnLCBhZGRUb1NjZW5lPzogYm9vbGVhbik6IFNwaW5lR2FtZU9iamVjdDtcblx0XHR9XG5cdH1cblxuXHRuYW1lc3BhY2UgUGhhc2VyIHtcblx0XHRleHBvcnQgaW50ZXJmYWNlIFNjZW5lIHtcblx0XHRcdHNwaW5lOiBTcGluZVBsdWdpbjtcblx0XHR9XG5cdH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/spine-ts/spine-phaser-v3/dist/keys.d.ts b/spine-ts/spine-phaser-v3/dist/keys.d.ts deleted file mode 100644 index d5ad39375..000000000 --- a/spine-ts/spine-phaser-v3/dist/keys.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -export declare const SPINE_SKELETON_FILE_CACHE_KEY = "esotericsoftware.spine.skeletonFile.cache"; -export declare const SPINE_ATLAS_CACHE_KEY = "esotericsoftware.spine.atlas.cache"; -export declare const SPINE_LOADER_TYPE = "spine"; -export declare const SPINE_SKELETON_DATA_FILE_TYPE = "spineSkeletonData"; -export declare const SPINE_ATLAS_FILE_TYPE = "spineAtlasData"; -export declare const SPINE_GAME_OBJECT_TYPE = "spine"; diff --git a/spine-ts/spine-phaser-v3/dist/keys.js b/spine-ts/spine-phaser-v3/dist/keys.js deleted file mode 100644 index 2744dfb34..000000000 --- a/spine-ts/spine-phaser-v3/dist/keys.js +++ /dev/null @@ -1,35 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -export const SPINE_SKELETON_FILE_CACHE_KEY = "esotericsoftware.spine.skeletonFile.cache"; -export const SPINE_ATLAS_CACHE_KEY = "esotericsoftware.spine.atlas.cache"; -export const SPINE_LOADER_TYPE = "spine"; -export const SPINE_SKELETON_DATA_FILE_TYPE = "spineSkeletonData"; -export const SPINE_ATLAS_FILE_TYPE = "spineAtlasData"; -export const SPINE_GAME_OBJECT_TYPE = "spine"; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5cy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9rZXlzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7K0VBMkIrRTtBQUUvRSxNQUFNLENBQUMsTUFBTSw2QkFBNkIsR0FBRywyQ0FBMkMsQ0FBQztBQUN6RixNQUFNLENBQUMsTUFBTSxxQkFBcUIsR0FBRyxvQ0FBb0MsQ0FBQztBQUMxR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ICogT04gQU5ZIFRIRU9SWSBPRiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQ09OVFJBQ1QsIFNUUklDVCBMSUFCSUxJVFksIE9SIFRPUlRcbiAqIChJTkNMVURJTkcgTkVHTElHRU5DRSBPUiBPVEhFUldJU0UpIEFSSVNJTkcgSU4gQU5ZIFdBWSBPVVQgT0YgVEhFIFVTRSBPRiBUSEVcbiAqIFNQSU5FIFJVTlRJTUVTLCBFVkVOIElGIEFEVklTRUQgT0YgVEhFIFBPU1NJQklMSVRZIE9GIFNVQ0ggREFNQUdFLlxuICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqL1xuXG5leHBvcnQgY29uc3QgU1BJTkVfU0tFTEVUT05fRklMRV9DQUNIRV9LRVkgPSBcImVzb3Rlcmljc29mdHdhcmUuc3BpbmUuc2tlbGV0b25GaWxlLmNhY2hlXCI7XG5leHBvcnQgY29uc3QgU1BJTkVfQVRMQVNfQ0FDSEVfS0VZID0gXCJlc290ZXJpY3NvZnR3YXJlLnNwaW5lLmF0bGFzLmNhY2hlXCI7XG5leHBvcnQgY29uc3QgU1BJTkVfTE9BREVSX1RZUEUgPSBcInNwaW5lXCI7XG5leHBvcnQgY29uc3QgU1BJTkVfU0tFTEVUT05fREFUQV9GSUxFX1RZUEUgPSBcInNwaW5lU2tlbGV0b25EYXRhXCI7XG5leHBvcnQgY29uc3QgU1BJTkVfQVRMQVNfRklMRV9UWVBFID0gXCJzcGluZUF0bGFzRGF0YVwiO1xuZXhwb3J0IGNvbnN0IFNQSU5FX0dBTUVfT0JKRUNUX1RZUEUgPSBcInNwaW5lXCI7XG4iXX0= \ No newline at end of file diff --git a/spine-ts/spine-phaser-v3/dist/mixins.d.ts b/spine-ts/spine-phaser-v3/dist/mixins.d.ts deleted file mode 100644 index a845fb3ab..000000000 --- a/spine-ts/spine-phaser-v3/dist/mixins.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export declare const ComputedSize: any; -export declare const Depth: any; -export declare const Flip: any; -export declare const ScrollFactor: any; -export declare const Transform: any; -export declare const Visible: any; -export declare const Origin: any; -export declare const Alpha: any; -export interface Type extends Function { - new (...args: P): T; -} -export type Mixin = >(BaseGameObject: GameObjectType) => GameObjectType & Type; -export declare function createMixin(...component: GameObjectComponent[]): Mixin; -type ComputedSizeMixin = Mixin; -export declare const ComputedSizeMixin: ComputedSizeMixin; -type DepthMixin = Mixin; -export declare const DepthMixin: DepthMixin; -type FlipMixin = Mixin; -export declare const FlipMixin: FlipMixin; -type ScrollFactorMixin = Mixin; -export declare const ScrollFactorMixin: ScrollFactorMixin; -type TransformMixin = Mixin; -export declare const TransformMixin: TransformMixin; -type VisibleMixin = Mixin; -export declare const VisibleMixin: VisibleMixin; -type OriginMixin = Mixin; -export declare const OriginMixin: OriginMixin; -type AlphaMixin = Mixin; -export declare const AlphaMixin: AlphaMixin; -export {}; diff --git a/spine-ts/spine-phaser-v3/dist/mixins.js b/spine-ts/spine-phaser-v3/dist/mixins.js deleted file mode 100644 index 2a8bce6c4..000000000 --- a/spine-ts/spine-phaser-v3/dist/mixins.js +++ /dev/null @@ -1,48 +0,0 @@ -/* -The MIT License (MIT) - -Copyright (c) 2021-present AgogPixel - -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. -*/ -// Adapted from https://github.com/agogpixel/phaser3-ts-utils/tree/main -let components = Phaser.GameObjects.Components; -export const ComputedSize = components.ComputedSize; -export const Depth = components.Depth; -export const Flip = components.Flip; -export const ScrollFactor = components.ScrollFactor; -export const Transform = components.Transform; -export const Visible = components.Visible; -export const Origin = components.Origin; -export const Alpha = components.Alpha; -export function createMixin(...component) { - return (BaseGameObject) => { - Phaser.Class.mixin(BaseGameObject, component); - return BaseGameObject; - }; -} -export const ComputedSizeMixin = createMixin(ComputedSize); -export const DepthMixin = createMixin(Depth); -export const FlipMixin = createMixin(Flip); -export const ScrollFactorMixin = createMixin(ScrollFactor); -export const TransformMixin = createMixin(Transform); -export const VisibleMixin = createMixin(Visible); -export const OriginMixin = createMixin(Origin); -export const AlphaMixin = createMixin(Alpha); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWl4aW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL21peGlucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztFQXNCRTtBQUVGLHVFQUF1RTtBQUV2RSxJQUFJLFVBQVUsR0FBSSxNQUFNLENBQUMsV0FBVyxDQUFDLFVBQWtCLENBQUM7QUFDeEQsTUFBTSxDQUFDLE1BQU0sWUFBWSxHQUFHLFVBQVUsQ0FBQyxZQUFZLENBQUM7QUFDcEQsTUFBTSxDQUFDLE1BQU0sS0FBSyxHQUFHLFVBQVUsQ0FBQyxLQUFLLENBQUM7QUFDdEMsTUFBTSxDQUFDLE1BQU0sSUFBSSxHQUFHLFVBQVUsQ0FBQyxJQUFJLENBQUM7QUFDcEMs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WVPYmplY3Q+O1xuZXhwb3J0IGNvbnN0IEFscGhhTWl4aW46IEFscGhhTWl4aW4gPSBjcmVhdGVNaXhpbjxQaGFzZXIuR2FtZU9iamVjdHMuQ29tcG9uZW50cy5BbHBoYT4oQWxwaGEpOyJdfQ== \ No newline at end of file diff --git a/spine-ts/spine-phaser-v3/dist/require-shim.d.ts b/spine-ts/spine-phaser-v3/dist/require-shim.d.ts deleted file mode 100644 index f0e80f395..000000000 --- a/spine-ts/spine-phaser-v3/dist/require-shim.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -declare global { - var require: any; -} -export {}; diff --git a/spine-ts/spine-phaser-v3/dist/require-shim.js b/spine-ts/spine-phaser-v3/dist/require-shim.js deleted file mode 100644 index 1b9d3dfda..000000000 --- a/spine-ts/spine-phaser-v3/dist/require-shim.js +++ /dev/null @@ -1,39 +0,0 @@ -/****************************************************************************** - * Spine Runtimes License Agreement - * Last updated July 28, 2023. Replaces all prior versions. - * - * Copyright (c) 2013-2023, Esoteric Software LLC - * - * Integration of the Spine Runtimes into software or otherwise creating - * derivative works of the Spine Runtimes is permitted under the terms and - * conditions of Section 2 of the Spine Editor License Agreement: - * http://esotericsoftware.com/spine-editor-license - * - * Otherwise, it is permitted to integrate the Spine Runtimes into software or - * otherwise create derivative works of the Spine Runtimes (collectively, - * "Products"), provided that each user of the Products must obtain their own - * Spine Editor license and redistribution of the Products in any form must - * include this license and copyright notice. - * - * THE SPINE RUNTIMES ARE PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, - * BUSINESS INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THE - * SPINE RUNTIMES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ -if (typeof window !== 'undefined' && window.Phaser) { - let prevRequire = window.require; - window.require = (x) => { - if (prevRequire) - return prevRequire(x); - else if (x === "Phaser") - return window.Phaser; - }; -} -export {}; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWlyZS1zaGltLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3JlcXVpcmUtc2hpbS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OytFQTJCK0U7QUFLL0UsSUFBSSxPQUFPLE1BQU0sS0FBSyxXQUFXLElBQUksTUFBTSxDQUFDLE1BQU0sRUFBRSxDQUFDO0lBQ3BELElBQUksV0FBVyxHQUFHLE1BQU0sQ0FBQyxPQUFPLENBQUM7SUFDakMsTUFBTSxDQUFDLE9BQU8sR0FBRyxDQUFDLENBQVMsRUFBRSxFQUFFO1FBQzlCLElBQUksV0FBVztZQUFFLE9BQU8sV0FBVyxDQUFDLENBQUMsQ0FBQyxDQUFDO2FBQ2xDLElBQUksQ0FBQyxLQUFLLFFBQVE7WUFBRSxPQUFPLE1BQU0sQ0FBQyxNQUFNLENBQUM7SUFDL0MsQ0FBQyxDQUFBO0FBQ0YsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipcbiAqIFNwaW5lIFJ1bnRpbWVzIExpY2Vuc2UgQWdyZWVtZW50XG4gKiBMYXN0IHVwZGF0ZWQgSnVseSAyOCwgMjAyMy4gUmVwbGFjZXMgYWxsIHByaW9yIHZlcnNpb25zLlxuICpcbiAqIENvcHlyaWdodCAoYykgMjAxMy0yMDIzLCBFc290ZX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