@tawaship/pixi-animate-runtime 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"pixi-animate-runtime.esm.js","sources":["../src/player/events.ts","../src/player/transform.ts","../src/player/geom.ts","../src/player/display.ts","../src/player/movieclip.ts","../src/player/objects.ts","../src/player/semver.ts","../src/player/version.ts","../src/player/ease.ts","../src/player/data.ts","../src/player/content.ts","../src/player/animate-container.ts","../src/player/loader.ts"],"sourcesContent":["/**\n * createjs-compatible events: Event and EventDispatcher, with the capture,\n * target and bubble phases createjs dispatches through the parent chain.\n */\n\nexport interface IEventHandlerObject {\n\thandleEvent(event: Event): void;\n}\n\n/** Data passed to a listener added with on() */\nexport type TEventData = string | number | boolean | object | null | undefined;\n\nexport type TEventListener = ((event: Event, data?: TEventData) => void) | IEventHandlerObject;\n\ninterface IListenerMap {\n\t[type: string]: TEventListener[];\n}\n\nexport class Event {\n\ttype: string;\n\ttarget: EventDispatcher | null = null;\n\tcurrentTarget: EventDispatcher | null = null;\n\teventPhase = 0;\n\tbubbles: boolean;\n\tcancelable: boolean;\n\ttimeStamp: number;\n\tdefaultPrevented = false;\n\tpropagationStopped = false;\n\timmediatePropagationStopped = false;\n\tremoved = false;\n\t/** Time since the last tick, for tick events (createjs Ticker events carry it) */\n\tdelta: number | undefined;\n\tpaused: boolean | undefined;\n\n\tconstructor(type: string, bubbles?: boolean, cancelable?: boolean) {\n\t\tthis.type = type;\n\t\tthis.bubbles = !!bubbles;\n\t\tthis.cancelable = !!cancelable;\n\t\tthis.timeStamp = Date.now();\n\t}\n\n\tpreventDefault(): void {\n\t\tthis.defaultPrevented = this.cancelable;\n\t}\n\n\tstopPropagation(): void {\n\t\tthis.propagationStopped = true;\n\t}\n\n\tstopImmediatePropagation(): void {\n\t\tthis.immediatePropagationStopped = this.propagationStopped = true;\n\t}\n\n\tremove(): void {\n\t\tthis.removed = true;\n\t}\n\n\tclone(): Event {\n\t\treturn new Event(this.type, this.bubbles, this.cancelable);\n\t}\n\n\tset(props: { [key: string]: string | number | boolean | null }): Event {\n\t\tObject.keys(props).forEach(key => {\n\t\t\tReflect.set(this, key, props[key]);\n\t\t});\n\t\treturn this;\n\t}\n\n\ttoString(): string {\n\t\treturn '[Event (type=' + this.type + ')]';\n\t}\n}\n\nfunction callListener(listener: TEventListener, event: Event): void {\n\t// As createjs: an object with handleEvent is called through it, anything else directly\n\tif (typeof listener !== 'function') {\n\t\tlistener.handleEvent(event);\n\t} else {\n\t\tlistener(event);\n\t}\n}\n\nexport class EventDispatcher {\n\t_listeners: IListenerMap | null = null;\n\t_captureListeners: IListenerMap | null = null;\n\n\t/** The parent the bubble and capture phases walk through (a display object's parent) */\n\tget _eventParent(): EventDispatcher | null {\n\t\treturn null;\n\t}\n\n\taddEventListener(type: string, listener: TEventListener, useCapture?: boolean): TEventListener {\n\t\tlet listeners: IListenerMap | null = useCapture ? this._captureListeners : this._listeners;\n\t\tif (!listeners) {\n\t\t\tlisteners = {};\n\t\t\tif (useCapture) {\n\t\t\t\tthis._captureListeners = listeners;\n\t\t\t} else {\n\t\t\t\tthis._listeners = listeners;\n\t\t\t}\n\t\t}\n\n\t\tconst list = listeners[type];\n\t\tif (list) {\n\t\t\tthis.removeEventListener(type, listener, useCapture);\n\t\t\t// Removing may have dropped the list\n\t\t\tconst again = listeners[type];\n\t\t\tif (again) {\n\t\t\t\tagain.push(listener);\n\t\t\t} else {\n\t\t\t\tlisteners[type] = [listener];\n\t\t\t}\n\t\t} else {\n\t\t\tlisteners[type] = [listener];\n\t\t}\n\t\treturn listener;\n\t}\n\n\ton(type: string, listener: TEventListener, scope?: object, once?: boolean, data?: TEventData, useCapture?: boolean): TEventListener {\n\t\tconst owner = typeof listener === 'function' ? (scope || this) : (scope || listener);\n\t\tconst wrapper = function (event: Event): void {\n\t\t\tif (typeof listener === 'function') {\n\t\t\t\tlistener.call(owner, event, data);\n\t\t\t} else {\n\t\t\t\tlistener.handleEvent.call(owner, event);\n\t\t\t}\n\t\t\tif (once) {\n\t\t\t\tevent.remove();\n\t\t\t}\n\t\t};\n\t\treturn this.addEventListener(type, wrapper, useCapture);\n\t}\n\n\tremoveEventListener(type: string, listener: TEventListener, useCapture?: boolean): void {\n\t\tconst listeners = useCapture ? this._captureListeners : this._listeners;\n\t\tif (!listeners) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst list = listeners[type];\n\t\tif (!list) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = 0, l = list.length; i < l; i++) {\n\t\t\tif (list[i] === listener) {\n\t\t\t\tif (l === 1) {\n\t\t\t\t\tdelete listeners[type];\n\t\t\t\t} else {\n\t\t\t\t\tlist.splice(i, 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\toff(type: string, listener: TEventListener, useCapture?: boolean): void {\n\t\tthis.removeEventListener(type, listener, useCapture);\n\t}\n\n\tremoveAllEventListeners(type?: string): void {\n\t\tif (!type) {\n\t\t\tthis._listeners = this._captureListeners = null;\n\t\t\treturn;\n\t\t}\n\t\tif (this._listeners) {\n\t\t\tdelete this._listeners[type];\n\t\t}\n\t\tif (this._captureListeners) {\n\t\t\tdelete this._captureListeners[type];\n\t\t}\n\t}\n\n\tdispatchEvent(eventOrType: Event | string, bubbles?: boolean, cancelable?: boolean): boolean {\n\t\tlet event: Event;\n\t\tif (typeof eventOrType === 'string') {\n\t\t\tconst listeners = this._listeners;\n\t\t\tif (!bubbles && (!listeners || !listeners[eventOrType])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tevent = new Event(eventOrType, bubbles, cancelable);\n\t\t} else {\n\t\t\t// An event that has been dispatched already is dispatched as a copy\n\t\t\tevent = eventOrType.target ? eventOrType.clone() : eventOrType;\n\t\t}\n\n\t\tevent.target = this;\n\n\t\tif (!event.bubbles || !this._eventParent) {\n\t\t\tthis._dispatchEvent(event, 2);\n\t\t} else {\n\t\t\tconst chain: EventDispatcher[] = [];\n\t\t\tfor (let top: EventDispatcher | null = this; top; top = top._eventParent) {\n\t\t\t\tchain.push(top);\n\t\t\t}\n\n\t\t\t// Capture phase, from the top down to the target's parent\n\t\t\tfor (let i = chain.length - 1; i >= 0 && !event.propagationStopped; i--) {\n\t\t\t\tchain[i]._dispatchEvent(event, 1 + (i === 0 ? 1 : 0));\n\t\t\t}\n\t\t\t// Bubble phase, from the target's parent up\n\t\t\tfor (let i = 1; i < chain.length && !event.propagationStopped; i++) {\n\t\t\t\tchain[i]._dispatchEvent(event, 3);\n\t\t\t}\n\t\t}\n\n\t\treturn !event.defaultPrevented;\n\t}\n\n\thasEventListener(type: string): boolean {\n\t\tconst listeners = this._listeners;\n\t\tconst capture = this._captureListeners;\n\t\treturn !!((listeners && listeners[type]) || (capture && capture[type]));\n\t}\n\n\twillTrigger(type: string): boolean {\n\t\tfor (let o: EventDispatcher | null = this; o; o = o._eventParent) {\n\t\t\tif (o.hasEventListener(type)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Phase 1 is capture, 2 the target, 3 bubbling. At the target, the capture\n\t * listeners run first and then the others (createjs runs the target phase\n\t * twice, the second time as phase 2.1, which reads the non-capture listeners).\n\t */\n\t_dispatchEvent(event: Event, phase: number): void {\n\t\tconst map = phase <= 2 ? this._captureListeners : this._listeners;\n\t\tconst found = map ? map[event.type] : undefined;\n\t\tif (found && found.length) {\n\t\t\tconst list = found.slice();\n\t\t\tevent.currentTarget = this;\n\t\t\tevent.eventPhase = phase | 0;\n\t\t\tevent.removed = false;\n\n\t\t\tfor (let i = 0; i < list.length && !event.immediatePropagationStopped; i++) {\n\t\t\t\tconst listener = list[i];\n\t\t\t\tcallListener(listener, event);\n\t\t\t\tif (event.removed) {\n\t\t\t\t\tthis.off(event.type, listener, phase === 1);\n\t\t\t\t\tevent.removed = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (phase === 2) {\n\t\t\tthis._dispatchEvent(event, 2.1);\n\t\t}\n\t}\n}\n","import * as PIXI from 'pixi.js';\n\nconst DEG_TO_RAD = Math.PI / 180;\nconst RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * A Pixi Transform whose rotation and skew follow createjs.\n *\n * - The createjs values (degrees) are kept as written, so that reading them\n * back gives exactly what was written (a degrees -> radians -> degrees round\n * trip does not)\n * - Pixi's own fields carry the same values in Pixi's terms (rotation in\n * radians, skew.x = -skewX, skew.y = skewY, all in radians), so code that\n * uses the Pixi node sees consistent values. A write made through Pixi\n * (node.rotation, node.skew) is taken over as the new createjs value\n * - The local matrix is built the createjs way: skew x (rotation x scale),\n * i.e. the object is rotated first and then skewed. Pixi composes rotation\n * and skew the other way round (skewed, then rotated as a whole); the two\n * agree only while the rotation is 0 or skewX equals skewY. Published\n * content is the reference, so createjs's composition is used\n */\nexport class CjsTransform extends PIXI.Transform {\n\t/** createjs rotation, in degrees */\n\tdegRotation = 0;\n\t/** createjs skewX / skewY, in degrees */\n\tdegSkewX = 0;\n\tdegSkewY = 0;\n\n\t/** The radians last written to the Pixi fields for the values above */\n\tprivate _radRotation = 0;\n\tprivate _radSkewX = 0;\n\tprivate _radSkewY = 0;\n\n\tsetRotation(degrees: number): void {\n\t\tthis.degRotation = degrees;\n\t\tthis._radRotation = degrees * DEG_TO_RAD;\n\t\tif (this._rotation !== this._radRotation) {\n\t\t\tthis._rotation = this._radRotation;\n\t\t}\n\t\tthis.updateSkew();\n\t}\n\n\tsetSkewX(degrees: number): void {\n\t\tthis.degSkewX = degrees;\n\t\tthis._radSkewX = -degrees * DEG_TO_RAD;\n\t\t// Setting the point calls updateSkew when the value changes\n\t\tthis.skew.x = this._radSkewX;\n\t\tthis.updateSkew();\n\t}\n\n\tsetSkewY(degrees: number): void {\n\t\tthis.degSkewY = degrees;\n\t\tthis._radSkewY = degrees * DEG_TO_RAD;\n\t\tthis.skew.y = this._radSkewY;\n\t\tthis.updateSkew();\n\t}\n\n\tprotected updateSkew(): void {\n\t\t// Values written through Pixi become the createjs values\n\t\tif (this._rotation !== this._radRotation) {\n\t\t\tthis._radRotation = this._rotation;\n\t\t\tthis.degRotation = this._rotation * RAD_TO_DEG;\n\t\t}\n\t\tif (this.skew.x !== this._radSkewX) {\n\t\t\tthis._radSkewX = this.skew.x;\n\t\t\tthis.degSkewX = -this.skew.x * RAD_TO_DEG;\n\t\t}\n\t\tif (this.skew.y !== this._radSkewY) {\n\t\t\tthis._radSkewY = this.skew.y;\n\t\t\tthis.degSkewY = this.skew.y * RAD_TO_DEG;\n\t\t}\n\n\t\t// createjs Matrix2D.appendTransform: (skew) x (rotation, scale)\n\t\tlet cos = 1;\n\t\tlet sin = 0;\n\t\tif (this.degRotation % 360) {\n\t\t\tconst r = this.degRotation * DEG_TO_RAD;\n\t\t\tcos = Math.cos(r);\n\t\t\tsin = Math.sin(r);\n\t\t}\n\n\t\tif (this.degSkewX || this.degSkewY) {\n\t\t\tconst skewX = this.degSkewX * DEG_TO_RAD;\n\t\t\tconst skewY = this.degSkewY * DEG_TO_RAD;\n\t\t\tconst a1 = Math.cos(skewY);\n\t\t\tconst b1 = Math.sin(skewY);\n\t\t\tconst c1 = -Math.sin(skewX);\n\t\t\tconst d1 = Math.cos(skewX);\n\t\t\tthis._cx = a1 * cos + c1 * sin;\n\t\t\tthis._sx = b1 * cos + d1 * sin;\n\t\t\tthis._cy = a1 * -sin + c1 * cos;\n\t\t\tthis._sy = b1 * -sin + d1 * cos;\n\t\t} else {\n\t\t\tthis._cx = cos;\n\t\t\tthis._sx = sin;\n\t\t\tthis._cy = -sin;\n\t\t\tthis._sy = cos;\n\t\t}\n\n\t\tthis._localID++;\n\t}\n}\n","import * as PIXI from 'pixi.js';\n\n/**\n * createjs-compatible Rectangle (its own members are exactly x, y, width,\n * height, as createjs's; Pixi's Rectangle also carries a shape type).\n */\nexport class Rectangle {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n\n\tconstructor(x?: number, y?: number, width?: number, height?: number) {\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t\tthis.width = width || 0;\n\t\tthis.height = height || 0;\n\t}\n\n\tsetValues(x?: number, y?: number, width?: number, height?: number): this {\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t\tthis.width = width || 0;\n\t\tthis.height = height || 0;\n\t\treturn this;\n\t}\n\n\tcopy(rect: Rectangle): this {\n\t\treturn this.setValues(rect.x, rect.y, rect.width, rect.height);\n\t}\n\n\tclone(): Rectangle {\n\t\treturn new Rectangle(this.x, this.y, this.width, this.height);\n\t}\n\n\tcontains(x: number, y: number, width?: number, height?: number): boolean {\n\t\tconst w = width || 0;\n\t\tconst h = height || 0;\n\t\treturn x >= this.x && x + w <= this.x + this.width && y >= this.y && y + h <= this.y + this.height;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this.width <= 0 || this.height <= 0;\n\t}\n\n\ttoPixi(): PIXI.Rectangle {\n\t\treturn new PIXI.Rectangle(this.x, this.y, this.width, this.height);\n\t}\n\n\ttoString(): string {\n\t\treturn '[Rectangle (x=' + this.x + ' y=' + this.y + ' width=' + this.width + ' height=' + this.height + ')]';\n\t}\n}\n","import * as PIXI from 'pixi.js';\nimport { Event, EventDispatcher } from './events';\nimport { CjsTransform } from './transform';\nimport { Rectangle } from './geom';\n\n/**\n * A Pixi node owned by a createjs-compatible display object.\n */\nexport interface IOwnedNode extends PIXI.Container {\n\towner: DisplayObject | null;\n}\n\nexport class PixiContainer extends PIXI.Container implements IOwnedNode {\n\towner: DisplayObject | null = null;\n}\n\nlet nextId = 0;\n\n/** A hit area nothing is inside: Pixi's hit test skips a node with it and the node's children */\nexport const NO_HIT_AREA = new PIXI.Rectangle(0, 0, 0, 0);\n\n/** createjs compositeOperation -> Pixi blend mode (the ones WebGL renders) */\nconst BLEND_MODES: { [operation: string]: PIXI.BLEND_MODES } = {\n\t'source-over': PIXI.BLEND_MODES.NORMAL,\n\tlighter: PIXI.BLEND_MODES.ADD,\n\tmultiply: PIXI.BLEND_MODES.MULTIPLY,\n\tscreen: PIXI.BLEND_MODES.SCREEN\n};\n\n/**\n * Members a filter shown through a display object has to provide.\n */\nexport interface IFilterLike {\n\tpixiFilter: PIXI.Filter;\n}\n\nexport interface ICacheState {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n\tscale: number;\n}\n\n/**\n * createjs-compatible display object: a window onto a Pixi node.\n *\n * The values both have in common live on the Pixi node only (x / y on\n * position, scaleX / scaleY on scale, regX / regY on pivot, alpha, visible),\n * read and written through accessors, so a write through the Pixi node and a\n * write through this object are the same write. Members that mean different\n * things in createjs and Pixi keep the createjs meaning here (rotation and\n * skew in degrees, mask, filters, parent); the Pixi node keeps the Pixi one.\n */\nexport class DisplayObject extends EventDispatcher {\n\t/** The Pixi node this object shows */\n\treadonly pixi: IOwnedNode;\n\treadonly id: number;\n\tparent: Container | null = null;\n\ttickEnabled = true;\n\tmouseEnabled = true;\n\tcursor: string | null = null;\n\thitArea: DisplayObject | null = null;\n\tshadow: null = null;\n\tsnapToPixel = true;\n\t/**\n\t * Kept off the display list by the timeline (published code sets it on masks\n\t * and absent instances). createjs reads it only when its timeline places\n\t * children: it does not affect drawing (an _off object on a display list is drawn)\n\t */\n\t/** createjs leaves it unset (undefined) until the timeline or published code sets it */\n\tprivate _offValue: boolean | undefined = undefined;\n\tprivate _name: string | null = null;\n\tprivate _mask: DisplayObject | null = null;\n\tprivate _filters: IFilterLike[] | null = null;\n\tprivate _compositeOperation: string | null = null;\n\t/** The composite operation in effect on the parent (createjs draws children under it) */\n\tprivate _inheritedComposite: string | null = null;\n\t/** The cache createjs would draw through (filters show in Pixi without one) */\n\tbitmapCache: ICacheState | null = null;\n\t/** Set only when the symbol has them (createjs leaves them undefined otherwise) */\n\tnominalBounds?: Rectangle | null;\n\tframeBounds?: Rectangle[] | null;\n\t_bounds: Rectangle | null = null;\n\t/** The parent whose Pixi node holds this object's mask node */\n\t_maskHost: Container | null = null;\n\t/** The objects this object masks (while they are on a display list) */\n\t_maskTargets: DisplayObject[] = [];\n\n\tconstructor(pixi: IOwnedNode) {\n\t\tsuper();\n\t\tthis.id = nextId++;\n\t\tthis.pixi = pixi;\n\t\tpixi.owner = this;\n\t\tpixi.transform = new CjsTransform();\n\t}\n\n\tget _eventParent(): EventDispatcher | null {\n\t\treturn this.parent;\n\t}\n\n\tprivate get _transform(): CjsTransform {\n\t\tconst transform = this.pixi.transform;\n\t\tif (transform instanceof CjsTransform) {\n\t\t\treturn transform;\n\t\t}\n\t\t// The Pixi side replaced the transform: keep createjs semantics on a new one\n\t\tconst replacement = new CjsTransform();\n\t\treplacement.setFromMatrix(transform.localTransform);\n\t\tthis.pixi.transform = replacement;\n\t\treturn replacement;\n\t}\n\n\tget x(): number { return this.pixi.position.x; }\n\tset x(value: number) { this.pixi.position.x = value; }\n\tget y(): number { return this.pixi.position.y; }\n\tset y(value: number) { this.pixi.position.y = value; }\n\tget scaleX(): number { return this.pixi.scale.x; }\n\tset scaleX(value: number) { this.pixi.scale.x = value; }\n\tget scaleY(): number { return this.pixi.scale.y; }\n\tset scaleY(value: number) { this.pixi.scale.y = value; }\n\tget regX(): number { return this.pixi.pivot.x; }\n\tset regX(value: number) { this.pixi.pivot.x = value; }\n\tget regY(): number { return this.pixi.pivot.y; }\n\tset regY(value: number) { this.pixi.pivot.y = value; }\n\tget rotation(): number { return this._transform.degRotation; }\n\tset rotation(value: number) { this._transform.setRotation(value); }\n\tget skewX(): number { return this._transform.degSkewX; }\n\tset skewX(value: number) { this._transform.setSkewX(value); }\n\tget skewY(): number { return this._transform.degSkewY; }\n\tset skewY(value: number) { this._transform.setSkewY(value); }\n\tget alpha(): number { return this.pixi.alpha; }\n\tset alpha(value: number) { this.pixi.alpha = value; }\n\tget visible(): boolean { return this.pixi.visible; }\n\tset visible(value: boolean) { this.pixi.visible = value; }\n\tget name(): string | null { return this._name; }\n\tset name(value: string | null) {\n\t\tthis._name = value;\n\t\tthis.pixi.name = value == null ? '' : String(value);\n\t}\n\n\tget _off(): boolean | undefined { return this._offValue; }\n\tset _off(value: boolean | undefined) {\n\t\tthis._offValue = value;\n\t}\n\n\tget compositeOperation(): string | null { return this._compositeOperation; }\n\tset compositeOperation(value: string | null) {\n\t\tthis._compositeOperation = value;\n\t\tthis._applyComposite();\n\t}\n\n\t/**\n\t * The composite operation createjs draws this object with: its own, or else\n\t * the nearest ancestor's (createjs sets it on the context and draws the\n\t * children under it, each child saving and restoring the context)\n\t */\n\t_effectiveComposite(): string | null {\n\t\treturn this._compositeOperation || this._inheritedComposite;\n\t}\n\n\t/** Told by the parent when the composite operation in effect on it changes */\n\t_setInheritedComposite(value: string | null): void {\n\t\tif (value === this._inheritedComposite) {\n\t\t\treturn;\n\t\t}\n\t\tthis._inheritedComposite = value;\n\t\tthis._applyComposite();\n\t}\n\n\t/**\n\t * Pixi blends per drawing node (a container has no blend mode of its own),\n\t * so the composite operation in effect is set on this object's drawing node\n\t * and handed down to the children\n\t */\n\t_applyComposite(): void {\n\t\tconst composite = this._effectiveComposite();\n\t\tconst mode = composite ? BLEND_MODES[composite] : undefined;\n\t\tthis._setBlendMode(mode === undefined ? PIXI.BLEND_MODES.NORMAL : mode);\n\t}\n\n\tget mask(): DisplayObject | null { return this._mask; }\n\tset mask(value: DisplayObject | null) {\n\t\tif (this._mask === value) {\n\t\t\treturn;\n\t\t}\n\t\tconst host = this._maskHost;\n\t\tif (host) {\n\t\t\thost._detachMask(this);\n\t\t}\n\t\tthis._mask = value;\n\t\tthis.pixi.mask = null;\n\t\tif (this.parent) {\n\t\t\tthis.parent._attachMask(this);\n\t\t}\n\t}\n\n\tget filters(): IFilterLike[] | null { return this._filters; }\n\tset filters(value: IFilterLike[] | null) {\n\t\tthis._filters = value;\n\t\tthis.pixi.filters = value && value.length ? value.map(filter => filter.pixiFilter) : [];\n\t}\n\n\t/** Blend mode for the Pixi node(s) that draw this object */\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tconst node = this.pixi;\n\t\tif (node instanceof PIXI.Sprite || node instanceof PIXI.Graphics) {\n\t\t\tnode.blendMode = mode;\n\t\t}\n\t}\n\n\t/**\n\t * The node is drawn unless Pixi uses it as a mask, or it is in a parent's\n\t * node only to carry the mask shape of a sibling (a createjs mask is not on\n\t * any display list and is not drawn itself)\n\t */\n\t_updateRenderable(): void {\n\t\tconst maskOnly = this.pixi.isMask || this._maskTargets.length > 0;\n\t\tthis.pixi.renderable = !maskOnly;\n\t\t// Pixi hit tests nodes that are not drawn: a mask's node is kept out of pointer\n\t\t// hits (with its children) by a hit area nothing is inside, as createjs never hits a mask\n\t\tif (maskOnly) {\n\t\t\tthis.pixi.hitArea = NO_HIT_AREA;\n\t\t} else if (this.pixi.hitArea === NO_HIT_AREA) {\n\t\t\t// Back to Pixi's default (null; the type definition does not take null, Pixi does)\n\t\t\tReflect.set(this.pixi, 'hitArea', null);\n\t\t}\n\t}\n\n\t/** Whether this object clips when used as a mask (createjs clips only with a non-empty Graphics) */\n\t_clipsAsMask(): boolean {\n\t\treturn false;\n\t}\n\n\t/** The node Pixi masks with when this object is a mask */\n\t_pixiMaskNode(): PIXI.Container | null {\n\t\treturn null;\n\t}\n\n\t/** Called when this object stops being some object's Pixi mask */\n\t_releaseMaskNode(): void {\n\t\t// Nothing to release for objects that are not shapes\n\t}\n\n\t/** Sets the Pixi mask from the createjs one: Pixi masks only while the createjs mask would clip */\n\t_updatePixiMask(): void {\n\t\tconst mask = this._mask;\n\t\tconst node = mask && this._maskHost && mask._clipsAsMask() ? mask._pixiMaskNode() : null;\n\t\tif (this.pixi.mask !== node) {\n\t\t\tthis.pixi.mask = node;\n\t\t\tif (!node && mask) {\n\t\t\t\tmask._releaseMaskNode();\n\t\t\t}\n\t\t}\n\t}\n\n\tsetTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): this {\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t\tthis.scaleX = scaleX == null ? 1 : scaleX;\n\t\tthis.scaleY = scaleY == null ? 1 : scaleY;\n\t\tthis.rotation = rotation || 0;\n\t\tthis.skewX = skewX || 0;\n\t\tthis.skewY = skewY || 0;\n\t\tthis.regX = regX || 0;\n\t\tthis.regY = regY || 0;\n\t\treturn this;\n\t}\n\n\tset(props: { [key: string]: string | number | boolean | null }): this {\n\t\tObject.keys(props).forEach(key => {\n\t\t\tReflect.set(this, key, props[key]);\n\t\t});\n\t\treturn this;\n\t}\n\n\tisVisible(): boolean {\n\t\treturn !!(this.visible && this.alpha > 0 && this.scaleX !== 0 && this.scaleY !== 0);\n\t}\n\n\tcache(x: number, y: number, width: number, height: number, scale?: number): void {\n\t\tthis.bitmapCache = { x, y, width, height, scale: scale || 1 };\n\t}\n\n\tupdateCache(): void {\n\t\t// Nothing is cached on the Pixi side; filters apply without a cache\n\t}\n\n\tuncache(): void {\n\t\tthis.bitmapCache = null;\n\t}\n\n\tsetBounds(x: number | null, y?: number, width?: number, height?: number): void {\n\t\tthis._bounds = x == null ? null : new Rectangle(x, y, width, height);\n\t}\n\n\tgetChildDepth(): number {\n\t\tlet depth = 0;\n\t\tfor (let o = this.parent; o; o = o.parent) {\n\t\t\tdepth++;\n\t\t}\n\t\treturn depth;\n\t}\n\n\t/** createjs tick phase: dispatches the tick event to listeners */\n\t_tick(event: Event): void {\n\t\tconst listeners = this._listeners;\n\t\tif (listeners && listeners.tick) {\n\t\t\tevent.target = null;\n\t\t\tevent.propagationStopped = event.immediatePropagationStopped = false;\n\t\t\tthis.dispatchEvent(event);\n\t\t}\n\t}\n\n\ttoString(): string {\n\t\treturn '[DisplayObject (name=' + this.name + ')]';\n\t}\n}\n\n/**\n * createjs-compatible Container. The Pixi node's children are the display\n * list's nodes in the same order, followed by the nodes of the masks the\n * children use (a createjs mask is drawn in its target's parent space, so\n * its node lives in the parent's node).\n */\nexport class Container extends DisplayObject {\n\tchildren: DisplayObject[] = [];\n\ttickChildren = true;\n\tmouseChildren = true;\n\t/** Mask nodes held in this container's node, by the child that uses them */\n\tprivate _maskNodes: { [childId: number]: IOwnedNode } = {};\n\n\tconstructor(pixi?: IOwnedNode) {\n\t\tsuper(pixi || new PixiContainer());\n\t}\n\n\tget numChildren(): number {\n\t\treturn this.children.length;\n\t}\n\n\taddChild(...children: DisplayObject[]): DisplayObject | null {\n\t\tlet last: DisplayObject | null = null;\n\t\tchildren.forEach(child => {\n\t\t\tif (child != null) {\n\t\t\t\tlast = this.addChildAt(child, this.children.length);\n\t\t\t}\n\t\t});\n\t\treturn last;\n\t}\n\n\taddChildAt(child: DisplayObject, index: number): DisplayObject {\n\t\tif (index < 0 || index > this.children.length) {\n\t\t\treturn child;\n\t\t}\n\n\t\tconst oldParent = child.parent;\n\t\tconst same = oldParent === this;\n\t\tif (oldParent) {\n\t\t\toldParent._removeChildAt(oldParent.children.indexOf(child), same);\n\t\t}\n\t\tchild.parent = this;\n\t\tthis.children.splice(index, 0, child);\n\t\tthis.pixi.addChildAt(child.pixi, index);\n\t\tthis._attachMask(child);\n\t\tchild._setInheritedComposite(this._effectiveComposite());\n\t\tif (!same) {\n\t\t\tchild.dispatchEvent('added');\n\t\t}\n\t\treturn child;\n\t}\n\n\tremoveChild(...children: DisplayObject[]): boolean {\n\t\tlet removed = true;\n\t\tchildren.forEach(child => {\n\t\t\tremoved = this._removeChildAt(this.children.indexOf(child)) && removed;\n\t\t});\n\t\treturn removed;\n\t}\n\n\tremoveChildAt(...indexes: number[]): boolean {\n\t\tconst sorted = indexes.slice().sort((a, b) => b - a);\n\t\tlet removed = true;\n\t\tsorted.forEach(index => {\n\t\t\tremoved = this._removeChildAt(index) && removed;\n\t\t});\n\t\treturn removed;\n\t}\n\n\tremoveAllChildren(): void {\n\t\twhile (this.children.length) {\n\t\t\tthis._removeChildAt(0);\n\t\t}\n\t}\n\n\tgetChildAt(index: number): DisplayObject | undefined {\n\t\treturn this.children[index];\n\t}\n\n\tgetChildByName(name: string): DisplayObject | null {\n\t\tconst children = this.children;\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tif (children[i].name == name) {\n\t\t\t\treturn children[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetChildIndex(child: DisplayObject): number {\n\t\treturn this.children.indexOf(child);\n\t}\n\n\tsetChildIndex(child: DisplayObject, index: number): void {\n\t\tconst children = this.children;\n\t\tif (child.parent !== this || index < 0 || index >= children.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst current = children.indexOf(child);\n\t\tif (current < 0 || current === index) {\n\t\t\treturn;\n\t\t}\n\t\tchildren.splice(current, 1);\n\t\tchildren.splice(index, 0, child);\n\t\tthis.pixi.setChildIndex(child.pixi, index);\n\t}\n\n\tswapChildrenAt(index1: number, index2: number): void {\n\t\tconst children = this.children;\n\t\tconst a = children[index1];\n\t\tconst b = children[index2];\n\t\tif (!a || !b) {\n\t\t\treturn;\n\t\t}\n\t\tchildren[index1] = b;\n\t\tchildren[index2] = a;\n\t\tthis.pixi.swapChildren(a.pixi, b.pixi);\n\t}\n\n\tswapChildren(child1: DisplayObject, child2: DisplayObject): void {\n\t\tconst index1 = this.children.indexOf(child1);\n\t\tconst index2 = this.children.indexOf(child2);\n\t\tif (index1 >= 0 && index2 >= 0) {\n\t\t\tthis.swapChildrenAt(index1, index2);\n\t\t}\n\t}\n\n\tsortChildren(compare: (a: DisplayObject, b: DisplayObject) => number): void {\n\t\tthis.children.sort(compare);\n\t\tthis.children.forEach((child, index) => {\n\t\t\tthis.pixi.setChildIndex(child.pixi, index);\n\t\t});\n\t}\n\n\tcontains(child: DisplayObject | null): boolean {\n\t\tfor (let o = child; o; o = o.parent) {\n\t\t\tif (o === this) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t_removeChildAt(index: number, silent?: boolean): boolean {\n\t\tif (index < 0 || index > this.children.length - 1) {\n\t\t\treturn false;\n\t\t}\n\t\tconst child = this.children[index];\n\t\tthis._detachMask(child);\n\t\tchild.parent = null;\n\t\tthis.children.splice(index, 1);\n\t\tthis.pixi.removeChild(child.pixi);\n\t\t// A silent removal is the first half of re-adding to this same container\n\t\t// (the timeline does it every resolve): the inherited composite stays\n\t\tif (!silent) {\n\t\t\tchild._setInheritedComposite(null);\n\t\t\tchild.dispatchEvent('removed');\n\t\t}\n\t\treturn true;\n\t}\n\n\t/** Puts the node of a child's mask into this container's node, and sets it as the Pixi mask */\n\t_attachMask(child: DisplayObject): void {\n\t\tconst mask = child.mask;\n\t\tif (!mask || child.parent !== this) {\n\t\t\treturn;\n\t\t}\n\t\tthis._maskNodes[child.id] = mask.pixi;\n\t\tthis.pixi.addChild(mask.pixi);\n\t\tchild._maskHost = this;\n\t\tmask._maskTargets.push(child);\n\t\tmask._updateRenderable();\n\t\tchild._updatePixiMask();\n\t}\n\n\t_detachMask(child: DisplayObject): void {\n\t\tconst node = this._maskNodes[child.id];\n\t\tif (node) {\n\t\t\tdelete this._maskNodes[child.id];\n\t\t\tif (node.parent === this.pixi) {\n\t\t\t\tthis.pixi.removeChild(node);\n\t\t\t}\n\t\t}\n\t\tconst mask = child.mask;\n\t\tif (mask) {\n\t\t\tconst index = mask._maskTargets.indexOf(child);\n\t\t\tif (index >= 0) {\n\t\t\t\tmask._maskTargets.splice(index, 1);\n\t\t\t}\n\t\t}\n\t\tchild._maskHost = null;\n\t\tchild.pixi.mask = null;\n\t\tif (mask) {\n\t\t\t// Pixi makes a released mask node renderable again\n\t\t\tmask._releaseMaskNode();\n\t\t\tmask._updateRenderable();\n\t\t}\n\t}\n\n\t_applyComposite(): void {\n\t\tsuper._applyComposite();\n\t\tconst composite = this._effectiveComposite();\n\t\tthis.children.forEach(child => child._setInheritedComposite(composite));\n\t}\n\n\t/** createjs tick phase: children in reverse order (live array), then this object's listeners */\n\t_tick(event: Event): void {\n\t\tif (this.tickChildren) {\n\t\t\tfor (let i = this.children.length - 1; i >= 0; i--) {\n\t\t\t\tconst child = this.children[i];\n\t\t\t\tif (child.tickEnabled) {\n\t\t\t\t\tchild._tick(event);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper._tick(event);\n\t}\n\n\ttoString(): string {\n\t\treturn '[Container (name=' + this.name + ')]';\n\t}\n}\n","import { Container, DisplayObject, IOwnedNode } from './display';\nimport { Event } from './events';\nimport type { IRuntimeTweenDef, IStateEntryDef, TFrameValue, ILabelDef } from './data';\n\n/** A frame script, called with the clip as `this` */\nexport type TScript = (...args: Array<object | string | number | boolean | null>) => void;\n\n/** A recorded value as written (Graphics references resolved) */\nexport type TWrittenValue = object | string | number | boolean | null;\n\n/**\n * A generated writer: writes the recorded values to the target property by\n * property, the names written out in its code (values[i] to the i-th\n * property; resolve turns a recorded Graphics reference into the Graphics).\n * An initial-value writer has its values in its code and takes the target only.\n */\nexport type TWriter = (target: object, values?: TFrameValue[], resolve?: (value: TFrameValue) => TWrittenValue) => void;\n/** Gives an instance its named children: `self.<name> = slots[<slot>]` for each, the names written in the code */\nexport type TMemberWriter = (self: object, slots: object[]) => void;\n\n/**\n * What a MovieClip instance needs to play a tween of its symbol: how to find\n * the objects a recorded value refers to.\n */\nexport interface ITweenScope {\n\t/** The target of a state entry (a slot of the instance) */\n\tstateTarget(entry: IStateEntryDef): DisplayObject | null;\n\t/** A recorded value as written (Graphics references resolved) */\n\tvalue(value: TFrameValue): TWrittenValue;\n\t/** A frame script by index */\n\tscript(index: number): TScript;\n\t/** A writer by index */\n\twriter(index: number): TWriter;\n}\n\n/**\n * The playback state of one tween of an instance. The values come from the\n * shared definition; only the positions are per instance.\n */\nexport class TweenState {\n\treadonly def: IRuntimeTweenDef;\n\t/**\n\t * What the tween writes to: a display object or a filter (through their\n\t * accessors), or the plain object published code tweens `state` arrays on\n\t */\n\treadonly target: object;\n\treadonly scope: ITweenScope;\n\treadonly self: MovieClip;\n\tposition = 0;\n\trawPosition = -1;\n\t/** Distance from the start of the current step (synched children take their frame from it) */\n\t_stepPosition = 0;\n\tpassive = false;\n\n\tconstructor(def: IRuntimeTweenDef, target: object, scope: ITweenScope, self: MovieClip) {\n\t\tthis.def = def;\n\t\tthis.target = target;\n\t\tthis.scope = scope;\n\t\tthis.self = self;\n\t}\n\n\tget duration(): number {\n\t\treturn this.def.duration;\n\t}\n\n\t/**\n\t * Tween.setPosition as a timeline drives it (actions are run separately by\n\t * the timeline). Nothing happens when the raw position does not change.\n\t */\n\tsetPosition(rawPosition: number, jump: boolean): void {\n\t\tconst duration = this.def.duration;\n\t\tconst previous = this.rawPosition;\n\t\tlet raw = rawPosition < 0 ? 0 : rawPosition;\n\t\tlet position = 0;\n\t\tlet end: boolean;\n\n\t\tif (duration === 0) {\n\t\t\tend = true;\n\t\t\tif (previous !== -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tconst loops = raw / duration | 0;\n\t\t\tposition = raw - loops * duration;\n\t\t\t// A tween in a timeline does not loop: it ends at its duration\n\t\t\tend = raw >= duration;\n\t\t\tif (end) {\n\t\t\t\traw = position = duration;\n\t\t\t}\n\t\t\tif (raw === previous) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.position = position;\n\t\tthis.rawPosition = raw;\n\t\tthis._updatePosition(jump, end);\n\t}\n\n\tprivate _updatePosition(jump: boolean, end: boolean): void {\n\t\tconst def = this.def;\n\t\tconst position = this.position;\n\n\t\tif (def.writer !== null) {\n\t\t\tthis.scope.writer(def.writer)(this.target, def.values[def.frames[position]], this.scope.value);\n\t\t}\n\n\t\t// The last step whose start is at or before the position\n\t\tconst keyframes = def.keyframes;\n\t\tlet start = 0;\n\t\tlet found = false;\n\t\tfor (let i = 0; i < keyframes.length; i++) {\n\t\t\tif (keyframes[i] <= position || i === 0) {\n\t\t\t\tstart = keyframes[i];\n\t\t\t\tfound = true;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis._stepPosition = found ? position - start : 0;\n\t}\n\n\t/** AbstractTween._runActions for this tween's actions */\n\t_runActions(startRaw: number, endRaw: number, jump: boolean, includeStart: boolean): boolean {\n\t\tif (!this.def.actions.length) {\n\t\t\treturn false;\n\t\t}\n\t\treturn runActions(this, this.def.duration, 0, startRaw, endRaw, jump, includeStart);\n\t}\n\n\t/** Tween._runActionsRange: runs the actions in the range, stopping when one moves the tween */\n\t_runActionsRange(start: number, end: number, jump: boolean, includeStart: boolean): boolean {\n\t\tconst actions = this.def.actions;\n\t\tconst reverse = start > end;\n\t\tconst low = reverse ? end : start;\n\t\tconst high = reverse ? start : end;\n\t\tconst position = this.position;\n\n\t\tfor (let n = 0; n < actions.length; n++) {\n\t\t\tconst action = actions[reverse ? actions.length - 1 - n : n];\n\t\t\tconst t = action.position;\n\t\t\tif (t === end || (t > low && t < high) || (includeStart && t === start)) {\n\t\t\t\tconst scope = this.scope;\n\t\t\t\tconst params = action.params ? action.params.map(value => scope.value(value)) : [this];\n\t\t\t\tscope.script(action.script).apply(this.self, params);\n\t\t\t\tif (position !== this.position) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\ninterface IActionRunner {\n\t_runActionsRange(start: number, end: number, jump: boolean, includeStart: boolean): boolean;\n}\n\n/**\n * AbstractTween._runActions: splits the move from one raw position to another\n * into per-loop ranges and runs the actions of each, as createjs does.\n */\nfunction runActions(runner: IActionRunner, duration: number, loop: number, startRaw: number, endRaw: number, jump: boolean, includeStart: boolean): boolean {\n\tlet startLoop: number;\n\tlet endLoop: number;\n\tlet start: number;\n\tlet end: number;\n\n\tif (duration === 0) {\n\t\tstartLoop = endLoop = start = end = 0;\n\t} else {\n\t\tstartLoop = startRaw / duration | 0;\n\t\tendLoop = endRaw / duration | 0;\n\t\tstart = startRaw - startLoop * duration;\n\t\tend = endRaw - endLoop * duration;\n\t}\n\n\tif (loop !== -1) {\n\t\tif (endLoop > loop) {\n\t\t\tend = duration;\n\t\t\tendLoop = loop;\n\t\t}\n\t\tif (startLoop > loop) {\n\t\t\tstart = duration;\n\t\t\tstartLoop = loop;\n\t\t}\n\t}\n\n\tif (jump) {\n\t\treturn runner._runActionsRange(end, end, jump, includeStart);\n\t}\n\n\tif (startLoop !== endLoop || start !== end || jump || includeStart) {\n\t\tif (startLoop === -1) {\n\t\t\tstartLoop = start = 0;\n\t\t}\n\t\tconst forward = endRaw >= startRaw;\n\t\tlet n = startLoop;\n\t\tlet first = includeStart;\n\t\tdo {\n\t\t\tconst rangeStart = n === startLoop ? start : forward ? 0 : duration;\n\t\t\tconst rangeEnd = n === endLoop ? end : forward ? duration : 0;\n\t\t\tif (runner._runActionsRange(rangeStart, rangeEnd, jump, first || n !== startLoop)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tfirst = false;\n\t\t} while ((forward && ++n <= endLoop) || (!forward && --n >= endLoop));\n\t}\n\treturn false;\n}\n\n/**\n * The timeline of a MovieClip instance (createjs.Timeline as a MovieClip drives it).\n */\nexport class Timeline implements IActionRunner {\n\treadonly tweens: TweenState[] = [];\n\treadonly duration: number;\n\tloop = 0;\n\tposition = 0;\n\trawPosition = -1;\n\tprivate readonly _labels: { [label: string]: number };\n\tprivate readonly _labelList: ILabelDef[];\n\n\tconstructor(duration: number, labels: ILabelDef[]) {\n\t\tthis.duration = duration;\n\t\tthis._labels = {};\n\t\tlabels.forEach(label => {\n\t\t\tthis._labels[label.label] = label.position;\n\t\t});\n\t\tthis._labelList = labels.slice().sort((a, b) => a.position - b.position);\n\t}\n\n\tgetLabels(): ILabelDef[] {\n\t\treturn this._labelList;\n\t}\n\n\tget currentLabel(): string | null {\n\t\tconst labels = this._labelList;\n\t\tlet i = 0;\n\t\tfor (; i < labels.length; i++) {\n\t\t\tif (this.position < labels[i].position) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn i === 0 ? null : labels[i - 1].label;\n\t}\n\n\tresolve(positionOrLabel: string | number): number | undefined {\n\t\tconst position = Number(positionOrLabel);\n\t\tif (!isNaN(position)) {\n\t\t\treturn position;\n\t\t}\n\t\tconst label = this._labels[positionOrLabel];\n\t\treturn label === undefined ? undefined : label;\n\t}\n\n\t/**\n\t * AbstractTween.setPosition for the timeline: moves every tween, calls\n\t * back (the clip resolves its children), then runs the actions passed.\n\t */\n\tsetPosition(rawPosition: number, skipActions: boolean, jump: boolean, callback: (() => void) | null): void {\n\t\tconst duration = this.duration;\n\t\tconst loop = this.loop;\n\t\tconst previous = this.rawPosition;\n\t\tlet raw = rawPosition < 0 ? 0 : rawPosition;\n\t\tlet position = 0;\n\n\t\tif (duration === 0) {\n\t\t\tif (previous !== -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tconst loops = raw / duration | 0;\n\t\t\tposition = raw - loops * duration;\n\t\t\tconst end = loop !== -1 && raw >= loop * duration + duration;\n\t\t\tif (end) {\n\t\t\t\tposition = duration;\n\t\t\t\traw = duration * loop + duration;\n\t\t\t}\n\t\t\tif (raw === previous) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.position = position;\n\t\tthis.rawPosition = raw;\n\t\tfor (let i = 0; i < this.tweens.length; i++) {\n\t\t\tthis.tweens[i].setPosition(position, jump);\n\t\t}\n\t\tif (callback) {\n\t\t\tcallback();\n\t\t}\n\t\tif (!skipActions) {\n\t\t\trunActions(this, this.duration, this.loop, previous, raw, jump, !jump && previous === -1);\n\t\t}\n\t}\n\n\t_runActionsRange(start: number, end: number, jump: boolean, includeStart: boolean): boolean {\n\t\tconst position = this.position;\n\t\tfor (let i = 0; i < this.tweens.length; i++) {\n\t\t\tthis.tweens[i]._runActions(start, end, jump, includeStart);\n\t\t\tif (position !== this.position) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport interface IFilterCacheEntry {\n\tinstance: DisplayObject;\n\tstartFrame: number;\n\tendFrame: number;\n\tx: number;\n\ty: number;\n\tw: number;\n\th: number;\n}\n\nexport const INDEPENDENT = 'independent';\nexport const SINGLE_FRAME = 'single';\nexport const SYNCHED = 'synched';\n\n/**\n * createjs-compatible MovieClip. Plays its symbol's timeline from the shared\n * definition with createjs's rules: the two phases (tick: advance the\n * playhead; then resolve: write the tweens and settle the children), the\n * write rule (a tween writes only when its position changes), synched /\n * single children taking their frame from the parent's step, the reset of an\n * independent child when it comes back on the display list, and when frame\n * scripts run.\n */\nexport class MovieClip extends Container {\n\tstatic INDEPENDENT = INDEPENDENT;\n\tstatic SINGLE_FRAME = SINGLE_FRAME;\n\tstatic SYNCHED = SYNCHED;\n\n\tmode: string;\n\tstartPosition: number;\n\tloop: number;\n\tcurrentFrame = 0;\n\tpaused = false;\n\tactionsEnabled = true;\n\tautoReset = true;\n\tframerate: number | null = null;\n\ttimeline: Timeline;\n\t_synchOffset = 0;\n\t_rawPosition = -1;\n\t_t = 0;\n\t_framerate: number | null = null;\n\t/**\n\t * Display objects the timeline placed, with the resolve that last placed\n\t * them (_resolveCount at that time). One placed in an earlier resolve and\n\t * not in the current one is removed at its end (createjs marks every entry\n\t * 1 at the start of a resolve and placed ones 2: an earlier count is its 1)\n\t */\n\t_managed: { [id: number]: number } = {};\n\tprivate _resolveCount = 0;\n\t/**\n\t * While a resolve can still leave the display list as it is: the index of\n\t * the child the next placement has to be for that (createjs moves each placed\n\t * child to the bottom, so in a resolve that changes nothing they come from\n\t * the top of the placed block down), -1 once all have come. Null when the\n\t * placements are done as createjs does them.\n\t */\n\tprivate _expected: number | null = null;\n\t/** The length of the placed block at the start of the resolve (the children placed last time, at the bottom) */\n\tprivate _placedBlock = 0;\n\t/**\n\t * Instances to re-cache within frame ranges, read by the filter cache\n\t * handling (published code sets it in the symbol's constructor)\n\t */\n\tfilterCacheList?: IFilterCacheEntry[];\n\t/** The frame rate the content was published with (lib.properties.fps), set on the content's symbols */\n\tcontentFps: number | null = null;\n\tprivate readonly _boundResolve: () => void;\n\n\tconstructor(mode?: string | null, startPosition?: number | null, loop?: boolean | number | null, timeline?: Timeline, pixi?: IOwnedNode) {\n\t\tsuper(pixi);\n\t\tthis.mode = mode || INDEPENDENT;\n\t\tthis.startPosition = startPosition || 0;\n\t\tthis.loop = loop === true ? -1 : (loop || 0);\n\t\tthis.timeline = timeline || new Timeline(0, []);\n\t\tthis._boundResolve = () => this._resolveState();\n\t}\n\n\tget labels(): ILabelDef[] { return this.timeline.getLabels(); }\n\tget currentLabel(): string | null { return this.timeline.currentLabel; }\n\tget totalFrames(): number { return this.timeline.duration; }\n\tget duration(): number { return this.timeline.duration; }\n\n\tisVisible(): boolean {\n\t\treturn !!(this.visible && this.alpha > 0 && this.scaleX !== 0 && this.scaleY !== 0);\n\t}\n\n\tplay(): void { this.paused = false; }\n\tstop(): void { this.paused = true; }\n\n\tgotoAndPlay(positionOrLabel: string | number): void {\n\t\tthis.paused = false;\n\t\tthis._goto(positionOrLabel);\n\t}\n\n\tgotoAndStop(positionOrLabel: string | number): void {\n\t\tthis.paused = true;\n\t\tthis._goto(positionOrLabel);\n\t}\n\n\tadvance(time?: number | null): void {\n\t\tif (this.mode !== INDEPENDENT) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet framerate = this.framerate;\n\t\tfor (let o = this.parent; o && framerate === null; o = o.parent) {\n\t\t\tif (o instanceof MovieClip && o.mode === INDEPENDENT) {\n\t\t\t\tframerate = o._framerate;\n\t\t\t}\n\t\t}\n\t\tthis._framerate = framerate;\n\n\t\tif (!this.paused) {\n\t\t\t// As createjs: a missing time (undefined, not null) with a framerate gives NaN, i.e. no advance\n\t\t\tconst frames = framerate !== null && framerate !== -1 && time !== null ? Number(time) / (1000 / framerate) + this._t : 1;\n\t\t\tlet count = frames | 0;\n\t\t\tthis._t = frames - count;\n\t\t\twhile (count--) {\n\t\t\t\tthis._updateTimeline(this._rawPosition + 1, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** createjs tick phase: advance the playhead, then the children (reverse), then tick listeners */\n\t_tick(event: Event): void {\n\t\tthis.advance(event ? event.delta : undefined);\n\t\tsuper._tick(event);\n\t}\n\n\t/** createjs resolve phase (MovieClip draw / Stage update) */\n\t_updateState(): void {\n\t\tif (this._rawPosition === -1 || this.mode !== INDEPENDENT) {\n\t\t\tthis._updateTimeline(-1, false);\n\t\t}\n\t}\n\n\t_goto(positionOrLabel: string | number): void {\n\t\tconst position = this.timeline.resolve(positionOrLabel);\n\t\tif (position != null) {\n\t\t\tthis._t = 0;\n\t\t\tthis._updateTimeline(position, true);\n\t\t}\n\t}\n\n\t_reset(): void {\n\t\tthis._rawPosition = -1;\n\t\tthis._t = this.currentFrame = 0;\n\t\tthis.paused = false;\n\t}\n\n\t_updateTimeline(rawPosition: number, jump: boolean): void {\n\t\tconst synched = this.mode !== INDEPENDENT;\n\t\tconst timeline = this.timeline;\n\t\tlet position = rawPosition;\n\t\tif (synched) {\n\t\t\tposition = this.startPosition + (this.mode === SINGLE_FRAME ? 0 : this._synchOffset);\n\t\t}\n\t\tif (position < 0) {\n\t\t\tposition = 0;\n\t\t}\n\t\tif (this._rawPosition !== position || synched) {\n\t\t\tthis._rawPosition = position;\n\t\t\ttimeline.loop = this.loop;\n\t\t\ttimeline.setPosition(position, synched || !this.actionsEnabled, jump, this._boundResolve);\n\t\t}\n\t}\n\n\t_renderFirstFrame(): void {\n\t\tconst timeline = this.timeline;\n\t\tconst raw = timeline.rawPosition;\n\t\ttimeline.setPosition(0, true, true, this._boundResolve);\n\t\ttimeline.rawPosition = raw;\n\t}\n\n\t/**\n\t * MovieClip._resolveState: places every tween target (and state entry) at\n\t * the bottom of the display list in turn, then removes the children placed\n\t * before and not now. The placements are skipped while they would leave the\n\t * display list as it is (_addManagedChild); otherwise everything is done as\n\t * createjs does it.\n\t */\n\t_resolveState(): void {\n\t\tconst timeline = this.timeline;\n\t\tthis.currentFrame = timeline.position;\n\n\t\tconst current = ++this._resolveCount;\n\t\tconst managed = this._managed;\n\t\tconst children = this.children;\n\n\t\t// The children the timeline placed, from the bottom (a resolve leaves them there): a placement\n\t\t// can be skipped only for one of them (it was placed before, so it would not be reset). What\n\t\t// is above the block does not matter: createjs's placements put the placed ones below it\n\t\tlet block = 0;\n\t\twhile (block < children.length && managed[children[block].id] !== undefined) {\n\t\t\tblock++;\n\t\t}\n\t\tthis._placedBlock = block;\n\t\tthis._expected = block - 1;\n\n\t\tconst tweens = timeline.tweens;\n\t\tfor (let i = 0; i < tweens.length; i++) {\n\t\t\tconst tween = tweens[i];\n\t\t\tconst target = tween.target;\n\t\t\tif (target !== this && !tween.passive) {\n\t\t\t\tconst offset = tween._stepPosition;\n\t\t\t\tif (target instanceof DisplayObject) {\n\t\t\t\t\tthis._addManagedChild(target, offset);\n\t\t\t\t} else {\n\t\t\t\t\tthis._setState(Reflect.get(target, 'state'), tween.scope, offset);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Children of the block not placed now: put the placed ones in front of them as createjs has them\n\t\tthis._followCreatejs();\n\n\t\tfor (let i = children.length - 1; i >= 0; i--) {\n\t\t\tconst id = children[i].id;\n\t\t\tconst placed = managed[id];\n\t\t\t// Earlier than this resolve (a resolve nested in this one, from an event, counts as now)\n\t\t\tif (placed !== undefined && placed < current) {\n\t\t\t\tthis.removeChildAt(i);\n\t\t\t\tdelete managed[id];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Stops skipping placements: the children placed so far (the top of the\n\t * block, from the expected index up) are moved to the bottom as createjs's\n\t * placements would have left them, with no events (moves within the same\n\t * parent are silent in createjs).\n\t */\n\t_followCreatejs(): void {\n\t\tconst expected = this._expected;\n\t\tthis._expected = null;\n\t\tif (expected === null || expected < 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst children = this.children;\n\t\tconst placed = children.splice(expected + 1, this._placedBlock - expected - 1);\n\t\tfor (let i = placed.length - 1; i >= 0; i--) {\n\t\t\tchildren.unshift(placed[i]);\n\t\t}\n\t\tplaced.forEach((child, index) => {\n\t\t\tthis.pixi.setChildIndex(child.pixi, index);\n\t\t});\n\t}\n\n\t_setState(state: IStateEntryDef[] | object | string | number | boolean | null | undefined, scope: ITweenScope, offset: number): void {\n\t\tif (!Array.isArray(state)) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = state.length - 1; i >= 0; i--) {\n\t\t\tconst entry: IStateEntryDef = state[i];\n\t\t\tconst target = scope.stateTarget(entry);\n\t\t\tif (!target) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst props = entry.props;\n\t\t\tif (props) {\n\t\t\t\tObject.keys(props).forEach(key => {\n\t\t\t\t\tReflect.set(target, key, scope.value(props[key]));\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis._addManagedChild(target, offset);\n\t\t}\n\t}\n\n\t_addManagedChild(child: DisplayObject, offset: number): void {\n\t\tif (child._off) {\n\t\t\treturn;\n\t\t}\n\t\tconst expected = this._expected;\n\t\tif (expected !== null) {\n\t\t\t// Moving it to the bottom would put it where it is: the next child of the block down, or\n\t\t\t// the child placed last (placed twice in this resolve: createjs has it at the bottom already).\n\t\t\t// Only what the placement records is done (it was placed before, so no reset)\n\t\t\tconst next = expected >= 0 && this.children[expected] === child;\n\t\t\tif (next || (expected + 1 < this._placedBlock && this.children[expected + 1] === child)) {\n\t\t\t\tif (next) {\n\t\t\t\t\tthis._expected = expected - 1;\n\t\t\t\t}\n\t\t\t\tif (child instanceof MovieClip) {\n\t\t\t\t\tchild._synchOffset = offset;\n\t\t\t\t}\n\t\t\t\tthis._managed[child.id] = this._resolveCount;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._followCreatejs();\n\t\t}\n\t\tthis.addChildAt(child, 0);\n\t\tif (child instanceof MovieClip) {\n\t\t\tchild._synchOffset = offset;\n\t\t\tif (child.mode === INDEPENDENT && child.autoReset && !this._managed[child.id]) {\n\t\t\t\tchild._reset();\n\t\t\t}\n\t\t}\n\t\tthis._managed[child.id] = this._resolveCount;\n\t}\n\n\ttoString(): string {\n\t\treturn '[MovieClip (name=' + this.name + ')]';\n\t}\n}\n","import * as PIXI from 'pixi.js';\nimport { DisplayObject, Container, IOwnedNode, NO_HIT_AREA } from './display';\nimport { Event } from './events';\nimport { Rectangle } from './geom';\nimport type { IGraphicsCommandDef, IDataMap, TDataValue } from './data';\n\n/** Changes a geometry's reference count (Pixi 5 counts the Graphics showing it, and disposes of it at 0) */\nfunction addReference(geometry: PIXI.GraphicsGeometry, delta: number): void {\n\tconst count: number = Reflect.get(geometry, 'refCount');\n\tReflect.set(geometry, 'refCount', count + delta);\n}\n\nexport class PixiGraphics extends PIXI.Graphics implements IOwnedNode {\n\towner: DisplayObject | null = null;\n\n\t/**\n\t * Shows another (shared) geometry. Pixi 5 can share a geometry between\n\t * Graphics (new Graphics(geometry), as clone() does) but has no way to\n\t * change it afterwards, and does not declare the field that holds it; it is\n\t * set by name here, and what Pixi derives from the geometry (the batches,\n\t * their vertices and tint) is marked stale so it is built again.\n\t */\n\tsetGeometry(geometry: PIXI.GraphicsGeometry): void {\n\t\tconst current = this.geometry;\n\t\tif (current === geometry) {\n\t\t\treturn;\n\t\t}\n\t\t// The reference count (undeclared as well) keeps a shared geometry alive while shown\n\t\taddReference(current, -1);\n\t\taddReference(geometry, 1);\n\t\tReflect.set(this, '_geometry', geometry);\n\t\tReflect.set(this, '_transformID', -1);\n\t\tthis.batchDirty = -1;\n\t\tthis.batchTint = -1;\n\t}\n\n\t/**\n\t * Pixi 5's Graphics keeps the blend mode in the batches it builds, and\n\t * builds them again only when the geometry changes: a blend mode set later\n\t * would not be drawn. The batches are marked stale so they are built again.\n\t */\n\tsetBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tif (this.blendMode !== mode) {\n\t\t\tthis.blendMode = mode;\n\t\t\tthis.batchDirty = -1;\n\t\t}\n\t}\n}\n\nexport class PixiSprite extends PIXI.Sprite implements IOwnedNode {\n\towner: DisplayObject | null = null;\n}\n\nexport class PixiText extends PIXI.Text implements IOwnedNode {\n\towner: DisplayObject | null = null;\n}\n\n/**\n * Where a content's images come from: manifest images by id, and frames of\n * its sprite sheets (the images published code draws from a frame for a\n * bitmap fill).\n */\nexport interface ITextureSource {\n\timage(id: string): PIXI.Texture | null;\n\tframe(sheet: string, index: number): PIXI.Texture | null;\n\timageAsset(id: string): IImageAsset | null;\n\tframeAsset(sheet: string, index: number): IImageAsset | null;\n}\n\nconst NAMED_COLORS: { [name: string]: number } = {\n\tblack: 0x000000, white: 0xffffff, red: 0xff0000, green: 0x008000, blue: 0x0000ff,\n\tyellow: 0xffff00, cyan: 0x00ffff, magenta: 0xff00ff, gray: 0x808080, grey: 0x808080\n};\n\ninterface IColor {\n\tcolor: number;\n\talpha: number;\n}\n\n/**\n * A CSS color as createjs writes it (#RGB, #RRGGBB, rgb(), rgba(), a few names).\n */\nexport function parseColor(value: TDataValue | undefined): IColor | null {\n\tif (typeof value !== 'string') {\n\t\treturn null;\n\t}\n\n\tconst text = value.trim().toLowerCase();\n\tif (text.charAt(0) === '#') {\n\t\tlet hex = text.slice(1);\n\t\tif (hex.length === 3) {\n\t\t\thex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2);\n\t\t}\n\t\tconst color = parseInt(hex.slice(0, 6), 16);\n\t\treturn isNaN(color) ? null : { color, alpha: 1 };\n\t}\n\n\tconst match = /^rgba?\\(([^)]*)\\)$/.exec(text);\n\tif (match) {\n\t\tconst parts = match[1].split(',').map(part => parseFloat(part));\n\t\tconst alpha = parts.length > 3 ? parts[3] : 1;\n\t\treturn { color: ((parts[0] & 255) << 16) | ((parts[1] & 255) << 8) | (parts[2] & 255), alpha };\n\t}\n\n\tconst named = NAMED_COLORS[text];\n\treturn named === undefined ? null : { color: named, alpha: 1 };\n}\n\nfunction num(props: IDataMap, key: string): number {\n\tconst value = props[key];\n\treturn typeof value === 'number' ? value : 0;\n}\n\nfunction isDataMap(value: TDataValue | undefined): value is IDataMap {\n\treturn value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nconst LINE_CAPS = [PIXI.LINE_CAP.BUTT, PIXI.LINE_CAP.ROUND, PIXI.LINE_CAP.SQUARE];\nconst LINE_JOINS = [PIXI.LINE_JOIN.MITER, PIXI.LINE_JOIN.ROUND, PIXI.LINE_JOIN.BEVEL];\n\nfunction lineCap(value: TDataValue | undefined): PIXI.LINE_CAP {\n\tif (typeof value === 'number') {\n\t\treturn LINE_CAPS[value] || PIXI.LINE_CAP.BUTT;\n\t}\n\treturn value === 'round' ? PIXI.LINE_CAP.ROUND : value === 'square' ? PIXI.LINE_CAP.SQUARE : PIXI.LINE_CAP.BUTT;\n}\n\nfunction lineJoin(value: TDataValue | undefined): PIXI.LINE_JOIN {\n\tif (typeof value === 'number') {\n\t\treturn LINE_JOINS[value] || PIXI.LINE_JOIN.MITER;\n\t}\n\treturn value === 'round' ? PIXI.LINE_JOIN.ROUND : value === 'bevel' ? PIXI.LINE_JOIN.BEVEL : PIXI.LINE_JOIN.MITER;\n}\n\nconst PATH_COMMANDS = ['MoveTo', 'LineTo', 'QuadraticCurveTo', 'BezierCurveTo', 'ArcTo', 'Arc', 'ClosePath', 'Rect', 'RoundRect', 'Circle', 'Ellipse', 'PolyStar'];\n\n/**\n * A fill or stroke style as Pixi takes it.\n */\ninterface IPaint {\n\tcolor: number;\n\talpha: number;\n\ttexture: PIXI.Texture | null;\n\tmatrix: PIXI.Matrix | null;\n}\n\nfunction paintOf(style: TDataValue | undefined, matrix: TDataValue | undefined, textures: ITextureSource): IPaint | null {\n\tconst solid = parseColor(style);\n\tif (solid) {\n\t\treturn { color: solid.color, alpha: solid.alpha, texture: null, matrix: null };\n\t}\n\n\tif (!isDataMap(style)) {\n\t\treturn null;\n\t}\n\n\tif (style.type === 'bitmap') {\n\t\tconst image = style.image;\n\t\tlet texture: PIXI.Texture | null = null;\n\t\tif (isDataMap(image)) {\n\t\t\tif (typeof image.image === 'string') {\n\t\t\t\ttexture = textures.image(image.image);\n\t\t\t} else if (typeof image.sheet === 'string' && typeof image.frame === 'number') {\n\t\t\t\ttexture = textures.frame(image.sheet, image.frame);\n\t\t\t}\n\t\t}\n\t\tconst m = isDataMap(matrix) ? new PIXI.Matrix(num(matrix, 'a'), num(matrix, 'b'), num(matrix, 'c'), num(matrix, 'd'), num(matrix, 'tx'), num(matrix, 'ty')) : null;\n\t\treturn texture ? { color: 0xffffff, alpha: 1, texture, matrix: m } : null;\n\t}\n\n\tconst gradient = gradientOf(style);\n\tif (!gradient) {\n\t\treturn null;\n\t}\n\tconst texture = gradientTexture(gradient);\n\t// A gradient canvas paints nothing with (a line of length 0, a circle of radius 0): nothing is drawn\n\treturn texture ? { color: 0xffffff, alpha: 1, texture, matrix: texture.toShape } : { color: 0, alpha: 0, texture: null, matrix: null };\n}\n\n/**\n * A linear or radial gradient as createjs makes it (the props of a Fill or\n * Stroke style made by beginLinearGradientFill and the like): colors at\n * ratios along the line from (x0, y0) to (x1, y1), or between the circles\n * (x0, y0, r0) and (x1, y1, r1), in the shape's coordinates.\n */\nexport interface IGradient {\n\ttype: 'linear' | 'radial';\n\tcolors: string[];\n\tratios: number[];\n\tx0: number;\n\ty0: number;\n\tr0: number;\n\tx1: number;\n\ty1: number;\n\tr1: number;\n}\n\nfunction gradientOf(style: IDataMap): IGradient | null {\n\tconst type = style.type;\n\tconst colors = style.colors;\n\tconst ratios = style.ratios;\n\tif ((type !== 'linear' && type !== 'radial') || !Array.isArray(colors) || !Array.isArray(ratios)) {\n\t\treturn null;\n\t}\n\treturn {\n\t\ttype,\n\t\tcolors: colors.map(color => String(color)),\n\t\tratios: ratios.map(ratio => Number(ratio)),\n\t\tx0: num(style, 'x0'), y0: num(style, 'y0'), r0: type === 'radial' ? num(style, 'r0') : 0,\n\t\tx1: num(style, 'x1'), y1: num(style, 'y1'), r1: type === 'radial' ? num(style, 'r1') : 0\n\t};\n}\n\n/** Pixels a gradient is drawn across: along the line of a linear one, across the circles of a radial one */\nconst GRADIENT_SIZE = 256;\n\n/**\n * A gradient drawn into a canvas by the browser's own gradient (so its\n * colors are what canvas, and createjs, paints), as a texture that Pixi's\n * Graphics fills and strokes with through a matrix. `gradient` is the\n * gradient in the shape's coordinates, `local` the same gradient in the\n * texture's pixels, and `toShape` takes texture pixels to the shape's\n * coordinates. Outside the drawn area the texture's edge pixels repeat\n * (Pixi clamps), which is how canvas pads a gradient with its end colors.\n */\nexport class GradientTexture extends PIXI.Texture {\n\treadonly gradient: IGradient;\n\treadonly local: IGradient;\n\treadonly toShape: PIXI.Matrix;\n\n\tconstructor(canvas: HTMLCanvasElement, gradient: IGradient, local: IGradient, toShape: PIXI.Matrix) {\n\t\tsuper(PIXI.BaseTexture.from(canvas));\n\t\tthis.gradient = gradient;\n\t\tthis.local = local;\n\t\tthis.toShape = toShape;\n\t}\n}\n\n/** Gradient textures by their gradient, shared by every drawing that uses the same gradient */\nconst gradientTextures = new Map<string, GradientTexture | null>();\n\nfunction gradientTexture(gradient: IGradient): GradientTexture | null {\n\tconst key = JSON.stringify(gradient);\n\tconst known = gradientTextures.get(key);\n\tif (known !== undefined) {\n\t\treturn known;\n\t}\n\tconst texture = gradient.type === 'linear' ? linearGradientTexture(gradient) : radialGradientTexture(gradient);\n\tgradientTextures.set(key, texture);\n\treturn texture;\n}\n\nfunction paintGradient(canvas: HTMLCanvasElement, local: IGradient): void {\n\tconst context = canvas.getContext('2d');\n\tif (!context) {\n\t\treturn;\n\t}\n\tconst paint = local.type === 'linear'\n\t\t? context.createLinearGradient(local.x0, local.y0, local.x1, local.y1)\n\t\t: context.createRadialGradient(local.x0, local.y0, local.r0, local.x1, local.y1, local.r1);\n\tlocal.colors.forEach((color, i) => {\n\t\tpaint.addColorStop(local.ratios[i], color);\n\t});\n\tcontext.fillStyle = paint;\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n}\n\n/**\n * A linear gradient drawn from the left edge to the right edge of a canvas\n * one pixel high. The texture's x axis runs along the gradient's line and its\n * y axis across it (every row is the same, so how far across does not matter).\n */\nfunction linearGradientTexture(gradient: IGradient): GradientTexture | null {\n\tconst dx = gradient.x1 - gradient.x0;\n\tconst dy = gradient.y1 - gradient.y0;\n\tconst length = Math.sqrt(dx * dx + dy * dy);\n\tif (!length) {\n\t\treturn null;\n\t}\n\tconst canvas = document.createElement('canvas');\n\tcanvas.width = GRADIENT_SIZE;\n\tcanvas.height = 1;\n\tconst local: IGradient = {\n\t\ttype: 'linear', colors: gradient.colors, ratios: gradient.ratios,\n\t\tx0: 0, y0: 0, r0: 0, x1: GRADIENT_SIZE, y1: 0, r1: 0\n\t};\n\tpaintGradient(canvas, local);\n\tconst toShape = new PIXI.Matrix(dx / GRADIENT_SIZE, dy / GRADIENT_SIZE, -dy / length, dx / length, gradient.x0, gradient.y0);\n\treturn new GradientTexture(canvas, gradient, local, toShape);\n}\n\n/**\n * A radial gradient drawn into a square canvas covering both of its circles,\n * scaled to fit (the mapping is a scale and a move, so the circles stay\n * circles and every point keeps its place in the gradient).\n */\nfunction radialGradientTexture(gradient: IGradient): GradientTexture | null {\n\tconst left = Math.min(gradient.x0 - gradient.r0, gradient.x1 - gradient.r1);\n\tconst top = Math.min(gradient.y0 - gradient.r0, gradient.y1 - gradient.r1);\n\tconst right = Math.max(gradient.x0 + gradient.r0, gradient.x1 + gradient.r1);\n\tconst bottom = Math.max(gradient.y0 + gradient.r0, gradient.y1 + gradient.r1);\n\tconst size = Math.max(right - left, bottom - top);\n\tif (!(size > 0) || gradient.r1 === gradient.r0 && gradient.x0 === gradient.x1 && gradient.y0 === gradient.y1) {\n\t\treturn null;\n\t}\n\tconst scale = GRADIENT_SIZE / size;\n\tconst canvas = document.createElement('canvas');\n\tcanvas.width = GRADIENT_SIZE;\n\tcanvas.height = GRADIENT_SIZE;\n\tconst local: IGradient = {\n\t\ttype: 'radial', colors: gradient.colors, ratios: gradient.ratios,\n\t\tx0: (gradient.x0 - left) * scale, y0: (gradient.y0 - top) * scale, r0: gradient.r0 * scale,\n\t\tx1: (gradient.x1 - left) * scale, y1: (gradient.y1 - top) * scale, r1: gradient.r1 * scale\n\t};\n\tpaintGradient(canvas, local);\n\tconst toShape = new PIXI.Matrix(1 / scale, 0, 0, 1 / scale, left, top);\n\treturn new GradientTexture(canvas, gradient, local, toShape);\n}\n\nfunction drawPath(target: PIXI.Graphics, command: IGraphicsCommandDef): void {\n\tconst p = command.props;\n\tswitch (command.type) {\n\t\tcase 'MoveTo':\n\t\t\ttarget.moveTo(num(p, 'x'), num(p, 'y'));\n\t\t\tbreak;\n\t\tcase 'LineTo':\n\t\t\ttarget.lineTo(num(p, 'x'), num(p, 'y'));\n\t\t\tbreak;\n\t\tcase 'QuadraticCurveTo':\n\t\t\ttarget.quadraticCurveTo(num(p, 'cpx'), num(p, 'cpy'), num(p, 'x'), num(p, 'y'));\n\t\t\tbreak;\n\t\tcase 'BezierCurveTo':\n\t\t\ttarget.bezierCurveTo(num(p, 'cp1x'), num(p, 'cp1y'), num(p, 'cp2x'), num(p, 'cp2y'), num(p, 'x'), num(p, 'y'));\n\t\t\tbreak;\n\t\tcase 'ArcTo':\n\t\t\ttarget.arcTo(num(p, 'x1'), num(p, 'y1'), num(p, 'x2'), num(p, 'y2'), num(p, 'radius'));\n\t\t\tbreak;\n\t\tcase 'Arc':\n\t\t\ttarget.arc(num(p, 'x'), num(p, 'y'), num(p, 'radius'), num(p, 'startAngle'), num(p, 'endAngle'), !!p.anticlockwise);\n\t\t\tbreak;\n\t\tcase 'ClosePath':\n\t\t\ttarget.closePath();\n\t\t\tbreak;\n\t\tcase 'Rect':\n\t\t\ttarget.drawRect(num(p, 'x'), num(p, 'y'), num(p, 'w'), num(p, 'h'));\n\t\t\tbreak;\n\t\tcase 'RoundRect':\n\t\t\ttarget.drawRoundedRect(num(p, 'x'), num(p, 'y'), num(p, 'w'), num(p, 'h'), num(p, 'radiusTL'));\n\t\t\tbreak;\n\t\tcase 'Circle':\n\t\t\ttarget.drawCircle(num(p, 'x'), num(p, 'y'), num(p, 'radius'));\n\t\t\tbreak;\n\t\tcase 'Ellipse': {\n\t\t\tconst w = num(p, 'w');\n\t\t\tconst h = num(p, 'h');\n\t\t\ttarget.drawEllipse(num(p, 'x') + w / 2, num(p, 'y') + h / 2, w / 2, h / 2);\n\t\t\tbreak;\n\t\t}\n\t\tcase 'PolyStar': {\n\t\t\tconst sides = num(p, 'sides');\n\t\t\tconst pointSize = num(p, 'pointSize');\n\t\t\tconst radius = num(p, 'radius');\n\t\t\tconst rotation = num(p, 'angle') / 180 * Math.PI;\n\t\t\tif (pointSize > 0 && pointSize < 1) {\n\t\t\t\ttarget.drawStar(num(p, 'x'), num(p, 'y'), sides, radius, radius * (1 - pointSize), rotation);\n\t\t\t} else {\n\t\t\t\ttarget.drawRegularPolygon(num(p, 'x'), num(p, 'y'), radius, sides, rotation);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * A path and the paint that follows it. createjs keeps drawing commands the\n * way canvas draws: a path (BeginPath, then path commands), then the Fill\n * and/or Stroke that paint it.\n */\ninterface IPathSegment {\n\tpath: IGraphicsCommandDef[];\n\tfill: IGraphicsCommandDef | null;\n\tstroke: IGraphicsCommandDef | null;\n\tstrokeStyle: IDataMap | null;\n}\n\nfunction pathSegments(commands: IGraphicsCommandDef[]): IPathSegment[] {\n\tconst segments: IPathSegment[] = [];\n\tlet path: IGraphicsCommandDef[] = [];\n\tlet fill: IGraphicsCommandDef | null = null;\n\tlet stroke: IGraphicsCommandDef | null = null;\n\tlet strokeStyle: IDataMap | null = null;\n\tlet painted = false;\n\n\tconst push = (): void => {\n\t\tif (path.length && (fill || stroke)) {\n\t\t\tsegments.push({ path, fill, stroke, strokeStyle });\n\t\t}\n\t};\n\n\tcommands.forEach(command => {\n\t\tif (command.type === 'BeginPath') {\n\t\t\tif (painted) {\n\t\t\t\tpush();\n\t\t\t\tpath = [];\n\t\t\t\tfill = stroke = null;\n\t\t\t\tpainted = false;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (PATH_COMMANDS.indexOf(command.type) >= 0) {\n\t\t\tif (painted) {\n\t\t\t\t// A path after paint without BeginPath continues the same path in canvas: what is painted so far is drawn, and the path goes on\n\t\t\t\tpush();\n\t\t\t\tpath = path.slice();\n\t\t\t\tfill = stroke = null;\n\t\t\t\tpainted = false;\n\t\t\t}\n\t\t\tpath.push(command);\n\t\t\treturn;\n\t\t}\n\t\tif (command.type === 'Fill') {\n\t\t\tfill = command;\n\t\t\tpainted = true;\n\t\t} else if (command.type === 'Stroke') {\n\t\t\tstroke = command;\n\t\t\tpainted = true;\n\t\t} else if (command.type === 'StrokeStyle') {\n\t\t\tstrokeStyle = command.props;\n\t\t}\n\t});\n\n\tpush();\n\treturn segments;\n}\n\n/** A Pixi Graphics that draws a geometry once (for working out holes, and for the shared geometries) */\nclass GeometryBuilder extends PIXI.Graphics {\n\tfinish(): void {\n\t\tthis.finishPoly();\n\t}\n}\n\nlet emptyGraphics: PIXI.Graphics | null = null;\n\n/** The geometry of a shape with no drawing, shared (kept by a Graphics that is never destroyed) */\nfunction getEmptyGeometry(): PIXI.GraphicsGeometry {\n\tif (!emptyGraphics) {\n\t\temptyGraphics = new PIXI.Graphics();\n\t}\n\treturn emptyGraphics.geometry;\n}\n\n/**\n * The subpaths of a filled path that cut holes: a subpath that starts inside\n * what the path's earlier subpaths cover (holes taken out) is a hole in it;\n * one that starts outside, or inside a hole, is a shape of its own. The\n * MoveTo commands that start holes are returned.\n */\nfunction findHoles(path: IGraphicsCommandDef[]): IGraphicsCommandDef[] {\n\tconst holes: IGraphicsCommandDef[] = [];\n\tconst probe = new GeometryBuilder();\n\tprobe.beginFill(0);\n\tlet first = true;\n\tlet inHole = false;\n\n\tpath.forEach(command => {\n\t\tif (command.type === 'MoveTo') {\n\t\t\tif (!first) {\n\t\t\t\tprobe.finish();\n\t\t\t\tconst inside = probe.geometry.containsPoint(new PIXI.Point(num(command.props, 'x'), num(command.props, 'y')));\n\t\t\t\tif (inside) {\n\t\t\t\t\tholes.push(command);\n\t\t\t\t\tif (!inHole) {\n\t\t\t\t\t\tprobe.beginHole();\n\t\t\t\t\t\tinHole = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (inHole) {\n\t\t\t\t\tprobe.endHole();\n\t\t\t\t\tinHole = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfirst = false;\n\t\t}\n\t\tdrawPath(probe, command);\n\t});\n\n\tprobe.destroy();\n\treturn holes;\n}\n\n/** Replays a path, cutting the holes (Pixi attaches a hole to the shape drawn before it) */\nfunction drawPathWithHoles(target: PIXI.Graphics, path: IGraphicsCommandDef[], holes: IGraphicsCommandDef[] | null): void {\n\tlet inHole = false;\n\tpath.forEach(command => {\n\t\tif (holes && command.type === 'MoveTo') {\n\t\t\tconst hole = holes.indexOf(command) >= 0;\n\t\t\tif (hole && !inHole) {\n\t\t\t\ttarget.beginHole();\n\t\t\t\tinHole = true;\n\t\t\t} else if (!hole && inHole) {\n\t\t\t\ttarget.endHole();\n\t\t\t\tinHole = false;\n\t\t\t}\n\t\t}\n\t\tdrawPath(target, command);\n\t});\n\tif (inHole) {\n\t\ttarget.endHole();\n\t}\n}\n\n/**\n * Draws createjs drawing commands into a Pixi Graphics. Pixi takes the paint\n * first, so each path is replayed under the paint that follows it, with the\n * holes canvas's nonzero fill would cut (holes: the MoveTo commands that\n * start holes, see Graphics.holes).\n */\nexport function drawCommands(target: PIXI.Graphics, commands: IGraphicsCommandDef[], textures: ITextureSource, holes?: IGraphicsCommandDef[] | null): void {\n\ttarget.clear();\n\n\tpathSegments(commands).forEach(segment => {\n\t\tconst fill = segment.fill ? paintOf(segment.fill.props.style, segment.fill.props.matrix, textures) : null;\n\t\tconst stroke = segment.stroke ? paintOf(segment.stroke.props.style, null, textures) : null;\n\t\tconst strokeStyle = segment.strokeStyle;\n\t\tif (!fill && !stroke) {\n\t\t\treturn;\n\t\t}\n\t\tif (stroke && strokeStyle) {\n\t\t\ttarget.lineTextureStyle({\n\t\t\t\twidth: num(strokeStyle, 'width'),\n\t\t\t\tcolor: stroke.color,\n\t\t\t\talpha: stroke.alpha,\n\t\t\t\ttexture: stroke.texture || PIXI.Texture.WHITE,\n\t\t\t\tmatrix: stroke.matrix || undefined,\n\t\t\t\tcap: lineCap(strokeStyle.caps),\n\t\t\t\tjoin: lineJoin(strokeStyle.joints),\n\t\t\t\tmiterLimit: typeof strokeStyle.miterLimit === 'number' ? strokeStyle.miterLimit : 10\n\t\t\t});\n\t\t} else {\n\t\t\ttarget.lineStyle(0);\n\t\t}\n\t\tif (fill) {\n\t\t\ttarget.beginTextureFill({ texture: fill.texture || PIXI.Texture.WHITE, color: fill.color, alpha: fill.alpha, matrix: fill.matrix || undefined });\n\t\t}\n\t\tdrawPathWithHoles(target, segment.path, fill ? holes || null : null);\n\t\tif (fill) {\n\t\t\ttarget.endFill();\n\t\t}\n\t});\n}\n\n/**\n * A drawing command as createjs keeps it (Graphics.MoveTo, Graphics.Fill, ...):\n * the command's own properties, with fill and stroke styles as objects whose\n * `props` are the arguments they were made with.\n */\nexport class GraphicsCommand {\n}\n\n/** The createjs drawing command class names */\nexport const GRAPHICS_COMMANDS = [\n\t'MoveTo', 'LineTo', 'ArcTo', 'Arc', 'QuadraticCurveTo', 'BezierCurveTo', 'Rect', 'ClosePath', 'BeginPath',\n\t'Fill', 'Stroke', 'StrokeStyle', 'StrokeDash', 'RoundRect', 'Circle', 'Ellipse', 'PolyStar'\n];\n\nconst COMMAND_CLASSES: { [type: string]: typeof GraphicsCommand } = {};\nGRAPHICS_COMMANDS.forEach(type => {\n\tCOMMAND_CLASSES[type] = class extends GraphicsCommand {};\n});\n\nconst MATRIX_KEYS = ['a', 'b', 'c', 'd', 'tx', 'ty'];\n\n/** A recorded command value as createjs holds it (images as image assets) */\ntype TCommandValue = string | number | boolean | null | IImageAsset | TCommandValue[] | ICommandValueMap;\n\ninterface ICommandValueMap {\n\t[key: string]: TCommandValue;\n}\n\nfunction toCommandValue(value: TDataValue, assets: ITextureSource): TCommandValue {\n\tif (Array.isArray(value)) {\n\t\treturn value.map(v => toCommandValue(v, assets));\n\t}\n\tif (!isDataMap(value)) {\n\t\treturn value;\n\t}\n\tconst keys = Object.keys(value);\n\tif (keys.length === 1 && typeof value.image === 'string') {\n\t\treturn assets.imageAsset(value.image);\n\t}\n\tif (keys.length === 2 && typeof value.sheet === 'string' && typeof value.frame === 'number') {\n\t\treturn assets.frameAsset(value.sheet, value.frame);\n\t}\n\tconst map: ICommandValueMap = {};\n\tif (keys.length === 6 && MATRIX_KEYS.every(key => typeof value[key] === 'number')) {\n\t\tMATRIX_KEYS.forEach(key => { map[key] = value[key]; });\n\t\treturn map;\n\t}\n\tkeys.forEach(key => { map[key] = toCommandValue(value[key], assets); });\n\treturn map;\n}\n\n/**\n * Draws the path of createjs drawing commands filled, ignoring their fills\n * and strokes: the shape a createjs mask clips with (all the drawing as one\n * path, with the holes named by holes, see Graphics.maskHoles).\n */\nexport function drawMaskPath(target: PIXI.Graphics, commands: IGraphicsCommandDef[], holes?: IGraphicsCommandDef[] | null): void {\n\ttarget.clear();\n\tconst path = commands.filter(command => PATH_COMMANDS.indexOf(command.type) >= 0);\n\tif (!path.length) {\n\t\treturn;\n\t}\n\ttarget.beginFill(0xffffff, 1);\n\tdrawPathWithHoles(target, path, holes || null);\n\ttarget.endFill();\n}\n\n/**\n * createjs-compatible Graphics holding the drawing commands of a definition.\n */\nexport class Graphics {\n\treadonly commands: IGraphicsCommandDef[];\n\treadonly textures: ITextureSource;\n\tprivate _instructions: GraphicsCommand[] | null = null;\n\tprivate _holes: IGraphicsCommandDef[] | null = null;\n\tprivate _maskHoles: IGraphicsCommandDef[] | null = null;\n\tprivate _geometry: GeometryBuilder | null = null;\n\tprivate _maskGeometry: GeometryBuilder | null = null;\n\n\tconstructor(commands: IGraphicsCommandDef[], textures: ITextureSource) {\n\t\tthis.commands = commands;\n\t\tthis.textures = textures;\n\t}\n\n\t/** The commands as createjs's command objects (made when first read) */\n\tget instructions(): GraphicsCommand[] {\n\t\tif (!this._instructions) {\n\t\t\tconst assets = this.textures;\n\t\t\tthis._instructions = this.commands.map(command => {\n\t\t\t\tconst CommandClass = COMMAND_CLASSES[command.type] || GraphicsCommand;\n\t\t\t\tconst instruction = new CommandClass();\n\t\t\t\tObject.keys(command.props).forEach(key => {\n\t\t\t\t\tconst value = toCommandValue(command.props[key], assets);\n\t\t\t\t\t// A gradient or bitmap style object carries its arguments as props\n\t\t\t\t\tReflect.set(instruction, key, key === 'style' && value !== null && typeof value === 'object' ? { props: value } : value);\n\t\t\t\t});\n\t\t\t\treturn instruction;\n\t\t\t});\n\t\t}\n\t\treturn this._instructions;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn !this.commands.length;\n\t}\n\n\t/**\n\t * The MoveTo commands that start holes in the filled paths (worked out once\n\t * per drawing and shared by every shape that shows it)\n\t */\n\tholes(): IGraphicsCommandDef[] {\n\t\tif (!this._holes) {\n\t\t\tconst holes: IGraphicsCommandDef[] = [];\n\t\t\tpathSegments(this.commands).forEach(segment => {\n\t\t\t\tif (segment.fill) {\n\t\t\t\t\tfindHoles(segment.path).forEach(command => holes.push(command));\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._holes = holes;\n\t\t}\n\t\treturn this._holes;\n\t}\n\n\t/**\n\t * The drawing as a Pixi geometry, drawn the first time it is asked for and\n\t * shared from then on by every shape that shows this drawing (a shape's\n\t * Pixi node must therefore not be drawn into: that would change it for all)\n\t */\n\tgeometry(): PIXI.GraphicsGeometry {\n\t\tif (!this._geometry) {\n\t\t\tconst builder = new GeometryBuilder();\n\t\t\tdrawCommands(builder, this.commands, this.textures, this.holes());\n\t\t\tbuilder.finish();\n\t\t\tthis._geometry = builder;\n\t\t}\n\t\treturn this._geometry.geometry;\n\t}\n\n\t/** The drawing as a mask (its path filled), shared the same way */\n\tmaskGeometry(): PIXI.GraphicsGeometry {\n\t\tif (!this._maskGeometry) {\n\t\t\tconst builder = new GeometryBuilder();\n\t\t\tdrawMaskPath(builder, this.commands, this.maskHoles());\n\t\t\tbuilder.finish();\n\t\t\tthis._maskGeometry = builder;\n\t\t}\n\t\treturn this._maskGeometry.geometry;\n\t}\n\n\t/** The holes of the drawing as a mask (all of it one path) */\n\tmaskHoles(): IGraphicsCommandDef[] {\n\t\tif (!this._maskHoles) {\n\t\t\tthis._maskHoles = findHoles(this.commands.filter(command => PATH_COMMANDS.indexOf(command.type) >= 0));\n\t\t}\n\t\treturn this._maskHoles;\n\t}\n}\n\nGRAPHICS_COMMANDS.forEach(type => {\n\tObject.defineProperty(Graphics, type, { value: COMMAND_CLASSES[type], enumerable: true });\n});\n\n/**\n * createjs-compatible Shape on a Pixi Graphics.\n */\nexport class Shape extends DisplayObject {\n\treadonly pixiGraphics: PixiGraphics;\n\tprivate _graphics: Graphics | null = null;\n\t/** The shape as a mask (made when first used as one), a child of this shape's node */\n\tprivate _maskGraphics: PixiGraphics | null = null;\n\n\tconstructor(graphics?: Graphics | null) {\n\t\tconst node = new PixiGraphics(graphics ? graphics.geometry() : getEmptyGeometry());\n\t\tsuper(node);\n\t\tthis.pixiGraphics = node;\n\t\tthis._graphics = graphics || null;\n\t}\n\n\tget graphics(): Graphics | null {\n\t\treturn this._graphics;\n\t}\n\n\tset graphics(value: Graphics | null) {\n\t\tif (value === this._graphics) {\n\t\t\treturn;\n\t\t}\n\t\tthis._graphics = value;\n\t\tthis.pixiGraphics.setGeometry(value ? value.geometry() : getEmptyGeometry());\n\t\tif (this._maskGraphics) {\n\t\t\tthis._maskGraphics.setGeometry(value ? value.maskGeometry() : getEmptyGeometry());\n\t\t}\n\t\tthis._maskTargets.forEach(target => target._updatePixiMask());\n\t}\n\n\t_clipsAsMask(): boolean {\n\t\treturn !!(this._graphics && !this._graphics.isEmpty());\n\t}\n\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tthis.pixiGraphics.setBlendMode(mode);\n\t}\n\n\t/**\n\t * createjs clips with the shape's path alone (Graphics.drawAsPath, then\n\t * clip), whatever its fill and stroke; published masks are paths with no\n\t * fill. The mask node is that path, filled. It is a child of the shape's\n\t * node, so it moves with the shape (the shape's own node is not drawn while\n\t * it serves as a mask).\n\t */\n\t_pixiMaskNode(): PIXI.Container {\n\t\tlet node = this._maskGraphics;\n\t\tif (!node) {\n\t\t\tnode = this._maskGraphics = new PixiGraphics(this._graphics ? this._graphics.maskGeometry() : getEmptyGeometry());\n\t\t\t// Never hit by the pointer, as createjs never hits a mask\n\t\t\tnode.hitArea = NO_HIT_AREA;\n\t\t\tthis.pixiGraphics.addChild(node);\n\t\t}\n\t\treturn node;\n\t}\n\n\t_releaseMaskNode(): void {\n\t\tconst node = this._maskGraphics;\n\t\tif (node && !node.isMask) {\n\t\t\tnode.renderable = false;\n\t\t}\n\t}\n\n\ttoString(): string {\n\t\treturn '[Shape (name=' + this.name + ')]';\n\t}\n}\n\n/**\n * A frame of a sprite sheet, as createjs describes it.\n */\nexport interface ISpriteFrame {\n\timage: IImageAsset;\n\trect: Rectangle;\n}\n\n/**\n * An image as content sees it (`src` names it).\n */\nexport interface IImageAsset {\n\tsrc: string;\n\ttexture: PIXI.Texture;\n}\n\n/**\n * createjs-compatible SpriteSheet: frames cut from an atlas image.\n */\nexport class SpriteSheet {\n\treadonly frames: ISpriteFrame[];\n\treadonly textures: PIXI.Texture[];\n\tframerate = 0;\n\tcomplete = true;\n\n\tconstructor(image: IImageAsset, rects: number[][]) {\n\t\tthis.frames = rects.map(rect => ({ image, rect: new Rectangle(rect[0], rect[1], rect[2], rect[3]) }));\n\t\tthis.textures = this.frames.map(frame => new PIXI.Texture(image.texture.baseTexture, frame.rect.toPixi()));\n\t}\n\n\tgetFrame(index: number): ISpriteFrame | null {\n\t\treturn this.frames[index] || null;\n\t}\n\n\tgetNumFrames(): number {\n\t\treturn this.frames.length;\n\t}\n}\n\n/**\n * createjs-compatible Sprite (frame by frame from a sprite sheet).\n */\nexport class Sprite extends DisplayObject {\n\treadonly pixiSprite: PixiSprite;\n\tspriteSheet: SpriteSheet;\n\tcurrentFrame = 0;\n\tpaused = false;\n\tframerate = 0;\n\n\tconstructor(spriteSheet: SpriteSheet, frame?: number) {\n\t\tconst node = new PixiSprite(PIXI.Texture.EMPTY);\n\t\tsuper(node);\n\t\tthis.pixiSprite = node;\n\t\tthis.spriteSheet = spriteSheet;\n\t\tif (frame != null) {\n\t\t\tthis.gotoAndPlay(frame);\n\t\t}\n\t}\n\n\tplay(): void { this.paused = false; }\n\tstop(): void { this.paused = true; }\n\n\tgotoAndPlay(frame: number): void {\n\t\tthis.paused = false;\n\t\tthis._goto(frame);\n\t}\n\n\tgotoAndStop(frame: number): void {\n\t\tthis.paused = true;\n\t\tthis._goto(frame);\n\t}\n\n\tadvance(): void {\n\t\tconst count = this.spriteSheet.getNumFrames();\n\t\tthis._goto(count ? (this.currentFrame + 1) % count : 0);\n\t}\n\n\t_goto(frame: number): void {\n\t\tthis.currentFrame = frame;\n\t\tconst texture = this.spriteSheet.textures[frame];\n\t\tthis.pixiSprite.texture = texture || PIXI.Texture.EMPTY;\n\t}\n\n\t_tick(event: Event): void {\n\t\tif (!this.paused) {\n\t\t\tthis.advance();\n\t\t}\n\t\tsuper._tick(event);\n\t}\n\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tthis.pixiSprite.blendMode = mode;\n\t}\n\n\ttoString(): string {\n\t\treturn '[Sprite (name=' + this.name + ')]';\n\t}\n}\n\n/**\n * createjs-compatible Bitmap.\n */\nexport class Bitmap extends DisplayObject {\n\treadonly pixiSprite: PixiSprite;\n\tprivate _image: IImageAsset | null = null;\n\tprivate _sourceRect: Rectangle | null = null;\n\n\tconstructor(image?: IImageAsset | null) {\n\t\tconst node = new PixiSprite(PIXI.Texture.EMPTY);\n\t\tsuper(node);\n\t\tthis.pixiSprite = node;\n\t\tthis.image = image || null;\n\t}\n\n\tget image(): IImageAsset | null { return this._image; }\n\tset image(value: IImageAsset | null) {\n\t\tthis._image = value;\n\t\tthis._updateTexture();\n\t}\n\n\tget sourceRect(): Rectangle | null { return this._sourceRect; }\n\tset sourceRect(value: Rectangle | null) {\n\t\tthis._sourceRect = value;\n\t\tthis._updateTexture();\n\t}\n\n\tprivate _updateTexture(): void {\n\t\tconst image = this._image;\n\t\tif (!image) {\n\t\t\tthis.pixiSprite.texture = PIXI.Texture.EMPTY;\n\t\t\treturn;\n\t\t}\n\t\tconst rect = this._sourceRect;\n\t\tthis.pixiSprite.texture = rect ? new PIXI.Texture(image.texture.baseTexture, rect.toPixi()) : image.texture;\n\t}\n\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tthis.pixiSprite.blendMode = mode;\n\t}\n\n\ttoString(): string {\n\t\treturn '[Bitmap (name=' + this.name + ')]';\n\t}\n}\n\ninterface IFontParts {\n\tfontStyle: string;\n\tfontWeight: string;\n\tfontSize: number;\n\tfontFamily: string;\n}\n\n/**\n * The parts of a CSS font shorthand (\"bold 20px 'Nirmala UI'\").\n */\nfunction parseFont(font: string): IFontParts {\n\tconst match = /^\\s*(.*?)\\s*(\\d+(?:\\.\\d+)?)px(?:\\/\\S+)?\\s+(.+)$/.exec(font);\n\tif (!match) {\n\t\treturn { fontStyle: 'normal', fontWeight: 'normal', fontSize: 10, fontFamily: 'sans-serif' };\n\t}\n\tconst words = match[1].split(/\\s+/);\n\tlet fontStyle = 'normal';\n\tlet fontWeight = 'normal';\n\twords.forEach(word => {\n\t\tif (word === 'italic' || word === 'oblique') {\n\t\t\tfontStyle = word;\n\t\t} else if (word === 'bold' || word === 'bolder' || word === 'lighter' || /^\\d{3}$/.test(word)) {\n\t\t\tfontWeight = word;\n\t\t}\n\t});\n\treturn { fontStyle, fontWeight, fontSize: parseFloat(match[2]), fontFamily: match[3].replace(/['\"]/g, '') };\n}\n\nconst TEXT_ANCHOR_X: { [align: string]: number } = { left: 0, start: 0, center: 0.5, right: 1, end: 1 };\nconst TEXT_ANCHOR_Y: { [baseline: string]: number } = { top: 0, hanging: 0, middle: 0.5, alphabetic: 0.8, ideographic: 0.9, bottom: 1 };\n\n/**\n * The lines createjs draws a text in (Text._drawText): the text split at line\n * breaks (CR LF, CR, LF), then a line wider than lineWidth broken at whitespace\n * only, words added while they fit (a word wider than lineWidth stays whole).\n * No breaking at all when lineWidth is null.\n */\nexport function breakLines(text: string, lineWidth: number | null, measure: (line: string) => number): string[] {\n\tconst lines: string[] = [];\n\tString(text).split(/(?:\\r\\n|\\r|\\n)/).forEach(source => {\n\t\tlet line = source;\n\t\tif (lineWidth != null && measure(line) > lineWidth) {\n\t\t\tconst words = line.split(/(\\s)/);\n\t\t\tline = words[0];\n\t\t\tlet width = measure(line);\n\t\t\tfor (let i = 1; i < words.length; i += 2) {\n\t\t\t\tconst wordWidth = measure(words[i] + words[i + 1]);\n\t\t\t\tif (width + wordWidth > lineWidth) {\n\t\t\t\t\tlines.push(line);\n\t\t\t\t\tline = words[i + 1];\n\t\t\t\t\twidth = measure(line);\n\t\t\t\t} else {\n\t\t\t\t\tline += words[i] + words[i + 1];\n\t\t\t\t\twidth += wordWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlines.push(line);\n\t});\n\treturn lines;\n}\n\n/**\n * createjs-compatible Text on a Pixi Text.\n */\nexport class Text extends DisplayObject {\n\treadonly pixiText: PixiText;\n\tprivate _text = '';\n\t// As createjs: what the constructor is given, kept as given (none: null); drawing falls back to\n\t// 10px sans-serif and black\n\tprivate _font: string | null = null;\n\tprivate _color: string | null = null;\n\tprivate _textAlign = 'left';\n\tprivate _textBaseline = 'top';\n\tprivate _lineHeight = 0;\n\tprivate _lineWidth: number | null = null;\n\tprivate _maxWidth: number | null = null;\n\tprivate _outline = 0;\n\n\tconstructor(text?: string, font?: string, color?: string) {\n\t\tconst node = new PixiText('');\n\t\t// Pixi draws text into an image and places that image: at a position between pixels it is\n\t\t// blurred by sampling, where canvas (createjs) draws the glyphs sharp at any position\n\t\tnode.roundPixels = true;\n\t\tsuper(node);\n\t\tthis.pixiText = node;\n\t\tthis._text = text == null ? '' : String(text);\n\t\tthis._font = font == null ? null : font;\n\t\tthis._color = color == null ? null : color;\n\t\tthis._updateText();\n\t}\n\n\tget text(): string { return this._text; }\n\tset text(value: string) { this._text = value; this._updateText(); }\n\tget font(): string | null { return this._font; }\n\tset font(value: string | null) { this._font = value; this._updateText(); }\n\tget color(): string | null { return this._color; }\n\tset color(value: string | null) { this._color = value; this._updateText(); }\n\tget textAlign(): string { return this._textAlign; }\n\tset textAlign(value: string) { this._textAlign = value; this._updateText(); }\n\tget textBaseline(): string { return this._textBaseline; }\n\tset textBaseline(value: string) { this._textBaseline = value; this._updateText(); }\n\tget lineHeight(): number { return this._lineHeight; }\n\tset lineHeight(value: number) { this._lineHeight = value; this._updateText(); }\n\tget lineWidth(): number | null { return this._lineWidth; }\n\tset lineWidth(value: number | null) { this._lineWidth = value; this._updateText(); }\n\tget maxWidth(): number | null { return this._maxWidth; }\n\tset maxWidth(value: number | null) { this._maxWidth = value; this._updateText(); }\n\tget outline(): number { return this._outline; }\n\tset outline(value: number) { this._outline = value; this._updateText(); }\n\n\tprivate _updateText(): void {\n\t\tconst node = this.pixiText;\n\t\tconst font = parseFont(this._font || '10px sans-serif');\n\t\tconst color = parseColor(this._color || '#000');\n\t\tconst style = new PIXI.TextStyle({\n\t\t\tfontStyle: font.fontStyle,\n\t\t\tfontWeight: font.fontWeight,\n\t\t\tfontSize: font.fontSize,\n\t\t\tfontFamily: font.fontFamily,\n\t\t\tfill: this._outline ? 'rgba(0,0,0,0)' : (color ? color.color : 0),\n\t\t\tstroke: color ? color.color : 0,\n\t\t\tstrokeThickness: this._outline || 0,\n\t\t\talign: this._textAlign === 'center' ? 'center' : (this._textAlign === 'right' || this._textAlign === 'end') ? 'right' : 'left',\n\t\t\t// Lines are broken here the way createjs breaks them, not by Pixi's word wrap\n\t\t\twordWrap: false\n\t\t});\n\t\tconst measure = (line: string): number => PIXI.TextMetrics.measureText(line, style, false).width;\n\t\t// createjs's line height when none is set: 1.2 times the width of an M\n\t\tstyle.lineHeight = this._lineHeight || 1.2 * measure('M');\n\t\tnode.style = style;\n\t\tnode.text = breakLines(this._text, this._lineWidth, measure).join('\\n');\n\t\tconst anchorX = TEXT_ANCHOR_X[this._textAlign];\n\t\tconst anchorY = TEXT_ANCHOR_Y[this._textBaseline];\n\t\tnode.anchor.set(anchorX === undefined ? 0 : anchorX, anchorY === undefined ? 0 : anchorY);\n\t}\n\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tthis.pixiText.blendMode = mode;\n\t}\n\n\ttoString(): string {\n\t\treturn '[Text (text=' + this._text + ')]';\n\t}\n}\n\n/**\n * createjs-compatible ColorFilter on a Pixi ColorMatrixFilter.\n */\nexport class ColorFilter {\n\treadonly pixiFilter: PIXI.filters.ColorMatrixFilter;\n\tprivate _values: number[];\n\n\tconstructor(redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaMultiplier?: number,\n\t\tredOffset?: number, greenOffset?: number, blueOffset?: number, alphaOffset?: number) {\n\t\tthis.pixiFilter = new PIXI.filters.ColorMatrixFilter();\n\t\tthis._values = [\n\t\t\tredMultiplier == null ? 1 : redMultiplier,\n\t\t\tgreenMultiplier == null ? 1 : greenMultiplier,\n\t\t\tblueMultiplier == null ? 1 : blueMultiplier,\n\t\t\talphaMultiplier == null ? 1 : alphaMultiplier,\n\t\t\tredOffset || 0, greenOffset || 0, blueOffset || 0, alphaOffset || 0\n\t\t];\n\t\tthis._updateMatrix();\n\t}\n\n\tget redMultiplier(): number { return this._values[0]; }\n\tset redMultiplier(value: number) { this._set(0, value); }\n\tget greenMultiplier(): number { return this._values[1]; }\n\tset greenMultiplier(value: number) { this._set(1, value); }\n\tget blueMultiplier(): number { return this._values[2]; }\n\tset blueMultiplier(value: number) { this._set(2, value); }\n\tget alphaMultiplier(): number { return this._values[3]; }\n\tset alphaMultiplier(value: number) { this._set(3, value); }\n\tget redOffset(): number { return this._values[4]; }\n\tset redOffset(value: number) { this._set(4, value); }\n\tget greenOffset(): number { return this._values[5]; }\n\tset greenOffset(value: number) { this._set(5, value); }\n\tget blueOffset(): number { return this._values[6]; }\n\tset blueOffset(value: number) { this._set(6, value); }\n\tget alphaOffset(): number { return this._values[7]; }\n\tset alphaOffset(value: number) { this._set(7, value); }\n\n\tprivate _set(index: number, value: number): void {\n\t\tthis._values[index] = value;\n\t\tthis._updateMatrix();\n\t}\n\n\tprivate _updateMatrix(): void {\n\t\tconst v = this._values;\n\t\tconst m = this.pixiFilter.matrix;\n\t\tfor (let i = 0; i < 20; i++) {\n\t\t\tm[i] = 0;\n\t\t}\n\t\tm[0] = v[0];\n\t\tm[6] = v[1];\n\t\tm[12] = v[2];\n\t\tm[18] = v[3];\n\t\tm[4] = v[4] / 255;\n\t\tm[9] = v[5] / 255;\n\t\tm[14] = v[6] / 255;\n\t\tm[19] = v[7] / 255;\n\t}\n\n\ttoString(): string {\n\t\treturn '[ColorFilter]';\n\t}\n}\n\n/**\n * Members ButtonHelper needs from its target (a MovieClip).\n */\nexport interface IButtonTarget extends Container {\n\tpaused: boolean;\n\tactionsEnabled: boolean;\n\tgotoAndPlay(frame: string | number): void;\n\tgotoAndStop(frame: string | number): void;\n\t_reset(): void;\n}\n\n/**\n * createjs-compatible ButtonHelper: sends its target to the out / over /\n * down frames on mouse events, and stops it on the out frame from the start.\n */\nexport class ButtonHelper {\n\treadonly target: IButtonTarget;\n\toverLabel: string | number;\n\toutLabel: string | number;\n\tdownLabel: string | number;\n\tplay: boolean;\n\t_isPressed = false;\n\t_isOver = false;\n\t_enabled = false;\n\tprivate _originalReset: (() => void) | null = null;\n\n\tconstructor(target: IButtonTarget, outLabel?: string | number | null, overLabel?: string | number | null, downLabel?: string | number | null,\n\t\tplay?: boolean, hitArea?: IButtonTarget | null, hitLabel?: string | number | null) {\n\t\tthis.target = target;\n\t\tthis.overLabel = overLabel == null ? 'over' : overLabel;\n\t\tthis.outLabel = outLabel == null ? 'out' : outLabel;\n\t\tthis.downLabel = downLabel == null ? 'down' : downLabel;\n\t\tthis.play = !!play;\n\t\ttarget.mouseChildren = false;\n\t\tthis.enabled = true;\n\t\tthis.handleEvent(new Event(''));\n\t\tif (hitArea) {\n\t\t\t// As createjs: only a truthy label sends the hit area there (frame 0 leaves it as it is)\n\t\t\tif (hitLabel) {\n\t\t\t\thitArea.actionsEnabled = false;\n\t\t\t\thitArea.gotoAndStop(hitLabel);\n\t\t\t}\n\t\t\ttarget.hitArea = hitArea;\n\t\t}\n\t}\n\n\tget enabled(): boolean { return this._enabled; }\n\tset enabled(value: boolean) {\n\t\tif (value === this._enabled) {\n\t\t\treturn;\n\t\t}\n\t\tconst target = this.target;\n\t\tthis._enabled = value;\n\t\tif (value) {\n\t\t\ttarget.cursor = 'pointer';\n\t\t\ttarget.addEventListener('rollover', this);\n\t\t\ttarget.addEventListener('rollout', this);\n\t\t\ttarget.addEventListener('mousedown', this);\n\t\t\ttarget.addEventListener('pressup', this);\n\t\t\t// The target keeps its paused state when its timeline resets it on re-entry\n\t\t\tconst reset = target._reset;\n\t\t\tthis._originalReset = reset;\n\t\t\ttarget._reset = function (): void {\n\t\t\t\tconst paused = target.paused;\n\t\t\t\treset.call(target);\n\t\t\t\ttarget.paused = paused;\n\t\t\t};\n\t\t} else {\n\t\t\ttarget.cursor = null;\n\t\t\ttarget.removeEventListener('rollover', this);\n\t\t\ttarget.removeEventListener('rollout', this);\n\t\t\ttarget.removeEventListener('mousedown', this);\n\t\t\ttarget.removeEventListener('pressup', this);\n\t\t\tconst original = this._originalReset;\n\t\t\tif (original) {\n\t\t\t\ttarget._reset = original;\n\t\t\t\tthis._originalReset = null;\n\t\t\t}\n\t\t}\n\t}\n\n\thandleEvent(event: Event): void {\n\t\tconst type = event.type;\n\t\tlet label: string | number;\n\t\tif (type === 'mousedown') {\n\t\t\tthis._isPressed = true;\n\t\t\tlabel = this.downLabel;\n\t\t} else if (type === 'pressup') {\n\t\t\tthis._isPressed = false;\n\t\t\tlabel = this._isOver ? this.overLabel : this.outLabel;\n\t\t} else if (type === 'rollover') {\n\t\t\tthis._isOver = true;\n\t\t\tlabel = this._isPressed ? this.downLabel : this.overLabel;\n\t\t} else {\n\t\t\tthis._isOver = false;\n\t\t\tlabel = this._isPressed ? this.overLabel : this.outLabel;\n\t\t}\n\t\tif (this.play) {\n\t\t\tthis.target.gotoAndPlay(label);\n\t\t} else {\n\t\t\tthis.target.gotoAndStop(label);\n\t\t}\n\t}\n\n\ttoString(): string {\n\t\treturn '[ButtonHelper]';\n\t}\n}\n","/**\n * Semantic version numbers and ranges, as far as the version checks of\n * definitions and runtime content need them: versions are MAJOR.MINOR.PATCH,\n * and ranges are written as npm writes them (`1.2.3`, `1.x`, `^1.2.0`,\n * `~1.2.0`, `>=1.0.0 <2.0.0`, `0.x || 1.x`). Pre-release tags are not handled.\n */\n\ntype TVersion = [number, number, number];\n\n/** A version as its three numbers, or null when it is not MAJOR.MINOR.PATCH */\nexport function parseVersion(text: string): TVersion | null {\n\tconst match = /^\\s*v?(\\d+)\\.(\\d+)\\.(\\d+)\\s*$/.exec(text);\n\treturn match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;\n}\n\nfunction compareParsed(a: TVersion, b: TVersion): number {\n\tfor (let i = 0; i < 3; i++) {\n\t\tif (a[i] !== b[i]) {\n\t\t\treturn a[i] < b[i] ? -1 : 1;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/** -1, 0 or 1 as a is lower than, the same as or higher than b (both have to be versions) */\nexport function compareVersions(a: string, b: string): number {\n\tconst pa = parseVersion(a);\n\tconst pb = parseVersion(b);\n\tif (!pa || !pb) {\n\t\tthrow new Error('not a version: ' + (pa ? b : a));\n\t}\n\treturn compareParsed(pa, pb);\n}\n\n/** A test on a version: the version compared with a bound */\ninterface IComparator {\n\top: '>=' | '<';\n\tbound: TVersion;\n}\n\n/** A partial version (1, 1.2, 1.x, *): the numbers given, the rest left open */\nfunction parsePartial(text: string): number[] | null {\n\tif (text === '*' || text === 'x' || text === 'X') {\n\t\treturn [];\n\t}\n\tconst parts = text.split('.');\n\tif (parts.length > 3) {\n\t\treturn null;\n\t}\n\tconst numbers: number[] = [];\n\tfor (let i = 0; i < parts.length; i++) {\n\t\tconst part = parts[i];\n\t\tif (part === 'x' || part === 'X' || part === '*') {\n\t\t\tbreak;\n\t\t}\n\t\tif (!/^\\d+$/.test(part)) {\n\t\t\treturn null;\n\t\t}\n\t\tnumbers.push(Number(part));\n\t}\n\treturn numbers;\n}\n\nfunction lowest(numbers: number[]): TVersion {\n\treturn [numbers[0] || 0, numbers[1] || 0, numbers[2] || 0];\n}\n\n/** The first version above every version the given numbers start (1.2 -> 1.3.0); null for none (*) */\nfunction above(numbers: number[]): TVersion | null {\n\tif (numbers.length === 0) {\n\t\treturn null;\n\t}\n\tif (numbers.length === 1) {\n\t\treturn [numbers[0] + 1, 0, 0];\n\t}\n\tif (numbers.length === 2) {\n\t\treturn [numbers[0], numbers[1] + 1, 0];\n\t}\n\treturn [numbers[0], numbers[1], numbers[2] + 1];\n}\n\n/** The tests one word of a range stands for, or null when the word is not understood */\nfunction parseComparator(word: string): IComparator[] | null {\n\tconst match = /^(\\^|~|>=|<=|>|<|=)?(.+)$/.exec(word);\n\tif (!match) {\n\t\treturn null;\n\t}\n\tconst op = match[1] || '=';\n\tconst numbers = parsePartial(match[2]);\n\tif (!numbers) {\n\t\treturn null;\n\t}\n\tconst low = lowest(numbers);\n\tconst result: IComparator[] = [];\n\tconst atLeast = (bound: TVersion): void => {\n\t\tresult.push({ op: '>=', bound });\n\t};\n\tconst below = (bound: TVersion | null): void => {\n\t\tif (bound) {\n\t\t\tresult.push({ op: '<', bound });\n\t\t}\n\t};\n\tif (op === '=') {\n\t\tatLeast(low);\n\t\tbelow(above(numbers));\n\t} else if (op === '^') {\n\t\t// The left-most non-zero number given stays the same (^1.2.3 <2.0.0, ^0.2.3 <0.3.0, ^0.0.3 <0.0.4)\n\t\tlet fixed = 0;\n\t\twhile (fixed < numbers.length - 1 && numbers[fixed] === 0) {\n\t\t\tfixed++;\n\t\t}\n\t\tatLeast(low);\n\t\tbelow(above(numbers.slice(0, fixed + 1)));\n\t} else if (op === '~') {\n\t\tatLeast(low);\n\t\tbelow(above(numbers.slice(0, numbers.length > 1 ? 2 : 1)));\n\t} else if (op === '>=') {\n\t\tatLeast(low);\n\t} else if (op === '>') {\n\t\tconst next = above(numbers);\n\t\tif (!next) {\n\t\t\treturn null;\n\t\t}\n\t\tatLeast(next);\n\t} else if (op === '<') {\n\t\tbelow(low);\n\t} else {\n\t\t// <=\n\t\tbelow(above(numbers));\n\t}\n\treturn result;\n}\n\n/** Whether a version is in a range (npm's notation, see above); a range not understood throws */\nexport function satisfies(version: string, range: string): boolean {\n\tconst parsed = parseVersion(version);\n\tif (!parsed) {\n\t\treturn false;\n\t}\n\treturn range.split('||').some(set => {\n\t\tconst words = set.trim().split(/\\s+/).filter(word => word !== '');\n\t\tif (!words.length) {\n\t\t\tthrow new Error('not a version range: ' + range);\n\t\t}\n\t\treturn words.every(word => {\n\t\t\tconst comparators = parseComparator(word);\n\t\t\tif (!comparators) {\n\t\t\t\tthrow new Error('not a version range: ' + range);\n\t\t\t}\n\t\t\treturn comparators.every(c => {\n\t\t\t\tconst order = compareParsed(parsed, c.bound);\n\t\t\t\treturn c.op === '>=' ? order >= 0 : order < 0;\n\t\t\t});\n\t\t});\n\t});\n}\n\n/**\n * Whether data a reader is given can be read: `error` when its writer's\n * version is outside the range the reader reads, `warning` when it is in the\n * range but newer than the version the reader knows of (the data may hold\n * what the reader does not know and leaves out). Both null when it reads.\n */\nexport interface IVersionCheck {\n\terror: string | null;\n\twarning: string | null;\n\t/** With an error: whether the writer is newer than the reader (update the reader) or older (write the data again) */\n\tnewer: boolean;\n}\n\nexport function checkVersion(version: string, range: string, known: string): IVersionCheck {\n\tconst parsed = parseVersion(version);\n\tif (!parsed) {\n\t\treturn { error: 'no version (' + JSON.stringify(version) + ')', warning: null, newer: false };\n\t}\n\tconst newer = compareVersions(version, known) > 0;\n\tif (!satisfies(version, range)) {\n\t\treturn { error: version + ' is outside ' + range, warning: null, newer };\n\t}\n\treturn { error: null, warning: newer ? version + ' is newer than ' + known : null, newer };\n}\n","/** The version of this package (written in from package.json when the package is built) */\nexport const VERSION: string = '__PACKAGE_VERSION__';\n","/**\n * The eases of CreateJS (createjs.Ease), computed as CreateJS computes them,\n * by name. Runtime content names the ease of an interpolated stretch of a\n * tween; the player computes the stretch's values with it once, when a symbol's\n * class is made. `get:<amount>` is Ease.get(amount) (Animate's classic ease).\n */\n\nexport type TEase = (t: number) => number;\n\nfunction powIn(pow: number): TEase {\n\treturn t => Math.pow(t, pow);\n}\n\nfunction powOut(pow: number): TEase {\n\treturn t => 1 - Math.pow(1 - t, pow);\n}\n\nfunction powInOut(pow: number): TEase {\n\treturn t => ((t *= 2) < 1 ? 0.5 * Math.pow(t, pow) : 1 - 0.5 * Math.abs(Math.pow(2 - t, pow)));\n}\n\nfunction backIn(amount: number): TEase {\n\treturn t => t * t * ((amount + 1) * t - amount);\n}\n\nfunction backOut(amount: number): TEase {\n\treturn t => --t * t * ((amount + 1) * t + amount) + 1;\n}\n\nfunction backInOut(amount: number): TEase {\n\tamount *= 1.525;\n\treturn t => ((t *= 2) < 1 ? 0.5 * (t * t * ((amount + 1) * t - amount)) : 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2));\n}\n\nfunction elasticIn(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tif (t == 0 || t == 1) {\n\t\t\treturn t;\n\t\t}\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));\n\t};\n}\n\nfunction elasticOut(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tif (t == 0 || t == 1) {\n\t\t\treturn t;\n\t\t}\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn amplitude * Math.pow(2, -10 * t) * Math.sin((t - s) * pi2 / period) + 1;\n\t};\n}\n\nfunction elasticInOut(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn (t *= 2) < 1\n\t\t\t? -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period))\n\t\t\t: amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * 0.5 + 1;\n\t};\n}\n\nfunction bounceOut(t: number): number {\n\treturn 1 / 2.75 > t ? 7.5625 * t * t\n\t\t: 2 / 2.75 > t ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75\n\t\t: 2.5 / 2.75 > t ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375\n\t\t: 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;\n}\n\nfunction bounceIn(t: number): number {\n\treturn 1 - bounceOut(1 - t);\n}\n\n/** Ease.get(amount): Animate's classic ease, amount from -1 (in) to 1 (out) */\nfunction classic(amount: number): TEase {\n\tamount = amount < -1 ? -1 : amount > 1 ? 1 : amount;\n\treturn t => (amount == 0 ? t : amount < 0 ? t * (t * -amount + 1 + amount) : t * ((2 - t) * amount + (1 - amount)));\n}\n\nconst EASES: { [name: string]: TEase } = {\n\tlinear: t => t,\n\tquadIn: powIn(2), quadOut: powOut(2), quadInOut: powInOut(2),\n\tcubicIn: powIn(3), cubicOut: powOut(3), cubicInOut: powInOut(3),\n\tquartIn: powIn(4), quartOut: powOut(4), quartInOut: powInOut(4),\n\tquintIn: powIn(5), quintOut: powOut(5), quintInOut: powInOut(5),\n\tsineIn: t => 1 - Math.cos(t * Math.PI / 2),\n\tsineOut: t => Math.sin(t * Math.PI / 2),\n\tsineInOut: t => -0.5 * (Math.cos(Math.PI * t) - 1),\n\tbackIn: backIn(1.7), backOut: backOut(1.7), backInOut: backInOut(1.7),\n\tcircIn: t => -(Math.sqrt(1 - t * t) - 1),\n\tcircOut: t => Math.sqrt(1 - --t * t),\n\tcircInOut: t => ((t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1)),\n\tbounceIn, bounceOut,\n\tbounceInOut: t => (0.5 > t ? 0.5 * bounceIn(2 * t) : 0.5 * bounceOut(2 * t - 1) + 0.5),\n\telasticIn: elasticIn(1, 0.3), elasticOut: elasticOut(1, 0.3), elasticInOut: elasticInOut(1, 0.3 * 1.5)\n};\n\n/** The ease runtime content names (null for a name the player does not know) */\nexport function easeOf(id: string): TEase | null {\n\tif (id.indexOf('get:') === 0) {\n\t\treturn classic(Number(id.slice(4)));\n\t}\n\treturn Object.prototype.hasOwnProperty.call(EASES, id) ? EASES[id] : null;\n}\n\n/** The eases the generator tries for a stretch of a tween, by name: the named ones, then Ease.get(-1 .. 1) in hundredths */\nexport function easeIds(): string[] {\n\tconst ids = Object.keys(EASES);\n\tfor (let n = -100; n <= 100; n++) {\n\t\tids.push('get:' + n / 100);\n\t}\n\treturn ids;\n}\n","/**\n * The data of runtime content (what the generator writes and the player reads): the definition\n * extracted by @tawaship/animate-data-converter, with every frame script\n * taken out of the data and referenced by its index in the runtime content's\n * script list (the scripts themselves are code in the runtime content), and with\n * the writes of each tween and of each instance's initial values compiled\n * into writer functions (code in the runtime content as well, referenced by index).\n * Drawings are gathered into one table for the whole content, identical\n * ones merged, and a symbol refers to them by index.\n */\n\nimport type {\n\tIMovieClipSymbolDef, ISpriteSymbolDef, IBitmapSymbolDef, ITweenDef, IPropMapDef, ISlotDef,\n\tIManifestEntryDef, ISpriteSheetDef, IGraphicsCommandDef, IStateEntryDef, IDataMap, TDataValue, TFrameValue\n} from '@tawaship/animate-data-converter';\nimport { easeOf, TEase } from './ease';\n\n/** A kind of drawing command: its type and the names of its props, in order */\nexport type TRuntimeCommandKind = [string, string[]];\n\n/** A drawing command as written in runtime content: the index of its kind, then its props' values in the kind's order */\nexport type TRuntimeCommand = TDataValue[];\n\n/** A drawing as written in runtime content */\nexport interface IRuntimeGraphicsData {\n\tcommands: TRuntimeCommand[];\n}\n\n/** A drawing's commands as the player draws them, from their written form */\nexport function commandsOf(kinds: TRuntimeCommandKind[], graphics: IRuntimeGraphicsData): IGraphicsCommandDef[] {\n\treturn graphics.commands.map(command => {\n\t\tconst kind = kinds[typeof command[0] === 'number' ? command[0] : 0];\n\t\tconst props: IDataMap = {};\n\t\tkind[1].forEach((name, i) => {\n\t\t\tprops[name] = command[i + 1];\n\t\t});\n\t\treturn { type: kind[0], props };\n\t});\n}\n\nexport type {\n\tISlotDef, ITweenDef, IStateEntryDef, IGraphicsDef, IGraphicsCommandDef, ISpriteDef, IBitmapDef,\n\tIFilterDef, ICacheDef, IButtonDef, IFilterCacheEntryDef, IRectDef, IDataMap, IPropMapDef,\n\tIManifestEntryDef, ISpriteSheetDef, ILabelDef, IMemberDef, TTargetDef, TFrameValue, TDataValue,\n\tISpriteSymbolDef, IBitmapSymbolDef\n} from '@tawaship/animate-data-converter';\n\n/**\n * The pixi-animate-runtime versions whose runtime content this player plays\n * (npm's range notation). Raised when the player stops playing runtime\n * content older versions made.\n */\nexport const RUNTIME_CONTENT_RANGE = '0.x';\n\nexport interface IRuntimeActionDef {\n\t/** Timeline position the action sits on */\n\tposition: number;\n\t/** Index into the runtime content's script list */\n\tscript: number;\n\tparams: TFrameValue[] | null;\n}\n\nexport interface IRuntimeTweenDef extends Omit<ITweenDef, 'actions' | 'frames'> {\n\tactions: IRuntimeActionDef[];\n\t/** The tween's distinct frame values (each the values of its props, in order) */\n\tvalues: TFrameValue[][];\n\t/** For every position, the index of its values in values (a position holding the same values as another shares them) */\n\tframes: number[];\n\t/**\n\t * Index into the runtime content's writer list: the function that writes a frame's\n\t * values (values[frames[position]]) to the target, one property after another by\n\t * name (null when the tween writes no property)\n\t */\n\twriter: number | null;\n}\n\n/**\n * A slot as the player uses it. Its initial values are in code only (the\n * writer), not in the data.\n */\n/**\n * A frame value as written in runtime content: a display list (`state`) may\n * give an entry that places a slot as it is (no props) as the slot's index\n */\nexport type TRuntimeFrameValue = TFrameValue | Array<IStateEntryDef | number>;\n\n/**\n * A position, or a stretch of positions, of a tween as written in runtime\n * content: the index of the position's values, or an interpolated stretch\n * [from, to, length, ease] whose positions run from values[from] toward\n * values[to] (the position after the stretch) as CreateJS interpolates a\n * step with that ease (see interpolated)\n */\nexport type TRuntimeFrameRef = number | [number, number, number, string];\n\n/** A tween as written in runtime content (tweenOf makes its values for every position) */\nexport interface IRuntimeTweenData extends Omit<IRuntimeTweenDef, 'values' | 'frames'> {\n\tvalues: TRuntimeFrameValue[][];\n\tframes: TRuntimeFrameRef[];\n}\n\n/**\n * The values at a position of a step, as CreateJS's Tween computes them: the\n * ratio of the position in the step, eased, then each value from its start\n * toward its end (a value that is not a number, or does not change, keeps its\n * start until the eased ratio reaches 1).\n */\nexport function interpolated(from: TFrameValue[], to: TFrameValue[], position: number, length: number, ease: TEase | null): TFrameValue[] {\n\tlet ratio = position / length;\n\tif (ease) {\n\t\tratio = ease(ratio);\n\t}\n\treturn from.map((v0, i) => {\n\t\tconst v1 = to[i];\n\t\treturn v0 !== v1 && typeof v0 === 'number' && typeof v1 === 'number' ? v0 + (v1 - v0) * ratio : ratio >= 1 ? v1 : v0;\n\t});\n}\n\n/** A display list entry as the player uses it, from its written form */\nfunction stateEntryOf(entry: IStateEntryDef | number): IStateEntryDef {\n\treturn typeof entry === 'number' ? { target: { type: 'slot', slot: entry }, props: null } : entry;\n}\n\n/**\n * A tween with the values of every position: its display lists (the values of\n * its `state` prop) as entries, and its interpolated stretches computed (each\n * position of a stretch gets values of its own)\n */\nexport function tweenOf(data: IRuntimeTweenData): IRuntimeTweenDef {\n\tconst state = data.props.indexOf('state');\n\tconst values = data.values.map(frame => frame.map((value, i): TFrameValue => {\n\t\tif (i === state && Array.isArray(value)) {\n\t\t\treturn value.map(stateEntryOf);\n\t\t}\n\t\treturn isFrameValue(value) ? value : null;\n\t}));\n\tconst frames: number[] = [];\n\tdata.frames.forEach(ref => {\n\t\tif (typeof ref === 'number') {\n\t\t\tframes.push(ref);\n\t\t\treturn;\n\t\t}\n\t\tconst ease = easeOf(ref[3]);\n\t\tfor (let position = 0; position < ref[2]; position++) {\n\t\t\tframes.push(values.push(interpolated(values[ref[0]], values[ref[1]], position, ref[2], ease)) - 1);\n\t\t}\n\t});\n\treturn Object.assign({}, data, { values, frames });\n}\n\n/** Whether a written value is a frame value as it is (all but a display list with slot indexes) */\nfunction isFrameValue(value: TRuntimeFrameValue): value is TFrameValue {\n\treturn !Array.isArray(value) || value.every(entry => typeof entry !== 'number');\n}\n\nexport interface IRuntimeSlotDef extends Omit<ISlotDef, 'init'> {\n\t/** Index into the runtime content's writer list: the function that writes the slot's initial values (initValues) */\n\tinitWriter: number | null;\n\t/** The slot's initial values, in the order its writer writes them */\n\tinitValues: TFrameValue[] | null;\n}\n\n/** The values a slot's fields have when runtime content leaves them out */\nexport const SLOT_DEFAULTS: Omit<IRuntimeSlotDef, 'kind'> = {\n\tsymbol: null, mode: null, startPosition: null, loop: null, graphics: null, sprite: null, bitmap: null, text: null,\n\tmask: null, hitArea: null, filters: null, cache: null, button: null, filterCacheListener: false, parentSet: false,\n\tinitWriter: null, initValues: null\n};\n\n/**\n * A slot template as written in runtime content: its kind, and the fields not\n * at their defaults (SLOT_DEFAULTS); its initial values are the slot's own\n */\nexport type TRuntimeSlotData = Pick<IRuntimeSlotDef, 'kind'> & Partial<Omit<IRuntimeSlotDef, 'kind' | 'initValues'>>;\n\n/**\n * A slot as written in a symbol: the index of its template in the content's\n * slotTemplates, with its initial values when it has some\n */\nexport type TRuntimeSlotRef = number | [number, TFrameValue[]];\n\n/** A slot from its template (the fields left out at their defaults) and its initial values */\nexport function slotOf(templates: TRuntimeSlotData[], ref: TRuntimeSlotRef): IRuntimeSlotDef {\n\tconst template = templates[typeof ref === 'number' ? ref : ref[0]];\n\treturn Object.assign({}, SLOT_DEFAULTS, template, { initValues: typeof ref === 'number' ? null : ref[1] });\n}\n\nexport interface IRuntimeMovieClipDef extends Omit<IMovieClipSymbolDef, 'tweens' | 'slots' | 'graphics' | 'members'> {\n\t/** The slots as written (templates and initial values; slotOf makes them whole) */\n\tslots: TRuntimeSlotRef[];\n\t/** The tweens as written (display lists with slot indexes; tweenOf turns them back into entries) */\n\ttweens: IRuntimeTweenData[];\n\t/**\n\t * Index into the runtime content's member writer list: the function that\n\t * gives an instance its named children (`this.instance = ...`), or null\n\t * when it has none\n\t */\n\tmemberWriter: number | null;\n\t/**\n\t * The symbol's drawings as indexes into the content's drawing table\n\t * (graphics[n] is the drawing the symbol's slots and tween values call n)\n\t */\n\tgraphics: number[];\n}\n\nexport type TRuntimeSymbolDef = IRuntimeMovieClipDef | ISpriteSymbolDef | IBitmapSymbolDef;\n\nexport interface IRuntimeData {\n\t/** The version of pixi-animate-runtime that generated the runtime content */\n\truntimeVersion: string;\n\t/** Primitive entries of the published lib.properties (width, height, fps, color, ...) */\n\tproperties: IPropMapDef;\n\t/** Images of the published manifest (sounds are left out) */\n\timages: IManifestEntryDef[];\n\t/** The published lib.ssMetadata */\n\tspriteSheets: ISpriteSheetDef[];\n\t/** Every drawing of the content, identical ones merged (shared by every symbol that shows them); commandsOf reads them */\n\tgraphics: IRuntimeGraphicsData[];\n\t/** The kinds of the drawings' commands (a type and the names of its props) */\n\tcommandKinds: TRuntimeCommandKind[];\n\t/** The slots of every symbol but their initial values, identical ones merged */\n\tslotTemplates: TRuntimeSlotData[];\n\tsymbols: { [id: string]: TRuntimeSymbolDef };\n}\n","import * as PIXI from 'pixi.js';\nimport { checkVersion } from './semver';\nimport { VERSION } from './version';\nimport { DisplayObject, Container } from './display';\nimport { Rectangle } from './geom';\nimport { Event, EventDispatcher } from './events';\nimport { MovieClip, Timeline, TweenState, ITweenScope, TScript, TWriter, TMemberWriter, TWrittenValue } from './movieclip';\nimport {\n\tShape, Graphics, Sprite, SpriteSheet, Bitmap, Text, ColorFilter, ButtonHelper,\n\tITextureSource, IImageAsset\n} from './objects';\nimport {\n\tRUNTIME_CONTENT_RANGE, IRuntimeData, IRuntimeMovieClipDef, IRuntimeTweenDef, ISpriteSymbolDef, IBitmapSymbolDef, slotOf, tweenOf, commandsOf,\n\tIRuntimeSlotDef, ISpriteDef, IBitmapDef, IRectDef, IStateEntryDef, TTargetDef, TFrameValue, TDataValue\n} from './data';\n\n/**\n * Whether this player plays runtime content: an error when the version of\n * pixi-animate-runtime that generated it is outside the range the player\n * plays, a warning when it is newer than the player (it may hold what the\n * player does not know and leaves out).\n */\nfunction checkRuntimeContent(data: IRuntimeData): void {\n\tconst made = typeof data.runtimeVersion === 'string' ? data.runtimeVersion : '';\n\tconst check = checkVersion(made, RUNTIME_CONTENT_RANGE, VERSION);\n\tconst by = 'This runtime content was generated by pixi-animate-runtime ' + (made || '(no version)');\n\tif (check.error) {\n\t\tthrow new Error(by + ', which this player (' + VERSION + ') does not play (it plays runtime content generated by ' + RUNTIME_CONTENT_RANGE + '). '\n\t\t\t+ (check.newer ? 'Update the player.' : 'Generate the runtime content again with pixi-animate-runtime ' + VERSION + '.'));\n\t}\n\tif (check.warning) {\n\t\tconsole.warn(by + ', newer than this player (' + VERSION + '). What the newer version added may not play; update the player.');\n\t}\n}\n\nexport type TMovieClipClass = new (mode?: string | null, startPosition?: number | null, loop?: boolean | number | null) => MovieClip;\nexport type TSpriteClass = new () => Sprite;\nexport type TBitmapClass = new () => Bitmap;\nexport type TSymbolClass = TMovieClipClass | TSpriteClass | TBitmapClass;\n\n/**\n * The symbol classes of a content by symbol id: what published code calls `lib`.\n */\nexport interface ILibrary {\n\t[id: string]: TSymbolClass;\n}\n\n/**\n * The createjs-compatible names frame scripts reach as `cjs` / `createjs`.\n */\nexport const namespace = {\n\tDisplayObject, Container, MovieClip, Shape, Graphics, Sprite, SpriteSheet, Bitmap, Text,\n\tColorFilter, ButtonHelper, Event, EventDispatcher, Rectangle, Point: PIXI.Point\n};\n\nexport type TNamespace = typeof namespace;\n\n/** What frame scripts get for the template's global playSound: nothing is played */\nexport interface ISilentSound {\n\tpaused: boolean;\n\tvolume: number;\n\taddEventListener(): void;\n\tremoveEventListener(): void;\n\ton(): void;\n\tstop(): void;\n\tplay(): void;\n}\n\nfunction playSound(): ISilentSound {\n\treturn {\n\t\tpaused: false, volume: 1,\n\t\taddEventListener() { /* silent */ }, removeEventListener() { /* silent */ },\n\t\ton() { /* silent */ }, stop() { /* silent */ }, play() { /* silent */ }\n\t};\n}\n\nexport interface IGeneratedContent {\n\tdata: IRuntimeData;\n\tscripts: TScript[];\n\twriters: TWriter[];\n\tmemberWriters: TMemberWriter[];\n}\n\n/**\n * What runtime content exports: given the names frame scripts refer\n * to, it returns the content's data and its frame scripts (as code, closed\n * over those names). exportRoot and stage are passed as undefined: they are\n * the template's root and stage, which a player of any symbol does not have.\n */\nexport type TContentFactory = (cjs: TNamespace, createjs: TNamespace, lib: ILibrary, exportRoot: undefined, stage: undefined, playSound: () => ISilentSound) => IGeneratedContent;\n\nexport interface IContentAssets {\n\t/** Textures of the manifest images (sprite sheet atlases included), by manifest id */\n\timages?: { [id: string]: PIXI.Texture };\n}\n\nfunction isMovieClipClass(content: Content, id: string, value: TSymbolClass): value is TMovieClipClass {\n\tconst def = content.data.symbols[id];\n\treturn !!def && def.kind === 'movieclip';\n}\n\nfunction isSpriteClass(content: Content, id: string, value: TSymbolClass): value is TSpriteClass {\n\tconst def = content.data.symbols[id];\n\treturn !!def && def.kind === 'sprite';\n}\n\nfunction isBitmapClass(content: Content, id: string, value: TSymbolClass): value is TBitmapClass {\n\tconst def = content.data.symbols[id];\n\treturn !!def && def.kind === 'bitmap';\n}\n\nfunction toRect(rect: IRectDef | null): Rectangle | null {\n\treturn rect ? new Rectangle(rect.x, rect.y, rect.width, rect.height) : null;\n}\n\nfunction toRects(rects: IRectDef[] | null): Rectangle[] | null {\n\treturn rects ? rects.map(rect => new Rectangle(rect.x, rect.y, rect.width, rect.height)) : null;\n}\n\nfunction numbers(value: TDataValue): number[] {\n\treturn Array.isArray(value) ? value.map(v => (typeof v === 'number' ? v : 0)) : [0, 0, 0, 0];\n}\n\n/**\n * The template's AdobeAn.handleFilterCache: re-caches the instances a clip's\n * filterCacheList names while the clip is within their frame ranges.\n */\nfunction handleFilterCache(event: Event): void {\n\tif (event.paused) {\n\t\treturn;\n\t}\n\tconst target = event.target;\n\tif (!(target instanceof MovieClip) || !target.filterCacheList) {\n\t\treturn;\n\t}\n\ttarget.filterCacheList.forEach(entry => {\n\t\tif (entry.startFrame <= target.currentFrame && target.currentFrame <= entry.endFrame) {\n\t\t\tentry.instance.cache(entry.x, entry.y, entry.w, entry.h);\n\t\t}\n\t});\n}\n\n/** A value of the published lib.properties (width, height, fps, color, ...) */\nexport type TContentProperty = number | string | boolean | null;\n\nexport interface IContentProperties {\n\t[key: string]: TContentProperty;\n}\n\n/**\n * A loaded content, as the application uses it.\n */\nexport interface IContent {\n\t/** The composition id (lib.properties.id of the published content) */\n\treadonly id: string;\n\t/** The symbol classes by symbol name: what frame scripts reach as `lib` */\n\treadonly lib: ILibrary;\n\t/** The values of the published lib.properties (its lists, such as the manifest, left out) */\n\treadonly properties: Readonly<IContentProperties>;\n\t/**\n\t * An instance of a symbol for the application to place, set up as the HTML\n\t * template sets up the root it creates.\n\t */\n\tcreate(id: string): DisplayObject;\n}\n\n/** A MovieClip symbol as the player builds its instances from: its slots with every field */\ninterface IMovieClipPlan extends Omit<IRuntimeMovieClipDef, 'slots' | 'tweens'> {\n\tslots: IRuntimeSlotDef[];\n\ttweens: IRuntimeTweenDef[];\n}\n\n/**\n * A content: the symbol classes built from generated data, sharing one\n * definition per symbol. Not part of the API: applications get an IContent.\n * @internal\n */\nexport class Content implements ITextureSource {\n\treadonly data: IRuntimeData;\n\treadonly scripts: TScript[];\n\treadonly writers: TWriter[];\n\treadonly memberWriters: TMemberWriter[];\n\treadonly lib: ILibrary = {};\n\treadonly images: { [id: string]: IImageAsset } = {};\n\t/** One Graphics per drawing of the content, shared by every symbol that shows it */\n\treadonly graphics: Graphics[] = [];\n\treadonly spriteSheets: { [name: string]: SpriteSheet } = {};\n\tprivate readonly _frameAssets: { [key: string]: IImageAsset } = {};\n\n\tconstructor(factory: TContentFactory, assets?: IContentAssets) {\n\t\tconst generated = factory(namespace, namespace, this.lib, undefined, undefined, playSound);\n\t\tcheckRuntimeContent(generated.data);\n\t\tthis.data = generated.data;\n\t\tthis.scripts = generated.scripts;\n\t\tthis.writers = generated.writers;\n\t\tthis.memberWriters = generated.memberWriters;\n\n\t\tthis.data.graphics.forEach(def => {\n\t\t\tthis.graphics.push(new Graphics(commandsOf(this.data.commandKinds, def), this));\n\t\t});\n\n\t\tthis._applyImages(assets && assets.images ? assets.images : {});\n\n\t\tObject.keys(this.data.symbols).forEach(id => {\n\t\t\tconst def = this.data.symbols[id];\n\t\t\tif (def.kind === 'movieclip') {\n\t\t\t\tthis.lib[id] = this._movieClipClass(def);\n\t\t\t} else if (def.kind === 'sprite') {\n\t\t\t\tthis.lib[id] = this._spriteClass(def);\n\t\t\t} else if (def.kind === 'bitmap') {\n\t\t\t\tthis.lib[id] = this._bitmapClass(def);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Sets the textures of the content's images (by manifest id) and the sprite\n\t * sheets cut from them. Done before any instance is made: the constructor's\n\t * assets, or the textures a loader read for the content afterwards.\n\t */\n\t_applyImages(textures: { [id: string]: PIXI.Texture }): void {\n\t\tthis.data.images.forEach(entry => {\n\t\t\tconst texture = textures[entry.id];\n\t\t\tthis.images[entry.id] = { src: entry.src, texture: texture || PIXI.Texture.EMPTY };\n\t\t});\n\t\tthis.data.spriteSheets.forEach(sheet => {\n\t\t\tconst image = this.images[sheet.name] || { src: sheet.name, texture: PIXI.Texture.EMPTY };\n\t\t\tthis.spriteSheets[sheet.name] = new SpriteSheet(image, sheet.frames.map(numbers));\n\t\t});\n\t}\n\n\timage(id: string): PIXI.Texture | null {\n\t\tconst image = this.images[id];\n\t\treturn image ? image.texture : null;\n\t}\n\n\tframe(sheet: string, index: number): PIXI.Texture | null {\n\t\tconst spriteSheet = this.spriteSheets[sheet];\n\t\treturn spriteSheet ? spriteSheet.textures[index] || null : null;\n\t}\n\n\timageAsset(id: string): IImageAsset | null {\n\t\treturn this.images[id] || null;\n\t}\n\n\t/** The image a frame of a sheet is drawn into for a bitmap fill (named after the atlas and the frame) */\n\tframeAsset(sheet: string, index: number): IImageAsset | null {\n\t\tconst key = sheet + '#' + index;\n\t\tlet asset = this._frameAssets[key];\n\t\tif (!asset) {\n\t\t\tconst spriteSheet = this.spriteSheets[sheet];\n\t\t\tconst texture = spriteSheet ? spriteSheet.textures[index] : undefined;\n\t\t\tif (!spriteSheet || !texture) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tasset = this._frameAssets[key] = { src: spriteSheet.frames[index].image.src + '#' + index, texture };\n\t\t}\n\t\treturn asset;\n\t}\n\n\t/**\n\t * An instance of a symbol for the application to place, set up as the HTML\n\t * template sets up the root it creates: a clip that re-caches its children's\n\t * color effects (it has a filterCacheList) gets the filter cache handling,\n\t * which published code otherwise gets from the symbol that creates it (an\n\t * instance made by `new lib[id]()` in a frame script gets none, as in\n\t * CreateJS). The handling does not change what the player draws (it draws\n\t * color effects without caches); it keeps the instance's state the\n\t * template's.\n\t */\n\tcreate(id: string): DisplayObject {\n\t\tconst symbolClass = this.lib[id];\n\t\tif (!symbolClass) {\n\t\t\tthrow new Error('no symbol \"' + id + '\"');\n\t\t}\n\t\tconst instance = new symbolClass();\n\t\tif (instance instanceof MovieClip && instance.filterCacheList) {\n\t\t\tinstance.addEventListener('tick', handleFilterCache);\n\t\t}\n\t\treturn instance;\n\t}\n\n\tprivate _movieClipClass(data: IRuntimeMovieClipDef): TMovieClipClass {\n\t\tconst content = this;\n\t\t// The slots filled in, and the display lists turned back into entries, once for the symbol, not for every instance\n\t\tconst templates = this.data.slotTemplates;\n\t\tconst def: IMovieClipPlan = Object.assign({}, data, { slots: data.slots.map(ref => slotOf(templates, ref)), tweens: data.tweens.map(tweenOf) });\n\t\t// The symbol's drawings, from the content's table (shared with every symbol that shows the same drawing)\n\t\tconst graphics = def.graphics.map(index => content.graphics[index]);\n\t\tconst fps = typeof this.data.properties.fps === 'number' ? this.data.properties.fps : null;\n\t\tconst nominalBounds = toRect(def.nominalBounds);\n\t\tconst frameBounds = toRects(def.frameBounds);\n\n\t\treturn class extends MovieClip {\n\t\t\tconstructor(mode?: string | null, startPosition?: number | null, loop?: boolean | number | null) {\n\t\t\t\t// Constructed with no arguments (a root, or new lib.X()): the resolved defaults\n\t\t\t\tconst defaults = def.defaults;\n\t\t\t\tconst noArgs = mode === undefined && startPosition === undefined && loop === undefined;\n\t\t\t\tsuper(\n\t\t\t\t\tnoArgs && defaults ? defaults.mode : mode,\n\t\t\t\t\tnoArgs && defaults ? defaults.startPosition : startPosition,\n\t\t\t\t\tnoArgs && defaults ? defaults.loop : loop,\n\t\t\t\t\tnew Timeline(def.duration, def.labels)\n\t\t\t\t);\n\t\t\t\tthis.contentFps = fps;\n\t\t\t\tif (nominalBounds) {\n\t\t\t\t\tthis.nominalBounds = nominalBounds;\n\t\t\t\t}\n\t\t\t\tif (frameBounds) {\n\t\t\t\t\tthis.frameBounds = frameBounds;\n\t\t\t\t}\n\t\t\t\tcontent._populate(this, def, graphics);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _spriteClass(def: ISpriteSymbolDef): TSpriteClass {\n\t\tconst content = this;\n\t\tconst nominalBounds = toRect(def.nominalBounds);\n\t\tconst frameBounds = toRects(def.frameBounds);\n\t\treturn class extends Sprite {\n\t\t\tconstructor() {\n\t\t\t\tsuper(content._sheet(def.sprite.sheet));\n\t\t\t\tif (nominalBounds) {\n\t\t\t\t\tthis.nominalBounds = nominalBounds;\n\t\t\t\t}\n\t\t\t\tif (frameBounds) {\n\t\t\t\t\tthis.frameBounds = frameBounds;\n\t\t\t\t}\n\t\t\t\tcontent._applySprite(this, def.sprite);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _bitmapClass(def: IBitmapSymbolDef): TBitmapClass {\n\t\tconst content = this;\n\t\tconst nominalBounds = toRect(def.nominalBounds);\n\t\tconst frameBounds = toRects(def.frameBounds);\n\t\treturn class extends Bitmap {\n\t\t\tconstructor() {\n\t\t\t\tsuper(content._image(def.bitmap.image));\n\t\t\t\tif (nominalBounds) {\n\t\t\t\t\tthis.nominalBounds = nominalBounds;\n\t\t\t\t}\n\t\t\t\tif (frameBounds) {\n\t\t\t\t\tthis.frameBounds = frameBounds;\n\t\t\t\t}\n\t\t\t\tcontent._applyBitmap(this, def.bitmap);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _sheet(name: string): SpriteSheet {\n\t\tconst sheet = this.spriteSheets[name];\n\t\tif (!sheet) {\n\t\t\tthrow new Error('no sprite sheet \"' + name + '\"');\n\t\t}\n\t\treturn sheet;\n\t}\n\n\tprivate _image(id: string): IImageAsset | null {\n\t\treturn this.images[id] || null;\n\t}\n\n\t_applySprite(sprite: Sprite, def: ISpriteDef | null): void {\n\t\tif (!def) {\n\t\t\treturn;\n\t\t}\n\t\tsprite.spriteSheet = this._sheet(def.sheet);\n\t\tif (def.paused) {\n\t\t\tsprite.gotoAndStop(def.frame);\n\t\t} else {\n\t\t\tsprite.gotoAndPlay(def.frame);\n\t\t}\n\t}\n\n\t_applyBitmap(bitmap: Bitmap, def: IBitmapDef | null): void {\n\t\tif (!def) {\n\t\t\treturn;\n\t\t}\n\t\tbitmap.image = this._image(def.image);\n\t\tbitmap.sourceRect = toRect(def.sourceRect);\n\t}\n\n\tprivate _createSlot(slot: IRuntimeSlotDef, graphics: Graphics[]): DisplayObject {\n\t\tconst symbol = slot.symbol;\n\t\tconst symbolClass = symbol ? this.lib[symbol] : undefined;\n\n\t\tif (slot.kind === 'movieclip') {\n\t\t\tif (!symbol || !symbolClass || !isMovieClipClass(this, symbol, symbolClass)) {\n\t\t\t\tthrow new Error('missing MovieClip symbol ' + symbol);\n\t\t\t}\n\t\t\treturn new symbolClass(slot.mode, slot.startPosition, slot.loop);\n\t\t}\n\n\t\tif (slot.kind === 'shape') {\n\t\t\treturn new Shape(slot.graphics === null ? null : graphics[slot.graphics]);\n\t\t}\n\n\t\tif (slot.kind === 'sprite') {\n\t\t\tlet sprite: Sprite;\n\t\t\tif (symbol && symbolClass && isSpriteClass(this, symbol, symbolClass)) {\n\t\t\t\tsprite = new symbolClass();\n\t\t\t} else {\n\t\t\t\tsprite = new Sprite(this._sheet(slot.sprite ? slot.sprite.sheet : ''));\n\t\t\t}\n\t\t\tthis._applySprite(sprite, slot.sprite);\n\t\t\treturn sprite;\n\t\t}\n\n\t\tif (slot.kind === 'bitmap') {\n\t\t\tlet bitmap: Bitmap;\n\t\t\tif (symbol && symbolClass && isBitmapClass(this, symbol, symbolClass)) {\n\t\t\t\tbitmap = new symbolClass();\n\t\t\t} else {\n\t\t\t\tbitmap = new Bitmap(null);\n\t\t\t}\n\t\t\tthis._applyBitmap(bitmap, slot.bitmap);\n\t\t\treturn bitmap;\n\t\t}\n\n\t\tif (slot.kind === 'text') {\n\t\t\tconst props = slot.text || {};\n\t\t\tconst text = new Text(String(props.text == null ? '' : props.text), typeof props.font === 'string' ? props.font : undefined, typeof props.color === 'string' ? props.color : undefined);\n\t\t\tObject.keys(props).forEach(key => {\n\t\t\t\tReflect.set(text, key, props[key]);\n\t\t\t});\n\t\t\treturn text;\n\t\t}\n\n\t\tthrow new Error('unsupported display object in the content data');\n\t}\n\n\t/**\n\t * Builds an instance of a MovieClip symbol: what the published\n\t * constructor builds, from the shared definition.\n\t */\n\t_populate(self: MovieClip, def: IMovieClipPlan, graphics: Graphics[]): void {\n\t\tconst slots = def.slots.map(slot => {\n\t\t\tconst obj = this._createSlot(slot, graphics);\n\t\t\tif (slot.initWriter !== null) {\n\t\t\t\tthis.writers[slot.initWriter](obj, slot.initValues === null ? undefined : slot.initValues);\n\t\t\t}\n\t\t\tif (slot.parentSet) {\n\t\t\t\tobj.parent = self;\n\t\t\t}\n\t\t\tif (slot.filters) {\n\t\t\t\tobj.filters = slot.filters.map(filter => {\n\t\t\t\t\tconst p = filter.props;\n\t\t\t\t\tconst n = (key: string): number => { const v = p[key]; return typeof v === 'number' ? v : 0; };\n\t\t\t\t\treturn new ColorFilter(n('redMultiplier'), n('greenMultiplier'), n('blueMultiplier'), n('alphaMultiplier'),\n\t\t\t\t\t\tn('redOffset'), n('greenOffset'), n('blueOffset'), n('alphaOffset'));\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (slot.cache) {\n\t\t\t\tconst c = slot.cache;\n\t\t\t\tobj.cache(c.x, c.y, c.width, c.height, c.scale);\n\t\t\t}\n\t\t\treturn obj;\n\t\t});\n\n\t\tconst resolve = (target: TTargetDef): object => {\n\t\t\tif (target.type === 'self') {\n\t\t\t\treturn self;\n\t\t\t}\n\t\t\tif (target.type === 'slot') {\n\t\t\t\treturn slots[target.slot];\n\t\t\t}\n\t\t\tif (target.type === 'filter') {\n\t\t\t\tconst filters = slots[target.slot].filters;\n\t\t\t\treturn filters ? filters[target.filter] : {};\n\t\t\t}\n\t\t\treturn {};\n\t\t};\n\n\t\tdef.slots.forEach((slot, i) => {\n\t\t\tconst obj = slots[i];\n\t\t\tif (slot.mask !== null) {\n\t\t\t\tobj.mask = slots[slot.mask];\n\t\t\t}\n\t\t\tif (slot.button) {\n\t\t\t\tconst b = slot.button;\n\t\t\t\tconst hit = b.hit === null ? null : slots[b.hit];\n\t\t\t\tif (obj instanceof MovieClip) {\n\t\t\t\t\tnew ButtonHelper(obj, b.out, b.over, b.down, b.play, hit instanceof MovieClip ? hit : null, b.hitFrame);\n\t\t\t\t}\n\t\t\t\tif (hit && !(hit instanceof MovieClip)) {\n\t\t\t\t\tobj.hitArea = hit;\n\t\t\t\t}\n\t\t\t} else if (slot.hitArea !== null) {\n\t\t\t\tobj.hitArea = slots[slot.hitArea];\n\t\t\t}\n\t\t\tif (slot.filterCacheListener) {\n\t\t\t\tobj.addEventListener('tick', handleFilterCache);\n\t\t\t}\n\t\t});\n\n\t\tif (def.filterCacheList) {\n\t\t\tself.filterCacheList = def.filterCacheList.map(entry => {\n\t\t\t\tconst instance = resolve(entry.instance);\n\t\t\t\treturn {\n\t\t\t\t\tinstance: instance instanceof DisplayObject ? instance : self,\n\t\t\t\t\tstartFrame: entry.startFrame, endFrame: entry.endFrame,\n\t\t\t\t\tx: entry.x, y: entry.y, w: entry.w, h: entry.h\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\n\t\tif (def.memberWriter !== null) {\n\t\t\tthis.memberWriters[def.memberWriter](self, slots);\n\t\t}\n\t\tdef.unmanaged.forEach(index => {\n\t\t\tself.addChild(slots[index]);\n\t\t});\n\n\t\tconst content = this;\n\t\tconst scope: ITweenScope = {\n\t\t\tstateTarget(entry: IStateEntryDef): DisplayObject | null {\n\t\t\t\tconst target = resolve(entry.target);\n\t\t\t\treturn target instanceof DisplayObject ? target : null;\n\t\t\t},\n\t\t\tvalue(value: TFrameValue): TWrittenValue {\n\t\t\t\tif (value !== null && typeof value === 'object' && !Array.isArray(value)) {\n\t\t\t\t\treturn graphics[value.graphics] || null;\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tscript(index: number): TScript {\n\t\t\t\treturn content.scripts[index];\n\t\t\t},\n\t\t\twriter(index: number): TWriter {\n\t\t\t\treturn content.writers[index];\n\t\t\t}\n\t\t};\n\n\t\tdef.tweens.forEach(tween => {\n\t\t\tself.timeline.tweens.push(new TweenState(tween, resolve(tween.target), scope, self));\n\t\t});\n\n\t\tself._renderFirstFrame();\n\t}\n}\n\n/**\n * What the application gets of a content: the content itself stays out of\n * reach, the methods closing over it.\n */\nexport function contentInterface(content: Content): IContent {\n\tconst properties: IContentProperties = {};\n\tObject.keys(content.data.properties).forEach(key => {\n\t\tconst value = content.data.properties[key];\n\t\tif (value === null || typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') {\n\t\t\tproperties[key] = value;\n\t\t}\n\t});\n\tconst id = properties.id;\n\treturn {\n\t\tid: typeof id === 'string' ? id : '',\n\t\tlib: content.lib,\n\t\tproperties: Object.freeze(properties),\n\t\tcreate(symbol: string): DisplayObject {\n\t\t\treturn content.create(symbol);\n\t\t}\n\t};\n}\n\n/**\n * Plays one frame of a display tree the way createjs does on a stage update:\n * the tick phase (playheads advance, children in reverse order, tick\n * listeners), then the resolve phase (each MovieClip settles its timeline,\n * children in reverse order).\n */\nexport function tick(root: DisplayObject, event?: Event): void {\n\troot._tick(event || new Event('tick'));\n\tresolveState(root);\n}\n\n/**\n * The resolve phase alone: each MovieClip settles its timeline (children in\n * reverse order), without playing a frame.\n */\nexport function resolveState(node: DisplayObject): void {\n\tif (node instanceof MovieClip) {\n\t\tnode._updateState();\n\t}\n\tif (node instanceof Container) {\n\t\tconst children = node.children;\n\t\tfor (let i = children.length - 1; i >= 0; i--) {\n\t\t\tif (children[i] instanceof MovieClip) {\n\t\t\t\tresolveState(children[i]);\n\t\t\t}\n\t\t}\n\t}\n}\n","import * as PIXI from 'pixi.js';\nimport { DisplayObject } from './display';\nimport { MovieClip } from './movieclip';\nimport { tick, resolveState } from './content';\n\n/** The frame rate a root plays at when its content does not give one */\nconst DEFAULT_FPS = 60;\n/** How many of the latest deltas the usual delta of the display is the median of */\nconst DELTA_SAMPLES = 30;\n/** The share of its distance from the real time the steady clock moves by on each call */\nconst PULL = 0.05;\n\ninterface ITarget {\n\troot: MovieClip;\n\t/** Frames owed by the real time (the deltas as given) */\n\tt: number;\n\t/** Frames owed by the steady clock (the usual delta on every call), kept within a frame of t */\n\tclock: number;\n\tisFirst: boolean;\n}\n\n/**\n * Plays the content roots put on a Pixi container at their content's frame\n * rate (the rate the content was published with). AnimateContainer is a Pixi\n * container with one; a container of another framework can hold one too.\n *\n * Each handleTick call owes every root `delta x speed x fps / 60` frames\n * (delta being the ticker's: 1 per frame of a 60 fps display) and plays the\n * whole frames owed. With `smooth`, the frames played follow a steady clock\n * instead of the deltas themselves: it advances by the usual delta of the\n * display (the median of the latest ones) on every call, so that small changes\n * of the delta do not play a frame early or late (0 frames on one call and 2\n * on the next), and it is pulled toward the real time a little on every call,\n * and set to it when they are a frame apart (a frame of the display was\n * missed), so that the content keeps the real time. One frame is createjs's\n * tick phase followed by its resolve phase. The first call after a root is put\n * on only settles it on its first frame.\n */\nexport class AnimateController {\n\t/** Playback speed (1 is the content's own frame rate) */\n\tspeed = 1;\n\t/** Whether one call may play more than one frame (when the display runs slower than the content) */\n\toverSpeed = true;\n\t/** Whether frames are played by a steady clock, so that small changes of the delta do not make the playing uneven */\n\tsmooth = true;\n\tprivate readonly _container: PIXI.Container;\n\tprivate _targets: { [id: number]: ITarget } = {};\n\tprivate _nextId = 0;\n\t/** The latest deltas (a ring of DELTA_SAMPLES) */\n\tprivate _deltas: number[] = [];\n\tprivate _nextDelta = 0;\n\n\t/** @param container The container the roots are put on */\n\tconstructor(container: PIXI.Container) {\n\t\tthis._container = container;\n\t}\n\n\thandleTick(delta: number): void {\n\t\tconst d = delta * this.speed;\n\t\tconst usual = this._usualDelta(delta) * this.speed;\n\t\tconst targets = this._targets;\n\n\t\tObject.keys(targets).forEach(key => {\n\t\t\tconst target = targets[Number(key)];\n\t\t\tif (!target) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst fps = target.root.contentFps != null ? target.root.contentFps : DEFAULT_FPS;\n\t\t\ttarget.t += d * fps / 60;\n\n\t\t\t// The steady clock follows the real time half a step ahead, so that it sits\n\t\t\t// midway between whole frames, not on one (where the pull alone would move it across)\n\t\t\tconst step = usual * fps / 60;\n\t\t\tconst lead = Math.min(step, 1) / 2;\n\n\t\t\tif (target.isFirst) {\n\t\t\t\ttarget.isFirst = false;\n\t\t\t\ttarget.clock = target.t + lead;\n\t\t\t\tresolveState(target.root);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.smooth) {\n\t\t\t\ttarget.clock += step;\n\t\t\t\tconst behind = target.t + lead - target.clock;\n\t\t\t\tif (behind >= 1 || behind <= -1) {\n\t\t\t\t\ttarget.clock = target.t + lead;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.clock += behind * PULL;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttarget.clock = target.t;\n\t\t\t}\n\n\t\t\tconst whole = Math.max(Math.floor(target.clock), 0);\n\t\t\tconst frames = this.overSpeed ? whole : Math.min(whole, 1);\n\t\t\ttarget.t -= whole;\n\t\t\ttarget.clock -= whole;\n\t\t\tfor (let f = 0; f < frames; f++) {\n\t\t\t\ttick(target.root);\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Records a delta and gives the median of the latest ones */\n\tprivate _usualDelta(delta: number): number {\n\t\tconst deltas = this._deltas;\n\t\tdeltas[this._nextDelta] = delta;\n\t\tthis._nextDelta = (this._nextDelta + 1) % DELTA_SAMPLES;\n\t\tconst sorted = deltas.slice().sort((a, b) => a - b);\n\t\tconst middle = sorted.length >> 1;\n\t\treturn sorted.length % 2 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2;\n\t}\n\n\t/** Puts a content object on the container; a MovieClip plays from then on */\n\taddCreatejs<T extends DisplayObject>(obj: T): T {\n\t\tthis._register(obj);\n\t\tthis._container.addChild(obj.pixi);\n\t\treturn obj;\n\t}\n\n\taddCreatejsAt<T extends DisplayObject>(obj: T, index: number): T {\n\t\tthis._register(obj);\n\t\tthis._container.addChildAt(obj.pixi, index);\n\t\treturn obj;\n\t}\n\n\tremoveCreatejs<T extends DisplayObject>(obj: T): T {\n\t\tthis._container.removeChild(obj.pixi);\n\t\treturn obj;\n\t}\n\n\t/**\n\t * A MovieClip is played while its node is on the container. Coming from\n\t * another parent, it starts over from its first frame.\n\t */\n\tprivate _register(obj: DisplayObject): void {\n\t\tif (!(obj instanceof MovieClip)) {\n\t\t\treturn;\n\t\t}\n\t\tconst node = obj.pixi;\n\t\tconst previous = node.parent;\n\t\tnode.once('added', () => {\n\t\t\tif (node.parent !== previous) {\n\t\t\t\tobj.gotoAndPlay(0);\n\t\t\t}\n\t\t\tconst id = this._nextId++;\n\t\t\tthis._targets[id] = { root: obj, t: 0, clock: 0, isFirst: true };\n\t\t\tnode.once('removed', () => {\n\t\t\t\tdelete this._targets[id];\n\t\t\t});\n\t\t});\n\t}\n}\n\n/**\n * A Pixi container that plays the content roots put on it at their\n * content's frame rate (see AnimateController).\n *\n * Call handleTick from the application's ticker:\n * `app.ticker.add(container.handleTick, container)`.\n */\nexport class AnimateContainer extends PIXI.Container {\n\tprivate readonly _controller: AnimateController = new AnimateController(this);\n\n\t/** Playback speed (1 is the content's own frame rate) */\n\tget speed(): number { return this._controller.speed; }\n\tset speed(value: number) { this._controller.speed = value; }\n\n\t/** Whether one call may play more than one frame (when the display runs slower than the content) */\n\tget overSpeed(): boolean { return this._controller.overSpeed; }\n\tset overSpeed(value: boolean) { this._controller.overSpeed = value; }\n\n\t/** Whether frames are played by a steady clock, so that small changes of the delta do not make the playing uneven */\n\tget smooth(): boolean { return this._controller.smooth; }\n\tset smooth(value: boolean) { this._controller.smooth = value; }\n\n\thandleTick(delta: number): void {\n\t\tthis._controller.handleTick(delta);\n\t}\n\n\t/** Puts a content object on this container; a MovieClip plays from then on */\n\taddCreatejs<T extends DisplayObject>(obj: T): T {\n\t\treturn this._controller.addCreatejs(obj);\n\t}\n\n\taddCreatejsAt<T extends DisplayObject>(obj: T, index: number): T {\n\t\treturn this._controller.addCreatejsAt(obj, index);\n\t}\n\n\tremoveCreatejs<T extends DisplayObject>(obj: T): T {\n\t\treturn this._controller.removeCreatejs(obj);\n\t}\n}\n","import * as PIXI from 'pixi.js';\nimport { Content, IContent, TContentFactory, contentInterface } from './content';\n\n/**\n * The global runtime content files register their factories in, by\n * composition id: `window.PixiAnimateRuntimeContents[id] = factory`. It is not\n * under the player's namespace, so that a runtime content file can be loaded\n * before the player, and the same file serves every player package.\n */\nexport const CONTENTS_GLOBAL = 'PixiAnimateRuntimeContents';\n\n/** What to load a content from: its composition id, and the directory its images are relative to */\nexport interface IContentTarget {\n\t/** The content's composition id (lib.properties.id of the published content) */\n\tid: string;\n\t/** The directory the content's image paths are relative to (usually where its runtime content file is) */\n\tbasepath: string;\n\toptions?: {\n\t\t/** Whether images are requested with CORS (anonymous). true when omitted */\n\t\tcrossOrigin?: boolean;\n\t\t/**\n\t\t * Called with the content's images before they are loaded (a copy for this\n\t\t * load): changing an entry's src changes what is loaded, such as a data: or\n\t\t * blob: URL in place of the file\n\t\t */\n\t\thandleManifest?: (manifest: IContentManifestEntry[]) => Promise<void> | void;\n\t};\n}\n\n/** An image of a content: its manifest id and its path (relative to the base path, as published) */\nexport interface IContentManifestEntry {\n\tid: string;\n\tsrc: string;\n}\n\nexport interface ILoadContentOptions {\n\t/** Added to every image URL as the query `_fv=<version>` (the query an image path already has stays) */\n\tversion?: string | number;\n}\n\n/** An image of a content to load: its manifest id and its URL */\ninterface IContentImageRequest {\n\tid: string;\n\turl: string;\n}\n\n/** The factories registered so far (none when no runtime content file was loaded) */\nfunction registeredContents(): object | null {\n\tconst contents = Reflect.get(window, CONTENTS_GLOBAL);\n\treturn contents !== null && typeof contents === 'object' ? contents : null;\n}\n\nfunction describeRegistered(contents: object | null): string {\n\tif (!contents || !Object.keys(contents).length) {\n\t\treturn 'none is loaded';\n\t}\n\treturn 'loaded: ' + Object.keys(contents).map(id => {\n\t\tconst source = Reflect.get(Reflect.get(contents, id), 'source');\n\t\treturn JSON.stringify(id) + (typeof source === 'string' ? ' (' + source + ')' : '');\n\t}).join(', ');\n}\n\n/**\n * The factory a runtime content file registered under a composition id. The\n * file has to be loaded first (a script tag, or any other way).\n */\nexport function getContentFactory(id: string): TContentFactory {\n\tconst contents = registeredContents();\n\tconst found = contents ? Reflect.get(contents, id) : undefined;\n\tconst factory: TContentFactory | null = typeof found === 'function' ? found : null;\n\tif (!factory) {\n\t\tthrow new Error('No runtime content ' + JSON.stringify(id) + ' (' + describeRegistered(contents) + '). Load its runtime content file before loading the content.');\n\t}\n\treturn factory;\n}\n\n/**\n * A query added to a URL, keeping the queries it has (one of the same name is\n * replaced). The same as Pixim.js's utils.resolveQuery, so that both players\n * request the same URL.\n */\nfunction withQuery(url: string, name: string, value: string): string {\n\tconst parts = url.split('?');\n\tconst kept = parts[1] ? parts[1].split('&').filter(query => query.split('=')[0] !== name) : [];\n\tkept.push(name + '=' + value);\n\treturn parts[0] + '?' + kept.join('&');\n}\n\n/**\n * The URL of a content's image: its path resolved against the base path, with\n * the version added as `_fv=<version>` (the query the path already has, such as\n * the one Animate adds on every publish, stays). data: and blob: URLs are used\n * as they are. The same as Pixim.js's utils.resolveUri.\n */\nexport function resolveContentUrl(basepath: string, src: string, version?: string | number | null): string {\n\tif (src.indexOf('data:') === 0 || src.indexOf('blob:') === 0) {\n\t\treturn src;\n\t}\n\tconst url = PIXI.utils.url.resolve(basepath, src);\n\treturn version === undefined || version === null || version === '' ? url : withQuery(url, '_fv', String(version));\n}\n\n/** The images a content loads, with their URLs */\nfunction imageRequests(manifest: IContentManifestEntry[], basepath: string, version?: string | number | null): IContentImageRequest[] {\n\treturn manifest.map(entry => ({ id: entry.id, url: resolveContentUrl(basepath, entry.src, version) }));\n}\n\nfunction loadContent(target: IContentTarget, options: ILoadContentOptions): Promise<IContent> {\n\treturn Promise.resolve().then(() => {\n\t\tconst content = new Content(getContentFactory(target.id));\n\t\tconst manifest = content.data.images.map(entry => ({ id: entry.id, src: entry.src }));\n\t\tconst handleManifest = target.options && target.options.handleManifest;\n\t\treturn Promise.resolve(handleManifest ? handleManifest(manifest) : undefined).then(() => loadImages(target, content, imageRequests(manifest, target.basepath, options.version)));\n\t});\n}\n\nfunction loadImages(target: IContentTarget, content: Content, requests: IContentImageRequest[]): Promise<IContent> {\n\treturn new Promise<IContent>((resolve, reject) => {\n\t\tif (!requests.length) {\n\t\t\tresolve(contentInterface(content));\n\t\t\treturn;\n\t\t}\n\t\tconst crossOrigin = !target.options || target.options.crossOrigin !== false;\n\t\tconst loader = new PIXI.Loader();\n\t\trequests.forEach(request => {\n\t\t\t// Loaded as images whatever the URL looks like (a blob: URL has no extension to tell)\n\t\t\tloader.add({ name: request.id, url: request.url, crossOrigin: crossOrigin ? 'anonymous' : undefined, loadType: PIXI.LoaderResource.LOAD_TYPE.IMAGE });\n\t\t});\n\t\tconst failed: string[] = [];\n\t\tloader.onError.add((error: Error, _loader: PIXI.Loader, resource: PIXI.LoaderResource) => {\n\t\t\tfailed.push(resource.url);\n\t\t});\n\t\tloader.load((_loader: PIXI.Loader, resources: Partial<Record<string, PIXI.LoaderResource>>) => {\n\t\t\tif (failed.length) {\n\t\t\t\treject(new Error('Could not load the images of runtime content ' + JSON.stringify(target.id) + ': ' + failed.join(', ')));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst textures: { [id: string]: PIXI.Texture } = {};\n\t\t\trequests.forEach(request => {\n\t\t\t\tconst resource = resources[request.id];\n\t\t\t\tif (resource && resource.texture) {\n\t\t\t\t\ttextures[request.id] = resource.texture;\n\t\t\t\t}\n\t\t\t});\n\t\t\tcontent._applyImages(textures);\n\t\t\tresolve(contentInterface(content));\n\t\t});\n\t});\n}\n\n/**\n * Loads contents: the factory each runtime content file registered under the\n * target's composition id (the file has to be loaded already), the content's\n * images from the target's base path, and the content built with them.\n */\nexport function loadContentAsync(target: IContentTarget, options?: ILoadContentOptions): Promise<IContent>;\nexport function loadContentAsync(targets: IContentTarget[], options?: ILoadContentOptions): Promise<IContent[]>;\nexport function loadContentAsync(targets: IContentTarget | IContentTarget[], options?: ILoadContentOptions): Promise<IContent | IContent[]> {\n\tconst opts = options || {};\n\tif (Array.isArray(targets)) {\n\t\treturn Promise.all(targets.map(target => loadContent(target, opts)));\n\t}\n\treturn loadContent(targets, opts);\n}\n"],"names":["this","prototypeAccessors","let","const","i","super","prototypeAccessors$1","texture","value"],"mappings":";;;;;;;;;AAAA;;;AAGG;IAeU,KAAK,GAgBjB,SAAA,KAAA,CAAY,IAAY,EAAE,OAAiB,EAAE,UAAoB,EAAA;IAdjE,IAAA,CAAA,MAAM,GAA2B,IAAI;IACrC,IAAA,CAAA,aAAa,GAA2B,IAAI;IAC5C,IAAA,CAAA,UAAU,GAAG,CAAC;IAId,IAAA,CAAA,gBAAgB,GAAG,KAAK;IACxB,IAAA,CAAA,kBAAkB,GAAG,KAAK;IAC1B,IA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time.esm.js","sources":["../src/player/events.ts","../src/player/transform.ts","../src/player/geom.ts","../src/player/display.ts","../src/player/movieclip.ts","../src/player/objects.ts","../src/player/semver.ts","../src/player/version.ts","../src/player/ease.ts","../src/player/data.ts","../src/player/content.ts","../src/player/animate-container.ts","../src/player/loader.ts"],"sourcesContent":["/**\n * createjs-compatible events: Event and EventDispatcher, with the capture,\n * target and bubble phases createjs dispatches through the parent chain.\n */\n\nexport interface IEventHandlerObject {\n\thandleEvent(event: Event): void;\n}\n\n/** Data passed to a listener added with on() */\nexport type TEventData = string | number | boolean | object | null | undefined;\n\nexport type TEventListener = ((event: Event, data?: TEventData) => void) | IEventHandlerObject;\n\ninterface IListenerMap {\n\t[type: string]: TEventListener[];\n}\n\nexport class Event {\n\ttype: string;\n\ttarget: EventDispatcher | null = null;\n\tcurrentTarget: EventDispatcher | null = null;\n\teventPhase = 0;\n\tbubbles: boolean;\n\tcancelable: boolean;\n\ttimeStamp: number;\n\tdefaultPrevented = false;\n\tpropagationStopped = false;\n\timmediatePropagationStopped = false;\n\tremoved = false;\n\t/** Time since the last tick, for tick events (createjs Ticker events carry it) */\n\tdelta: number | undefined;\n\tpaused: boolean | undefined;\n\n\tconstructor(type: string, bubbles?: boolean, cancelable?: boolean) {\n\t\tthis.type = type;\n\t\tthis.bubbles = !!bubbles;\n\t\tthis.cancelable = !!cancelable;\n\t\tthis.timeStamp = Date.now();\n\t}\n\n\tpreventDefault(): void {\n\t\tthis.defaultPrevented = this.cancelable;\n\t}\n\n\tstopPropagation(): void {\n\t\tthis.propagationStopped = true;\n\t}\n\n\tstopImmediatePropagation(): void {\n\t\tthis.immediatePropagationStopped = this.propagationStopped = true;\n\t}\n\n\tremove(): void {\n\t\tthis.removed = true;\n\t}\n\n\tclone(): Event {\n\t\treturn new Event(this.type, this.bubbles, this.cancelable);\n\t}\n\n\tset(props: { [key: string]: string | number | boolean | null }): Event {\n\t\tObject.keys(props).forEach(key => {\n\t\t\tReflect.set(this, key, props[key]);\n\t\t});\n\t\treturn this;\n\t}\n\n\ttoString(): string {\n\t\treturn '[Event (type=' + this.type + ')]';\n\t}\n}\n\nfunction callListener(listener: TEventListener, event: Event): void {\n\t// As createjs: an object with handleEvent is called through it, anything else directly\n\tif (typeof listener !== 'function') {\n\t\tlistener.handleEvent(event);\n\t} else {\n\t\tlistener(event);\n\t}\n}\n\nexport class EventDispatcher {\n\t_listeners: IListenerMap | null = null;\n\t_captureListeners: IListenerMap | null = null;\n\n\t/** The parent the bubble and capture phases walk through (a display object's parent) */\n\tget _eventParent(): EventDispatcher | null {\n\t\treturn null;\n\t}\n\n\taddEventListener(type: string, listener: TEventListener, useCapture?: boolean): TEventListener {\n\t\tlet listeners: IListenerMap | null = useCapture ? this._captureListeners : this._listeners;\n\t\tif (!listeners) {\n\t\t\tlisteners = {};\n\t\t\tif (useCapture) {\n\t\t\t\tthis._captureListeners = listeners;\n\t\t\t} else {\n\t\t\t\tthis._listeners = listeners;\n\t\t\t}\n\t\t}\n\n\t\tconst list = listeners[type];\n\t\tif (list) {\n\t\t\tthis.removeEventListener(type, listener, useCapture);\n\t\t\t// Removing may have dropped the list\n\t\t\tconst again = listeners[type];\n\t\t\tif (again) {\n\t\t\t\tagain.push(listener);\n\t\t\t} else {\n\t\t\t\tlisteners[type] = [listener];\n\t\t\t}\n\t\t} else {\n\t\t\tlisteners[type] = [listener];\n\t\t}\n\t\treturn listener;\n\t}\n\n\ton(type: string, listener: TEventListener, scope?: object, once?: boolean, data?: TEventData, useCapture?: boolean): TEventListener {\n\t\tconst owner = typeof listener === 'function' ? (scope || this) : (scope || listener);\n\t\tconst wrapper = function (event: Event): void {\n\t\t\tif (typeof listener === 'function') {\n\t\t\t\tlistener.call(owner, event, data);\n\t\t\t} else {\n\t\t\t\tlistener.handleEvent.call(owner, event);\n\t\t\t}\n\t\t\tif (once) {\n\t\t\t\tevent.remove();\n\t\t\t}\n\t\t};\n\t\treturn this.addEventListener(type, wrapper, useCapture);\n\t}\n\n\tremoveEventListener(type: string, listener: TEventListener, useCapture?: boolean): void {\n\t\tconst listeners = useCapture ? this._captureListeners : this._listeners;\n\t\tif (!listeners) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst list = listeners[type];\n\t\tif (!list) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (let i = 0, l = list.length; i < l; i++) {\n\t\t\tif (list[i] === listener) {\n\t\t\t\tif (l === 1) {\n\t\t\t\t\tdelete listeners[type];\n\t\t\t\t} else {\n\t\t\t\t\tlist.splice(i, 1);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\toff(type: string, listener: TEventListener, useCapture?: boolean): void {\n\t\tthis.removeEventListener(type, listener, useCapture);\n\t}\n\n\tremoveAllEventListeners(type?: string): void {\n\t\tif (!type) {\n\t\t\tthis._listeners = this._captureListeners = null;\n\t\t\treturn;\n\t\t}\n\t\tif (this._listeners) {\n\t\t\tdelete this._listeners[type];\n\t\t}\n\t\tif (this._captureListeners) {\n\t\t\tdelete this._captureListeners[type];\n\t\t}\n\t}\n\n\tdispatchEvent(eventOrType: Event | string, bubbles?: boolean, cancelable?: boolean): boolean {\n\t\tlet event: Event;\n\t\tif (typeof eventOrType === 'string') {\n\t\t\tconst listeners = this._listeners;\n\t\t\tif (!bubbles && (!listeners || !listeners[eventOrType])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tevent = new Event(eventOrType, bubbles, cancelable);\n\t\t} else {\n\t\t\t// An event that has been dispatched already is dispatched as a copy\n\t\t\tevent = eventOrType.target ? eventOrType.clone() : eventOrType;\n\t\t}\n\n\t\tevent.target = this;\n\n\t\tif (!event.bubbles || !this._eventParent) {\n\t\t\tthis._dispatchEvent(event, 2);\n\t\t} else {\n\t\t\tconst chain: EventDispatcher[] = [];\n\t\t\tfor (let top: EventDispatcher | null = this; top; top = top._eventParent) {\n\t\t\t\tchain.push(top);\n\t\t\t}\n\n\t\t\t// Capture phase, from the top down to the target's parent\n\t\t\tfor (let i = chain.length - 1; i >= 0 && !event.propagationStopped; i--) {\n\t\t\t\tchain[i]._dispatchEvent(event, 1 + (i === 0 ? 1 : 0));\n\t\t\t}\n\t\t\t// Bubble phase, from the target's parent up\n\t\t\tfor (let i = 1; i < chain.length && !event.propagationStopped; i++) {\n\t\t\t\tchain[i]._dispatchEvent(event, 3);\n\t\t\t}\n\t\t}\n\n\t\treturn !event.defaultPrevented;\n\t}\n\n\thasEventListener(type: string): boolean {\n\t\tconst listeners = this._listeners;\n\t\tconst capture = this._captureListeners;\n\t\treturn !!((listeners && listeners[type]) || (capture && capture[type]));\n\t}\n\n\twillTrigger(type: string): boolean {\n\t\tfor (let o: EventDispatcher | null = this; o; o = o._eventParent) {\n\t\t\tif (o.hasEventListener(type)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Phase 1 is capture, 2 the target, 3 bubbling. At the target, the capture\n\t * listeners run first and then the others (createjs runs the target phase\n\t * twice, the second time as phase 2.1, which reads the non-capture listeners).\n\t */\n\t_dispatchEvent(event: Event, phase: number): void {\n\t\tconst map = phase <= 2 ? this._captureListeners : this._listeners;\n\t\tconst found = map ? map[event.type] : undefined;\n\t\tif (found && found.length) {\n\t\t\tconst list = found.slice();\n\t\t\tevent.currentTarget = this;\n\t\t\tevent.eventPhase = phase | 0;\n\t\t\tevent.removed = false;\n\n\t\t\tfor (let i = 0; i < list.length && !event.immediatePropagationStopped; i++) {\n\t\t\t\tconst listener = list[i];\n\t\t\t\tcallListener(listener, event);\n\t\t\t\tif (event.removed) {\n\t\t\t\t\tthis.off(event.type, listener, phase === 1);\n\t\t\t\t\tevent.removed = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (phase === 2) {\n\t\t\tthis._dispatchEvent(event, 2.1);\n\t\t}\n\t}\n}\n","import * as PIXI from 'pixi.js';\n\nconst DEG_TO_RAD = Math.PI / 180;\nconst RAD_TO_DEG = 180 / Math.PI;\n\n/**\n * A Pixi Transform whose rotation and skew follow createjs.\n *\n * - The createjs values (degrees) are kept as written, so that reading them\n * back gives exactly what was written (a degrees -> radians -> degrees round\n * trip does not)\n * - Pixi's own fields carry the same values in Pixi's terms (rotation in\n * radians, skew.x = -skewX, skew.y = skewY, all in radians), so code that\n * uses the Pixi node sees consistent values. A write made through Pixi\n * (node.rotation, node.skew) is taken over as the new createjs value\n * - The local matrix is built the createjs way: skew x (rotation x scale),\n * i.e. the object is rotated first and then skewed. Pixi composes rotation\n * and skew the other way round (skewed, then rotated as a whole); the two\n * agree only while the rotation is 0 or skewX equals skewY. Published\n * content is the reference, so createjs's composition is used\n */\nexport class CjsTransform extends PIXI.Transform {\n\t/** createjs rotation, in degrees */\n\tdegRotation = 0;\n\t/** createjs skewX / skewY, in degrees */\n\tdegSkewX = 0;\n\tdegSkewY = 0;\n\n\t/** The radians last written to the Pixi fields for the values above */\n\tprivate _radRotation = 0;\n\tprivate _radSkewX = 0;\n\tprivate _radSkewY = 0;\n\n\tsetRotation(degrees: number): void {\n\t\tthis.degRotation = degrees;\n\t\tthis._radRotation = degrees * DEG_TO_RAD;\n\t\tif (this._rotation !== this._radRotation) {\n\t\t\tthis._rotation = this._radRotation;\n\t\t}\n\t\tthis.updateSkew();\n\t}\n\n\tsetSkewX(degrees: number): void {\n\t\tthis.degSkewX = degrees;\n\t\tthis._radSkewX = -degrees * DEG_TO_RAD;\n\t\t// Setting the point calls updateSkew when the value changes\n\t\tthis.skew.x = this._radSkewX;\n\t\tthis.updateSkew();\n\t}\n\n\tsetSkewY(degrees: number): void {\n\t\tthis.degSkewY = degrees;\n\t\tthis._radSkewY = degrees * DEG_TO_RAD;\n\t\tthis.skew.y = this._radSkewY;\n\t\tthis.updateSkew();\n\t}\n\n\tprotected updateSkew(): void {\n\t\t// Values written through Pixi become the createjs values\n\t\tif (this._rotation !== this._radRotation) {\n\t\t\tthis._radRotation = this._rotation;\n\t\t\tthis.degRotation = this._rotation * RAD_TO_DEG;\n\t\t}\n\t\tif (this.skew.x !== this._radSkewX) {\n\t\t\tthis._radSkewX = this.skew.x;\n\t\t\tthis.degSkewX = -this.skew.x * RAD_TO_DEG;\n\t\t}\n\t\tif (this.skew.y !== this._radSkewY) {\n\t\t\tthis._radSkewY = this.skew.y;\n\t\t\tthis.degSkewY = this.skew.y * RAD_TO_DEG;\n\t\t}\n\n\t\t// createjs Matrix2D.appendTransform: (skew) x (rotation, scale)\n\t\tlet cos = 1;\n\t\tlet sin = 0;\n\t\tif (this.degRotation % 360) {\n\t\t\tconst r = this.degRotation * DEG_TO_RAD;\n\t\t\tcos = Math.cos(r);\n\t\t\tsin = Math.sin(r);\n\t\t}\n\n\t\tif (this.degSkewX || this.degSkewY) {\n\t\t\tconst skewX = this.degSkewX * DEG_TO_RAD;\n\t\t\tconst skewY = this.degSkewY * DEG_TO_RAD;\n\t\t\tconst a1 = Math.cos(skewY);\n\t\t\tconst b1 = Math.sin(skewY);\n\t\t\tconst c1 = -Math.sin(skewX);\n\t\t\tconst d1 = Math.cos(skewX);\n\t\t\tthis._cx = a1 * cos + c1 * sin;\n\t\t\tthis._sx = b1 * cos + d1 * sin;\n\t\t\tthis._cy = a1 * -sin + c1 * cos;\n\t\t\tthis._sy = b1 * -sin + d1 * cos;\n\t\t} else {\n\t\t\tthis._cx = cos;\n\t\t\tthis._sx = sin;\n\t\t\tthis._cy = -sin;\n\t\t\tthis._sy = cos;\n\t\t}\n\n\t\tthis._localID++;\n\t}\n}\n","import * as PIXI from 'pixi.js';\n\n/**\n * createjs-compatible Rectangle (its own members are exactly x, y, width,\n * height, as createjs's; Pixi's Rectangle also carries a shape type).\n */\nexport class Rectangle {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n\n\tconstructor(x?: number, y?: number, width?: number, height?: number) {\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t\tthis.width = width || 0;\n\t\tthis.height = height || 0;\n\t}\n\n\tsetValues(x?: number, y?: number, width?: number, height?: number): this {\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t\tthis.width = width || 0;\n\t\tthis.height = height || 0;\n\t\treturn this;\n\t}\n\n\tcopy(rect: Rectangle): this {\n\t\treturn this.setValues(rect.x, rect.y, rect.width, rect.height);\n\t}\n\n\tclone(): Rectangle {\n\t\treturn new Rectangle(this.x, this.y, this.width, this.height);\n\t}\n\n\tcontains(x: number, y: number, width?: number, height?: number): boolean {\n\t\tconst w = width || 0;\n\t\tconst h = height || 0;\n\t\treturn x >= this.x && x + w <= this.x + this.width && y >= this.y && y + h <= this.y + this.height;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn this.width <= 0 || this.height <= 0;\n\t}\n\n\ttoPixi(): PIXI.Rectangle {\n\t\treturn new PIXI.Rectangle(this.x, this.y, this.width, this.height);\n\t}\n\n\ttoString(): string {\n\t\treturn '[Rectangle (x=' + this.x + ' y=' + this.y + ' width=' + this.width + ' height=' + this.height + ')]';\n\t}\n}\n","import * as PIXI from 'pixi.js';\nimport { Event, EventDispatcher } from './events';\nimport { CjsTransform } from './transform';\nimport { Rectangle } from './geom';\n\n/**\n * A Pixi node owned by a createjs-compatible display object.\n */\nexport interface IOwnedNode extends PIXI.Container {\n\towner: DisplayObject | null;\n}\n\nexport class PixiContainer extends PIXI.Container implements IOwnedNode {\n\towner: DisplayObject | null = null;\n}\n\nlet nextId = 0;\n\n/** A hit area nothing is inside: Pixi's hit test skips a node with it and the node's children */\nexport const NO_HIT_AREA = new PIXI.Rectangle(0, 0, 0, 0);\n\n/** createjs compositeOperation -> Pixi blend mode (the ones WebGL renders) */\nconst BLEND_MODES: { [operation: string]: PIXI.BLEND_MODES } = {\n\t'source-over': PIXI.BLEND_MODES.NORMAL,\n\tlighter: PIXI.BLEND_MODES.ADD,\n\tmultiply: PIXI.BLEND_MODES.MULTIPLY,\n\tscreen: PIXI.BLEND_MODES.SCREEN\n};\n\n/**\n * Members a filter shown through a display object has to provide.\n */\nexport interface IFilterLike {\n\tpixiFilter: PIXI.Filter;\n}\n\nexport interface ICacheState {\n\tx: number;\n\ty: number;\n\twidth: number;\n\theight: number;\n\tscale: number;\n}\n\n/**\n * createjs-compatible display object: a window onto a Pixi node.\n *\n * The values both have in common live on the Pixi node only (x / y on\n * position, scaleX / scaleY on scale, regX / regY on pivot, alpha, visible),\n * read and written through accessors, so a write through the Pixi node and a\n * write through this object are the same write. Members that mean different\n * things in createjs and Pixi keep the createjs meaning here (rotation and\n * skew in degrees, mask, filters, parent); the Pixi node keeps the Pixi one.\n */\nexport class DisplayObject extends EventDispatcher {\n\t/** The Pixi node this object shows */\n\treadonly pixi: IOwnedNode;\n\treadonly id: number;\n\tparent: Container | null = null;\n\ttickEnabled = true;\n\tmouseEnabled = true;\n\tcursor: string | null = null;\n\thitArea: DisplayObject | null = null;\n\tshadow: null = null;\n\tsnapToPixel = true;\n\t/**\n\t * Kept off the display list by the timeline (published code sets it on masks\n\t * and absent instances). createjs reads it only when its timeline places\n\t * children: it does not affect drawing (an _off object on a display list is drawn)\n\t */\n\t/** createjs leaves it unset (undefined) until the timeline or published code sets it */\n\tprivate _offValue: boolean | undefined = undefined;\n\tprivate _name: string | null = null;\n\tprivate _mask: DisplayObject | null = null;\n\tprivate _filters: IFilterLike[] | null = null;\n\tprivate _compositeOperation: string | null = null;\n\t/** The composite operation in effect on the parent (createjs draws children under it) */\n\tprivate _inheritedComposite: string | null = null;\n\t/** The cache createjs would draw through (filters show in Pixi without one) */\n\tbitmapCache: ICacheState | null = null;\n\t/** Set only when the symbol has them (createjs leaves them undefined otherwise) */\n\tnominalBounds?: Rectangle | null;\n\tframeBounds?: Rectangle[] | null;\n\t_bounds: Rectangle | null = null;\n\t/** The parent whose Pixi node holds this object's mask node */\n\t_maskHost: Container | null = null;\n\t/** The objects this object masks (while they are on a display list) */\n\t_maskTargets: DisplayObject[] = [];\n\t/**\n\t * Set on a root when a timeline under it jumped outside the playing (a goto):\n\t * its clips are to be settled before Pixi draws it (settleForDrawing), as a\n\t * createjs draw would. The resolve phase of a frame clears it\n\t */\n\t_pendingResolve = false;\n\n\tconstructor(pixi: IOwnedNode) {\n\t\tsuper();\n\t\tthis.id = nextId++;\n\t\tthis.pixi = pixi;\n\t\tpixi.owner = this;\n\t\tpixi.transform = new CjsTransform();\n\t}\n\n\tget _eventParent(): EventDispatcher | null {\n\t\treturn this.parent;\n\t}\n\n\tprivate get _transform(): CjsTransform {\n\t\tconst transform = this.pixi.transform;\n\t\tif (transform instanceof CjsTransform) {\n\t\t\treturn transform;\n\t\t}\n\t\t// The Pixi side replaced the transform: keep createjs semantics on a new one\n\t\tconst replacement = new CjsTransform();\n\t\treplacement.setFromMatrix(transform.localTransform);\n\t\tthis.pixi.transform = replacement;\n\t\treturn replacement;\n\t}\n\n\tget x(): number { return this.pixi.position.x; }\n\tset x(value: number) { this.pixi.position.x = value; }\n\tget y(): number { return this.pixi.position.y; }\n\tset y(value: number) { this.pixi.position.y = value; }\n\tget scaleX(): number { return this.pixi.scale.x; }\n\tset scaleX(value: number) { this.pixi.scale.x = value; }\n\tget scaleY(): number { return this.pixi.scale.y; }\n\tset scaleY(value: number) { this.pixi.scale.y = value; }\n\tget regX(): number { return this.pixi.pivot.x; }\n\tset regX(value: number) { this.pixi.pivot.x = value; }\n\tget regY(): number { return this.pixi.pivot.y; }\n\tset regY(value: number) { this.pixi.pivot.y = value; }\n\tget rotation(): number { return this._transform.degRotation; }\n\tset rotation(value: number) { this._transform.setRotation(value); }\n\tget skewX(): number { return this._transform.degSkewX; }\n\tset skewX(value: number) { this._transform.setSkewX(value); }\n\tget skewY(): number { return this._transform.degSkewY; }\n\tset skewY(value: number) { this._transform.setSkewY(value); }\n\tget alpha(): number { return this.pixi.alpha; }\n\tset alpha(value: number) { this.pixi.alpha = value; }\n\tget visible(): boolean { return this.pixi.visible; }\n\tset visible(value: boolean) { this.pixi.visible = value; }\n\tget name(): string | null { return this._name; }\n\tset name(value: string | null) {\n\t\tthis._name = value;\n\t\tthis.pixi.name = value == null ? '' : String(value);\n\t}\n\n\tget _off(): boolean | undefined { return this._offValue; }\n\tset _off(value: boolean | undefined) {\n\t\tthis._offValue = value;\n\t}\n\n\tget compositeOperation(): string | null { return this._compositeOperation; }\n\tset compositeOperation(value: string | null) {\n\t\tthis._compositeOperation = value;\n\t\tthis._applyComposite();\n\t}\n\n\t/**\n\t * The composite operation createjs draws this object with: its own, or else\n\t * the nearest ancestor's (createjs sets it on the context and draws the\n\t * children under it, each child saving and restoring the context)\n\t */\n\t_effectiveComposite(): string | null {\n\t\treturn this._compositeOperation || this._inheritedComposite;\n\t}\n\n\t/** Told by the parent when the composite operation in effect on it changes */\n\t_setInheritedComposite(value: string | null): void {\n\t\tif (value === this._inheritedComposite) {\n\t\t\treturn;\n\t\t}\n\t\tthis._inheritedComposite = value;\n\t\tthis._applyComposite();\n\t}\n\n\t/**\n\t * Pixi blends per drawing node (a container has no blend mode of its own),\n\t * so the composite operation in effect is set on this object's drawing node\n\t * and handed down to the children\n\t */\n\t_applyComposite(): void {\n\t\tconst composite = this._effectiveComposite();\n\t\tconst mode = composite ? BLEND_MODES[composite] : undefined;\n\t\tthis._setBlendMode(mode === undefined ? PIXI.BLEND_MODES.NORMAL : mode);\n\t}\n\n\tget mask(): DisplayObject | null { return this._mask; }\n\tset mask(value: DisplayObject | null) {\n\t\tif (this._mask === value) {\n\t\t\treturn;\n\t\t}\n\t\tconst host = this._maskHost;\n\t\tif (host) {\n\t\t\thost._detachMask(this);\n\t\t}\n\t\tthis._mask = value;\n\t\tthis.pixi.mask = null;\n\t\tif (this.parent) {\n\t\t\tthis.parent._attachMask(this);\n\t\t}\n\t}\n\n\tget filters(): IFilterLike[] | null { return this._filters; }\n\tset filters(value: IFilterLike[] | null) {\n\t\tthis._filters = value;\n\t\tthis.pixi.filters = value && value.length ? value.map(filter => filter.pixiFilter) : [];\n\t}\n\n\t/** Blend mode for the Pixi node(s) that draw this object */\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tconst node = this.pixi;\n\t\tif (node instanceof PIXI.Sprite || node instanceof PIXI.Graphics) {\n\t\t\tnode.blendMode = mode;\n\t\t}\n\t}\n\n\t/**\n\t * The node is drawn unless Pixi uses it as a mask, or it is in a parent's\n\t * node only to carry the mask shape of a sibling (a createjs mask is not on\n\t * any display list and is not drawn itself)\n\t */\n\t_updateRenderable(): void {\n\t\tconst maskOnly = this.pixi.isMask || this._maskTargets.length > 0;\n\t\tthis.pixi.renderable = !maskOnly;\n\t\t// Pixi hit tests nodes that are not drawn: a mask's node is kept out of pointer\n\t\t// hits (with its children) by a hit area nothing is inside, as createjs never hits a mask\n\t\tif (maskOnly) {\n\t\t\tthis.pixi.hitArea = NO_HIT_AREA;\n\t\t} else if (this.pixi.hitArea === NO_HIT_AREA) {\n\t\t\t// Back to Pixi's default (null; the type definition does not take null, Pixi does)\n\t\t\tReflect.set(this.pixi, 'hitArea', null);\n\t\t}\n\t}\n\n\t/** Whether this object clips when used as a mask (createjs clips only with a non-empty Graphics) */\n\t_clipsAsMask(): boolean {\n\t\treturn false;\n\t}\n\n\t/** The node Pixi masks with when this object is a mask */\n\t_pixiMaskNode(): PIXI.Container | null {\n\t\treturn null;\n\t}\n\n\t/** Called when this object stops being some object's Pixi mask */\n\t_releaseMaskNode(): void {\n\t\t// Nothing to release for objects that are not shapes\n\t}\n\n\t/** Sets the Pixi mask from the createjs one: Pixi masks only while the createjs mask would clip */\n\t_updatePixiMask(): void {\n\t\tconst mask = this._mask;\n\t\tconst node = mask && this._maskHost && mask._clipsAsMask() ? mask._pixiMaskNode() : null;\n\t\tif (this.pixi.mask !== node) {\n\t\t\tthis.pixi.mask = node;\n\t\t\tif (!node && mask) {\n\t\t\t\tmask._releaseMaskNode();\n\t\t\t}\n\t\t}\n\t}\n\n\tsetTransform(x?: number, y?: number, scaleX?: number, scaleY?: number, rotation?: number, skewX?: number, skewY?: number, regX?: number, regY?: number): this {\n\t\tthis.x = x || 0;\n\t\tthis.y = y || 0;\n\t\tthis.scaleX = scaleX == null ? 1 : scaleX;\n\t\tthis.scaleY = scaleY == null ? 1 : scaleY;\n\t\tthis.rotation = rotation || 0;\n\t\tthis.skewX = skewX || 0;\n\t\tthis.skewY = skewY || 0;\n\t\tthis.regX = regX || 0;\n\t\tthis.regY = regY || 0;\n\t\treturn this;\n\t}\n\n\tset(props: { [key: string]: string | number | boolean | null }): this {\n\t\tObject.keys(props).forEach(key => {\n\t\t\tReflect.set(this, key, props[key]);\n\t\t});\n\t\treturn this;\n\t}\n\n\tisVisible(): boolean {\n\t\treturn !!(this.visible && this.alpha > 0 && this.scaleX !== 0 && this.scaleY !== 0);\n\t}\n\n\tcache(x: number, y: number, width: number, height: number, scale?: number): void {\n\t\tthis.bitmapCache = { x, y, width, height, scale: scale || 1 };\n\t}\n\n\tupdateCache(): void {\n\t\t// Nothing is cached on the Pixi side; filters apply without a cache\n\t}\n\n\tuncache(): void {\n\t\tthis.bitmapCache = null;\n\t}\n\n\tsetBounds(x: number | null, y?: number, width?: number, height?: number): void {\n\t\tthis._bounds = x == null ? null : new Rectangle(x, y, width, height);\n\t}\n\n\tgetChildDepth(): number {\n\t\tlet depth = 0;\n\t\tfor (let o = this.parent; o; o = o.parent) {\n\t\t\tdepth++;\n\t\t}\n\t\treturn depth;\n\t}\n\n\t/** createjs tick phase: dispatches the tick event to listeners */\n\t_tick(event: Event): void {\n\t\tconst listeners = this._listeners;\n\t\tif (listeners && listeners.tick) {\n\t\t\tevent.target = null;\n\t\t\tevent.propagationStopped = event.immediatePropagationStopped = false;\n\t\t\tthis.dispatchEvent(event);\n\t\t}\n\t}\n\n\ttoString(): string {\n\t\treturn '[DisplayObject (name=' + this.name + ')]';\n\t}\n}\n\n/**\n * createjs-compatible Container. The Pixi node's children are the display\n * list's nodes in the same order, followed by the nodes of the masks the\n * children use (a createjs mask is drawn in its target's parent space, so\n * its node lives in the parent's node).\n */\nexport class Container extends DisplayObject {\n\tchildren: DisplayObject[] = [];\n\ttickChildren = true;\n\tmouseChildren = true;\n\t/** Mask nodes held in this container's node, by the child that uses them */\n\tprivate _maskNodes: { [childId: number]: IOwnedNode } = {};\n\n\tconstructor(pixi?: IOwnedNode) {\n\t\tsuper(pixi || new PixiContainer());\n\t}\n\n\tget numChildren(): number {\n\t\treturn this.children.length;\n\t}\n\n\taddChild(...children: DisplayObject[]): DisplayObject | null {\n\t\tlet last: DisplayObject | null = null;\n\t\tchildren.forEach(child => {\n\t\t\tif (child != null) {\n\t\t\t\tlast = this.addChildAt(child, this.children.length);\n\t\t\t}\n\t\t});\n\t\treturn last;\n\t}\n\n\taddChildAt(child: DisplayObject, index: number): DisplayObject {\n\t\tif (index < 0 || index > this.children.length) {\n\t\t\treturn child;\n\t\t}\n\n\t\tconst oldParent = child.parent;\n\t\tconst same = oldParent === this;\n\t\tif (oldParent) {\n\t\t\toldParent._removeChildAt(oldParent.children.indexOf(child), same);\n\t\t}\n\t\tchild.parent = this;\n\t\tthis.children.splice(index, 0, child);\n\t\tthis.pixi.addChildAt(child.pixi, index);\n\t\tthis._attachMask(child);\n\t\tchild._setInheritedComposite(this._effectiveComposite());\n\t\tif (!same) {\n\t\t\tchild.dispatchEvent('added');\n\t\t}\n\t\treturn child;\n\t}\n\n\tremoveChild(...children: DisplayObject[]): boolean {\n\t\tlet removed = true;\n\t\tchildren.forEach(child => {\n\t\t\tremoved = this._removeChildAt(this.children.indexOf(child)) && removed;\n\t\t});\n\t\treturn removed;\n\t}\n\n\tremoveChildAt(...indexes: number[]): boolean {\n\t\tconst sorted = indexes.slice().sort((a, b) => b - a);\n\t\tlet removed = true;\n\t\tsorted.forEach(index => {\n\t\t\tremoved = this._removeChildAt(index) && removed;\n\t\t});\n\t\treturn removed;\n\t}\n\n\tremoveAllChildren(): void {\n\t\twhile (this.children.length) {\n\t\t\tthis._removeChildAt(0);\n\t\t}\n\t}\n\n\tgetChildAt(index: number): DisplayObject | undefined {\n\t\treturn this.children[index];\n\t}\n\n\tgetChildByName(name: string): DisplayObject | null {\n\t\tconst children = this.children;\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tif (children[i].name == name) {\n\t\t\t\treturn children[i];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n\tgetChildIndex(child: DisplayObject): number {\n\t\treturn this.children.indexOf(child);\n\t}\n\n\tsetChildIndex(child: DisplayObject, index: number): void {\n\t\tconst children = this.children;\n\t\tif (child.parent !== this || index < 0 || index >= children.length) {\n\t\t\treturn;\n\t\t}\n\t\tconst current = children.indexOf(child);\n\t\tif (current < 0 || current === index) {\n\t\t\treturn;\n\t\t}\n\t\tchildren.splice(current, 1);\n\t\tchildren.splice(index, 0, child);\n\t\tthis.pixi.setChildIndex(child.pixi, index);\n\t}\n\n\tswapChildrenAt(index1: number, index2: number): void {\n\t\tconst children = this.children;\n\t\tconst a = children[index1];\n\t\tconst b = children[index2];\n\t\tif (!a || !b) {\n\t\t\treturn;\n\t\t}\n\t\tchildren[index1] = b;\n\t\tchildren[index2] = a;\n\t\tthis.pixi.swapChildren(a.pixi, b.pixi);\n\t}\n\n\tswapChildren(child1: DisplayObject, child2: DisplayObject): void {\n\t\tconst index1 = this.children.indexOf(child1);\n\t\tconst index2 = this.children.indexOf(child2);\n\t\tif (index1 >= 0 && index2 >= 0) {\n\t\t\tthis.swapChildrenAt(index1, index2);\n\t\t}\n\t}\n\n\tsortChildren(compare: (a: DisplayObject, b: DisplayObject) => number): void {\n\t\tthis.children.sort(compare);\n\t\tthis.children.forEach((child, index) => {\n\t\t\tthis.pixi.setChildIndex(child.pixi, index);\n\t\t});\n\t}\n\n\tcontains(child: DisplayObject | null): boolean {\n\t\tfor (let o = child; o; o = o.parent) {\n\t\t\tif (o === this) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\n\t_removeChildAt(index: number, silent?: boolean): boolean {\n\t\tif (index < 0 || index > this.children.length - 1) {\n\t\t\treturn false;\n\t\t}\n\t\tconst child = this.children[index];\n\t\tthis._detachMask(child);\n\t\tchild.parent = null;\n\t\tthis.children.splice(index, 1);\n\t\tthis.pixi.removeChild(child.pixi);\n\t\t// A silent removal is the first half of re-adding to this same container\n\t\t// (the timeline does it every resolve): the inherited composite stays\n\t\tif (!silent) {\n\t\t\tchild._setInheritedComposite(null);\n\t\t\tchild.dispatchEvent('removed');\n\t\t}\n\t\treturn true;\n\t}\n\n\t/** Puts the node of a child's mask into this container's node, and sets it as the Pixi mask */\n\t_attachMask(child: DisplayObject): void {\n\t\tconst mask = child.mask;\n\t\tif (!mask || child.parent !== this) {\n\t\t\treturn;\n\t\t}\n\t\tthis._maskNodes[child.id] = mask.pixi;\n\t\tthis.pixi.addChild(mask.pixi);\n\t\tchild._maskHost = this;\n\t\tmask._maskTargets.push(child);\n\t\tmask._updateRenderable();\n\t\tchild._updatePixiMask();\n\t}\n\n\t_detachMask(child: DisplayObject): void {\n\t\tconst node = this._maskNodes[child.id];\n\t\tif (node) {\n\t\t\tdelete this._maskNodes[child.id];\n\t\t\tif (node.parent === this.pixi) {\n\t\t\t\tthis.pixi.removeChild(node);\n\t\t\t}\n\t\t}\n\t\tconst mask = child.mask;\n\t\tif (mask) {\n\t\t\tconst index = mask._maskTargets.indexOf(child);\n\t\t\tif (index >= 0) {\n\t\t\t\tmask._maskTargets.splice(index, 1);\n\t\t\t}\n\t\t}\n\t\tchild._maskHost = null;\n\t\tchild.pixi.mask = null;\n\t\tif (mask) {\n\t\t\t// Pixi makes a released mask node renderable again\n\t\t\tmask._releaseMaskNode();\n\t\t\tmask._updateRenderable();\n\t\t}\n\t}\n\n\t_applyComposite(): void {\n\t\tsuper._applyComposite();\n\t\tconst composite = this._effectiveComposite();\n\t\tthis.children.forEach(child => child._setInheritedComposite(composite));\n\t}\n\n\t/** createjs tick phase: children in reverse order (live array), then this object's listeners */\n\t_tick(event: Event): void {\n\t\tif (this.tickChildren) {\n\t\t\tfor (let i = this.children.length - 1; i >= 0; i--) {\n\t\t\t\tconst child = this.children[i];\n\t\t\t\tif (child.tickEnabled) {\n\t\t\t\t\tchild._tick(event);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsuper._tick(event);\n\t}\n\n\ttoString(): string {\n\t\treturn '[Container (name=' + this.name + ')]';\n\t}\n}\n","import { Container, DisplayObject, IOwnedNode } from './display';\nimport { Event } from './events';\nimport type { IRuntimeTweenDef, IStateEntryDef, TFrameValue, ILabelDef } from './data';\n\n/** A frame script, called with the clip as `this` */\nexport type TScript = (...args: Array<object | string | number | boolean | null>) => void;\n\n/** A recorded value as written (Graphics references resolved) */\nexport type TWrittenValue = object | string | number | boolean | null;\n\n/**\n * A generated writer: writes the recorded values to the target property by\n * property, the names written out in its code (values[i] to the i-th\n * property; resolve turns a recorded Graphics reference into the Graphics).\n * An initial-value writer has its values in its code and takes the target only.\n */\nexport type TWriter = (target: object, values?: TFrameValue[], resolve?: (value: TFrameValue) => TWrittenValue) => void;\n/** Gives an instance its named children: `self.<name> = slots[<slot>]` for each, the names written in the code */\nexport type TMemberWriter = (self: object, slots: object[]) => void;\n\n/**\n * What a MovieClip instance needs to play a tween of its symbol: how to find\n * the objects a recorded value refers to.\n */\nexport interface ITweenScope {\n\t/** The target of a state entry (a slot of the instance) */\n\tstateTarget(entry: IStateEntryDef): DisplayObject | null;\n\t/** A recorded value as written (Graphics references resolved) */\n\tvalue(value: TFrameValue): TWrittenValue;\n\t/** A frame script by index */\n\tscript(index: number): TScript;\n\t/** A writer by index */\n\twriter(index: number): TWriter;\n}\n\n/**\n * The playback state of one tween of an instance. The values come from the\n * shared definition; only the positions are per instance.\n */\nexport class TweenState {\n\treadonly def: IRuntimeTweenDef;\n\t/**\n\t * What the tween writes to: a display object or a filter (through their\n\t * accessors), or the plain object published code tweens `state` arrays on\n\t */\n\treadonly target: object;\n\treadonly scope: ITweenScope;\n\treadonly self: MovieClip;\n\tposition = 0;\n\trawPosition = -1;\n\t/** Distance from the start of the current step (synched children take their frame from it) */\n\t_stepPosition = 0;\n\tpassive = false;\n\n\tconstructor(def: IRuntimeTweenDef, target: object, scope: ITweenScope, self: MovieClip) {\n\t\tthis.def = def;\n\t\tthis.target = target;\n\t\tthis.scope = scope;\n\t\tthis.self = self;\n\t}\n\n\tget duration(): number {\n\t\treturn this.def.duration;\n\t}\n\n\t/**\n\t * Tween.setPosition as a timeline drives it (actions are run separately by\n\t * the timeline). Nothing happens when the raw position does not change.\n\t */\n\tsetPosition(rawPosition: number, jump: boolean): void {\n\t\tconst duration = this.def.duration;\n\t\tconst previous = this.rawPosition;\n\t\tlet raw = rawPosition < 0 ? 0 : rawPosition;\n\t\tlet position = 0;\n\t\tlet end: boolean;\n\n\t\tif (duration === 0) {\n\t\t\tend = true;\n\t\t\tif (previous !== -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tconst loops = raw / duration | 0;\n\t\t\tposition = raw - loops * duration;\n\t\t\t// A tween in a timeline does not loop: it ends at its duration\n\t\t\tend = raw >= duration;\n\t\t\tif (end) {\n\t\t\t\traw = position = duration;\n\t\t\t}\n\t\t\tif (raw === previous) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.position = position;\n\t\tthis.rawPosition = raw;\n\t\tthis._updatePosition(jump, end);\n\t}\n\n\tprivate _updatePosition(jump: boolean, end: boolean): void {\n\t\tconst def = this.def;\n\t\tconst position = this.position;\n\n\t\tif (def.writer !== null) {\n\t\t\tthis.scope.writer(def.writer)(this.target, def.values[def.frames[position]], this.scope.value);\n\t\t}\n\n\t\t// The last step whose start is at or before the position\n\t\tconst keyframes = def.keyframes;\n\t\tlet start = 0;\n\t\tlet found = false;\n\t\tfor (let i = 0; i < keyframes.length; i++) {\n\t\t\tif (keyframes[i] <= position || i === 0) {\n\t\t\t\tstart = keyframes[i];\n\t\t\t\tfound = true;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tthis._stepPosition = found ? position - start : 0;\n\t}\n\n\t/** AbstractTween._runActions for this tween's actions */\n\t_runActions(startRaw: number, endRaw: number, jump: boolean, includeStart: boolean): boolean {\n\t\tif (!this.def.actions.length) {\n\t\t\treturn false;\n\t\t}\n\t\treturn runActions(this, this.def.duration, 0, startRaw, endRaw, jump, includeStart);\n\t}\n\n\t/** Tween._runActionsRange: runs the actions in the range, stopping when one moves the tween */\n\t_runActionsRange(start: number, end: number, jump: boolean, includeStart: boolean): boolean {\n\t\tconst actions = this.def.actions;\n\t\tconst reverse = start > end;\n\t\tconst low = reverse ? end : start;\n\t\tconst high = reverse ? start : end;\n\t\tconst position = this.position;\n\n\t\tfor (let n = 0; n < actions.length; n++) {\n\t\t\tconst action = actions[reverse ? actions.length - 1 - n : n];\n\t\t\tconst t = action.position;\n\t\t\tif (t === end || (t > low && t < high) || (includeStart && t === start)) {\n\t\t\t\tconst scope = this.scope;\n\t\t\t\tconst params = action.params ? action.params.map(value => scope.value(value)) : [this];\n\t\t\t\tscope.script(action.script).apply(this.self, params);\n\t\t\t\tif (position !== this.position) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\ninterface IActionRunner {\n\t_runActionsRange(start: number, end: number, jump: boolean, includeStart: boolean): boolean;\n}\n\n/**\n * AbstractTween._runActions: splits the move from one raw position to another\n * into per-loop ranges and runs the actions of each, as createjs does.\n */\nfunction runActions(runner: IActionRunner, duration: number, loop: number, startRaw: number, endRaw: number, jump: boolean, includeStart: boolean): boolean {\n\tlet startLoop: number;\n\tlet endLoop: number;\n\tlet start: number;\n\tlet end: number;\n\n\tif (duration === 0) {\n\t\tstartLoop = endLoop = start = end = 0;\n\t} else {\n\t\tstartLoop = startRaw / duration | 0;\n\t\tendLoop = endRaw / duration | 0;\n\t\tstart = startRaw - startLoop * duration;\n\t\tend = endRaw - endLoop * duration;\n\t}\n\n\tif (loop !== -1) {\n\t\tif (endLoop > loop) {\n\t\t\tend = duration;\n\t\t\tendLoop = loop;\n\t\t}\n\t\tif (startLoop > loop) {\n\t\t\tstart = duration;\n\t\t\tstartLoop = loop;\n\t\t}\n\t}\n\n\tif (jump) {\n\t\treturn runner._runActionsRange(end, end, jump, includeStart);\n\t}\n\n\tif (startLoop !== endLoop || start !== end || jump || includeStart) {\n\t\tif (startLoop === -1) {\n\t\t\tstartLoop = start = 0;\n\t\t}\n\t\tconst forward = endRaw >= startRaw;\n\t\tlet n = startLoop;\n\t\tlet first = includeStart;\n\t\tdo {\n\t\t\tconst rangeStart = n === startLoop ? start : forward ? 0 : duration;\n\t\t\tconst rangeEnd = n === endLoop ? end : forward ? duration : 0;\n\t\t\tif (runner._runActionsRange(rangeStart, rangeEnd, jump, first || n !== startLoop)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tfirst = false;\n\t\t} while ((forward && ++n <= endLoop) || (!forward && --n >= endLoop));\n\t}\n\treturn false;\n}\n\n/**\n * The timeline of a MovieClip instance (createjs.Timeline as a MovieClip drives it).\n */\nexport class Timeline implements IActionRunner {\n\treadonly tweens: TweenState[] = [];\n\treadonly duration: number;\n\tloop = 0;\n\tposition = 0;\n\trawPosition = -1;\n\tprivate readonly _labels: { [label: string]: number };\n\tprivate readonly _labelList: ILabelDef[];\n\n\tconstructor(duration: number, labels: ILabelDef[]) {\n\t\tthis.duration = duration;\n\t\tthis._labels = {};\n\t\tlabels.forEach(label => {\n\t\t\tthis._labels[label.label] = label.position;\n\t\t});\n\t\tthis._labelList = labels.slice().sort((a, b) => a.position - b.position);\n\t}\n\n\tgetLabels(): ILabelDef[] {\n\t\treturn this._labelList;\n\t}\n\n\tget currentLabel(): string | null {\n\t\tconst labels = this._labelList;\n\t\tlet i = 0;\n\t\tfor (; i < labels.length; i++) {\n\t\t\tif (this.position < labels[i].position) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn i === 0 ? null : labels[i - 1].label;\n\t}\n\n\tresolve(positionOrLabel: string | number): number | undefined {\n\t\tconst position = Number(positionOrLabel);\n\t\tif (!isNaN(position)) {\n\t\t\treturn position;\n\t\t}\n\t\tconst label = this._labels[positionOrLabel];\n\t\treturn label === undefined ? undefined : label;\n\t}\n\n\t/**\n\t * AbstractTween.setPosition for the timeline: moves every tween, calls\n\t * back (the clip resolves its children), then runs the actions passed.\n\t */\n\tsetPosition(rawPosition: number, skipActions: boolean, jump: boolean, callback: (() => void) | null): void {\n\t\tconst duration = this.duration;\n\t\tconst loop = this.loop;\n\t\tconst previous = this.rawPosition;\n\t\tlet raw = rawPosition < 0 ? 0 : rawPosition;\n\t\tlet position = 0;\n\n\t\tif (duration === 0) {\n\t\t\tif (previous !== -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\tconst loops = raw / duration | 0;\n\t\t\tposition = raw - loops * duration;\n\t\t\tconst end = loop !== -1 && raw >= loop * duration + duration;\n\t\t\tif (end) {\n\t\t\t\tposition = duration;\n\t\t\t\traw = duration * loop + duration;\n\t\t\t}\n\t\t\tif (raw === previous) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tthis.position = position;\n\t\tthis.rawPosition = raw;\n\t\tfor (let i = 0; i < this.tweens.length; i++) {\n\t\t\tthis.tweens[i].setPosition(position, jump);\n\t\t}\n\t\tif (callback) {\n\t\t\tcallback();\n\t\t}\n\t\tif (!skipActions) {\n\t\t\trunActions(this, this.duration, this.loop, previous, raw, jump, !jump && previous === -1);\n\t\t}\n\t}\n\n\t_runActionsRange(start: number, end: number, jump: boolean, includeStart: boolean): boolean {\n\t\tconst position = this.position;\n\t\tfor (let i = 0; i < this.tweens.length; i++) {\n\t\t\tthis.tweens[i]._runActions(start, end, jump, includeStart);\n\t\t\tif (position !== this.position) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\n\nexport interface IFilterCacheEntry {\n\tinstance: DisplayObject;\n\tstartFrame: number;\n\tendFrame: number;\n\tx: number;\n\ty: number;\n\tw: number;\n\th: number;\n}\n\nexport const INDEPENDENT = 'independent';\nexport const SINGLE_FRAME = 'single';\nexport const SYNCHED = 'synched';\n\n/**\n * createjs-compatible MovieClip. Plays its symbol's timeline from the shared\n * definition with createjs's rules: the two phases (tick: advance the\n * playhead; then resolve: write the tweens and settle the children), the\n * write rule (a tween writes only when its position changes), synched /\n * single children taking their frame from the parent's step, the reset of an\n * independent child when it comes back on the display list, and when frame\n * scripts run.\n */\nexport class MovieClip extends Container {\n\tstatic INDEPENDENT = INDEPENDENT;\n\tstatic SINGLE_FRAME = SINGLE_FRAME;\n\tstatic SYNCHED = SYNCHED;\n\n\tmode: string;\n\tstartPosition: number;\n\tloop: number;\n\tcurrentFrame = 0;\n\tpaused = false;\n\tactionsEnabled = true;\n\tautoReset = true;\n\tframerate: number | null = null;\n\ttimeline: Timeline;\n\t_synchOffset = 0;\n\t_rawPosition = -1;\n\t_t = 0;\n\t_framerate: number | null = null;\n\t/**\n\t * Display objects the timeline placed, with the resolve that last placed\n\t * them (_resolveCount at that time). One placed in an earlier resolve and\n\t * not in the current one is removed at its end (createjs marks every entry\n\t * 1 at the start of a resolve and placed ones 2: an earlier count is its 1)\n\t */\n\t_managed: { [id: number]: number } = {};\n\tprivate _resolveCount = 0;\n\t/**\n\t * While a resolve can still leave the display list as it is: the index of\n\t * the child the next placement has to be for that (createjs moves each placed\n\t * child to the bottom, so in a resolve that changes nothing they come from\n\t * the top of the placed block down), -1 once all have come. Null when the\n\t * placements are done as createjs does them.\n\t */\n\tprivate _expected: number | null = null;\n\t/** The length of the placed block at the start of the resolve (the children placed last time, at the bottom) */\n\tprivate _placedBlock = 0;\n\t/**\n\t * Instances to re-cache within frame ranges, read by the filter cache\n\t * handling (published code sets it in the symbol's constructor)\n\t */\n\tfilterCacheList?: IFilterCacheEntry[];\n\t/** The frame rate the content was published with (lib.properties.fps), set on the content's symbols */\n\tcontentFps: number | null = null;\n\tprivate readonly _boundResolve: () => void;\n\n\tconstructor(mode?: string | null, startPosition?: number | null, loop?: boolean | number | null, timeline?: Timeline, pixi?: IOwnedNode) {\n\t\tsuper(pixi);\n\t\tthis.mode = mode || INDEPENDENT;\n\t\tthis.startPosition = startPosition || 0;\n\t\tthis.loop = loop === true ? -1 : (loop || 0);\n\t\tthis.timeline = timeline || new Timeline(0, []);\n\t\tthis._boundResolve = () => this._resolveState();\n\t}\n\n\tget labels(): ILabelDef[] { return this.timeline.getLabels(); }\n\tget currentLabel(): string | null { return this.timeline.currentLabel; }\n\tget totalFrames(): number { return this.timeline.duration; }\n\tget duration(): number { return this.timeline.duration; }\n\n\tisVisible(): boolean {\n\t\treturn !!(this.visible && this.alpha > 0 && this.scaleX !== 0 && this.scaleY !== 0);\n\t}\n\n\tplay(): void { this.paused = false; }\n\tstop(): void { this.paused = true; }\n\n\tgotoAndPlay(positionOrLabel: string | number): void {\n\t\tthis.paused = false;\n\t\tthis._goto(positionOrLabel);\n\t}\n\n\tgotoAndStop(positionOrLabel: string | number): void {\n\t\tthis.paused = true;\n\t\tthis._goto(positionOrLabel);\n\t}\n\n\tadvance(time?: number | null): void {\n\t\tif (this.mode !== INDEPENDENT) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet framerate = this.framerate;\n\t\tfor (let o = this.parent; o && framerate === null; o = o.parent) {\n\t\t\tif (o instanceof MovieClip && o.mode === INDEPENDENT) {\n\t\t\t\tframerate = o._framerate;\n\t\t\t}\n\t\t}\n\t\tthis._framerate = framerate;\n\n\t\tif (!this.paused) {\n\t\t\t// As createjs: a missing time (undefined, not null) with a framerate gives NaN, i.e. no advance\n\t\t\tconst frames = framerate !== null && framerate !== -1 && time !== null ? Number(time) / (1000 / framerate) + this._t : 1;\n\t\t\tlet count = frames | 0;\n\t\t\tthis._t = frames - count;\n\t\t\twhile (count--) {\n\t\t\t\tthis._updateTimeline(this._rawPosition + 1, false);\n\t\t\t}\n\t\t}\n\t}\n\n\t/** createjs tick phase: advance the playhead, then the children (reverse), then tick listeners */\n\t_tick(event: Event): void {\n\t\tthis.advance(event ? event.delta : undefined);\n\t\tsuper._tick(event);\n\t}\n\n\t/** createjs resolve phase (MovieClip draw / Stage update) */\n\t_updateState(): void {\n\t\tif (this._rawPosition === -1 || this.mode !== INDEPENDENT) {\n\t\t\tthis._updateTimeline(-1, false);\n\t\t}\n\t}\n\n\t_goto(positionOrLabel: string | number): void {\n\t\tconst position = this.timeline.resolve(positionOrLabel);\n\t\tif (position != null) {\n\t\t\tthis._t = 0;\n\t\t\tthis._updateTimeline(position, true);\n\t\t\t// The clips it placed (synched ones, ones to start over) are settled by createjs when it\n\t\t\t// draws: the root is to be settled before Pixi draws it, if no frame is played before\n\t\t\tlet root: DisplayObject = this;\n\t\t\twhile (root.parent) {\n\t\t\t\troot = root.parent;\n\t\t\t}\n\t\t\troot._pendingResolve = true;\n\t\t}\n\t}\n\n\t_reset(): void {\n\t\tthis._rawPosition = -1;\n\t\tthis._t = this.currentFrame = 0;\n\t\tthis.paused = false;\n\t}\n\n\t_updateTimeline(rawPosition: number, jump: boolean): void {\n\t\tconst synched = this.mode !== INDEPENDENT;\n\t\tconst timeline = this.timeline;\n\t\tlet position = rawPosition;\n\t\tif (synched) {\n\t\t\tposition = this.startPosition + (this.mode === SINGLE_FRAME ? 0 : this._synchOffset);\n\t\t}\n\t\tif (position < 0) {\n\t\t\tposition = 0;\n\t\t}\n\t\tif (this._rawPosition !== position || synched) {\n\t\t\tthis._rawPosition = position;\n\t\t\ttimeline.loop = this.loop;\n\t\t\ttimeline.setPosition(position, synched || !this.actionsEnabled, jump, this._boundResolve);\n\t\t}\n\t}\n\n\t_renderFirstFrame(): void {\n\t\tconst timeline = this.timeline;\n\t\tconst raw = timeline.rawPosition;\n\t\ttimeline.setPosition(0, true, true, this._boundResolve);\n\t\ttimeline.rawPosition = raw;\n\t}\n\n\t/**\n\t * MovieClip._resolveState: places every tween target (and state entry) at\n\t * the bottom of the display list in turn, then removes the children placed\n\t * before and not now. The placements are skipped while they would leave the\n\t * display list as it is (_addManagedChild); otherwise everything is done as\n\t * createjs does it.\n\t */\n\t_resolveState(): void {\n\t\tconst timeline = this.timeline;\n\t\tthis.currentFrame = timeline.position;\n\n\t\tconst current = ++this._resolveCount;\n\t\tconst managed = this._managed;\n\t\tconst children = this.children;\n\n\t\t// The children the timeline placed, from the bottom (a resolve leaves them there): a placement\n\t\t// can be skipped only for one of them (it was placed before, so it would not be reset). What\n\t\t// is above the block does not matter: createjs's placements put the placed ones below it\n\t\tlet block = 0;\n\t\twhile (block < children.length && managed[children[block].id] !== undefined) {\n\t\t\tblock++;\n\t\t}\n\t\tthis._placedBlock = block;\n\t\tthis._expected = block - 1;\n\n\t\tconst tweens = timeline.tweens;\n\t\tfor (let i = 0; i < tweens.length; i++) {\n\t\t\tconst tween = tweens[i];\n\t\t\tconst target = tween.target;\n\t\t\tif (target !== this && !tween.passive) {\n\t\t\t\tconst offset = tween._stepPosition;\n\t\t\t\tif (target instanceof DisplayObject) {\n\t\t\t\t\tthis._addManagedChild(target, offset);\n\t\t\t\t} else {\n\t\t\t\t\tthis._setState(Reflect.get(target, 'state'), tween.scope, offset);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Children of the block not placed now: put the placed ones in front of them as createjs has them\n\t\tthis._followCreatejs();\n\n\t\tfor (let i = children.length - 1; i >= 0; i--) {\n\t\t\tconst id = children[i].id;\n\t\t\tconst placed = managed[id];\n\t\t\t// Earlier than this resolve (a resolve nested in this one, from an event, counts as now)\n\t\t\tif (placed !== undefined && placed < current) {\n\t\t\t\tthis.removeChildAt(i);\n\t\t\t\tdelete managed[id];\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Stops skipping placements: the children placed so far (the top of the\n\t * block, from the expected index up) are moved to the bottom as createjs's\n\t * placements would have left them, with no events (moves within the same\n\t * parent are silent in createjs).\n\t */\n\t_followCreatejs(): void {\n\t\tconst expected = this._expected;\n\t\tthis._expected = null;\n\t\tif (expected === null || expected < 0) {\n\t\t\treturn;\n\t\t}\n\t\tconst children = this.children;\n\t\tconst placed = children.splice(expected + 1, this._placedBlock - expected - 1);\n\t\tfor (let i = placed.length - 1; i >= 0; i--) {\n\t\t\tchildren.unshift(placed[i]);\n\t\t}\n\t\tplaced.forEach((child, index) => {\n\t\t\tthis.pixi.setChildIndex(child.pixi, index);\n\t\t});\n\t}\n\n\t_setState(state: IStateEntryDef[] | object | string | number | boolean | null | undefined, scope: ITweenScope, offset: number): void {\n\t\tif (!Array.isArray(state)) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = state.length - 1; i >= 0; i--) {\n\t\t\tconst entry: IStateEntryDef = state[i];\n\t\t\tconst target = scope.stateTarget(entry);\n\t\t\tif (!target) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst props = entry.props;\n\t\t\tif (props) {\n\t\t\t\tObject.keys(props).forEach(key => {\n\t\t\t\t\tReflect.set(target, key, scope.value(props[key]));\n\t\t\t\t});\n\t\t\t}\n\t\t\tthis._addManagedChild(target, offset);\n\t\t}\n\t}\n\n\t_addManagedChild(child: DisplayObject, offset: number): void {\n\t\tif (child._off) {\n\t\t\treturn;\n\t\t}\n\t\tconst expected = this._expected;\n\t\tif (expected !== null) {\n\t\t\t// Moving it to the bottom would put it where it is: the next child of the block down, or\n\t\t\t// the child placed last (placed twice in this resolve: createjs has it at the bottom already).\n\t\t\t// Only what the placement records is done (it was placed before, so no reset)\n\t\t\tconst next = expected >= 0 && this.children[expected] === child;\n\t\t\tif (next || (expected + 1 < this._placedBlock && this.children[expected + 1] === child)) {\n\t\t\t\tif (next) {\n\t\t\t\t\tthis._expected = expected - 1;\n\t\t\t\t}\n\t\t\t\tif (child instanceof MovieClip) {\n\t\t\t\t\tchild._synchOffset = offset;\n\t\t\t\t}\n\t\t\t\tthis._managed[child.id] = this._resolveCount;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis._followCreatejs();\n\t\t}\n\t\tthis.addChildAt(child, 0);\n\t\tif (child instanceof MovieClip) {\n\t\t\tchild._synchOffset = offset;\n\t\t\tif (child.mode === INDEPENDENT && child.autoReset && !this._managed[child.id]) {\n\t\t\t\tchild._reset();\n\t\t\t}\n\t\t}\n\t\tthis._managed[child.id] = this._resolveCount;\n\t}\n\n\ttoString(): string {\n\t\treturn '[MovieClip (name=' + this.name + ')]';\n\t}\n}\n","import * as PIXI from 'pixi.js';\nimport { DisplayObject, Container, IOwnedNode, NO_HIT_AREA } from './display';\nimport { Event } from './events';\nimport { Rectangle } from './geom';\nimport type { IGraphicsCommandDef, IDataMap, TDataValue } from './data';\n\n/** Changes a geometry's reference count (Pixi 5 counts the Graphics showing it, and disposes of it at 0) */\nfunction addReference(geometry: PIXI.GraphicsGeometry, delta: number): void {\n\tconst count: number = Reflect.get(geometry, 'refCount');\n\tReflect.set(geometry, 'refCount', count + delta);\n}\n\nexport class PixiGraphics extends PIXI.Graphics implements IOwnedNode {\n\towner: DisplayObject | null = null;\n\n\t/**\n\t * Shows another (shared) geometry. Pixi 5 can share a geometry between\n\t * Graphics (new Graphics(geometry), as clone() does) but has no way to\n\t * change it afterwards, and does not declare the field that holds it; it is\n\t * set by name here, and what Pixi derives from the geometry (the batches,\n\t * their vertices and tint) is marked stale so it is built again.\n\t */\n\tsetGeometry(geometry: PIXI.GraphicsGeometry): void {\n\t\tconst current = this.geometry;\n\t\tif (current === geometry) {\n\t\t\treturn;\n\t\t}\n\t\t// The reference count (undeclared as well) keeps a shared geometry alive while shown\n\t\taddReference(current, -1);\n\t\taddReference(geometry, 1);\n\t\tReflect.set(this, '_geometry', geometry);\n\t\tReflect.set(this, '_transformID', -1);\n\t\tthis.batchDirty = -1;\n\t\tthis.batchTint = -1;\n\t}\n\n\t/**\n\t * Pixi 5's Graphics keeps the blend mode in the batches it builds, and\n\t * builds them again only when the geometry changes: a blend mode set later\n\t * would not be drawn. The batches are marked stale so they are built again.\n\t */\n\tsetBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tif (this.blendMode !== mode) {\n\t\t\tthis.blendMode = mode;\n\t\t\tthis.batchDirty = -1;\n\t\t}\n\t}\n}\n\nexport class PixiSprite extends PIXI.Sprite implements IOwnedNode {\n\towner: DisplayObject | null = null;\n}\n\nexport class PixiText extends PIXI.Text implements IOwnedNode {\n\towner: DisplayObject | null = null;\n}\n\n/**\n * Where a content's images come from: manifest images by id, and frames of\n * its sprite sheets (the images published code draws from a frame for a\n * bitmap fill).\n */\nexport interface ITextureSource {\n\timage(id: string): PIXI.Texture | null;\n\tframe(sheet: string, index: number): PIXI.Texture | null;\n\timageAsset(id: string): IImageAsset | null;\n\tframeAsset(sheet: string, index: number): IImageAsset | null;\n}\n\nconst NAMED_COLORS: { [name: string]: number } = {\n\tblack: 0x000000, white: 0xffffff, red: 0xff0000, green: 0x008000, blue: 0x0000ff,\n\tyellow: 0xffff00, cyan: 0x00ffff, magenta: 0xff00ff, gray: 0x808080, grey: 0x808080\n};\n\ninterface IColor {\n\tcolor: number;\n\talpha: number;\n}\n\n/**\n * A CSS color as createjs writes it (#RGB, #RRGGBB, rgb(), rgba(), a few names).\n */\nexport function parseColor(value: TDataValue | undefined): IColor | null {\n\tif (typeof value !== 'string') {\n\t\treturn null;\n\t}\n\n\tconst text = value.trim().toLowerCase();\n\tif (text.charAt(0) === '#') {\n\t\tlet hex = text.slice(1);\n\t\tif (hex.length === 3) {\n\t\t\thex = hex.charAt(0) + hex.charAt(0) + hex.charAt(1) + hex.charAt(1) + hex.charAt(2) + hex.charAt(2);\n\t\t}\n\t\tconst color = parseInt(hex.slice(0, 6), 16);\n\t\treturn isNaN(color) ? null : { color, alpha: 1 };\n\t}\n\n\tconst match = /^rgba?\\(([^)]*)\\)$/.exec(text);\n\tif (match) {\n\t\tconst parts = match[1].split(',').map(part => parseFloat(part));\n\t\tconst alpha = parts.length > 3 ? parts[3] : 1;\n\t\treturn { color: ((parts[0] & 255) << 16) | ((parts[1] & 255) << 8) | (parts[2] & 255), alpha };\n\t}\n\n\tconst named = NAMED_COLORS[text];\n\treturn named === undefined ? null : { color: named, alpha: 1 };\n}\n\nfunction num(props: IDataMap, key: string): number {\n\tconst value = props[key];\n\treturn typeof value === 'number' ? value : 0;\n}\n\nfunction isDataMap(value: TDataValue | undefined): value is IDataMap {\n\treturn value !== null && typeof value === 'object' && !Array.isArray(value);\n}\n\nconst LINE_CAPS = [PIXI.LINE_CAP.BUTT, PIXI.LINE_CAP.ROUND, PIXI.LINE_CAP.SQUARE];\nconst LINE_JOINS = [PIXI.LINE_JOIN.MITER, PIXI.LINE_JOIN.ROUND, PIXI.LINE_JOIN.BEVEL];\n\nfunction lineCap(value: TDataValue | undefined): PIXI.LINE_CAP {\n\tif (typeof value === 'number') {\n\t\treturn LINE_CAPS[value] || PIXI.LINE_CAP.BUTT;\n\t}\n\treturn value === 'round' ? PIXI.LINE_CAP.ROUND : value === 'square' ? PIXI.LINE_CAP.SQUARE : PIXI.LINE_CAP.BUTT;\n}\n\nfunction lineJoin(value: TDataValue | undefined): PIXI.LINE_JOIN {\n\tif (typeof value === 'number') {\n\t\treturn LINE_JOINS[value] || PIXI.LINE_JOIN.MITER;\n\t}\n\treturn value === 'round' ? PIXI.LINE_JOIN.ROUND : value === 'bevel' ? PIXI.LINE_JOIN.BEVEL : PIXI.LINE_JOIN.MITER;\n}\n\nconst PATH_COMMANDS = ['MoveTo', 'LineTo', 'QuadraticCurveTo', 'BezierCurveTo', 'ArcTo', 'Arc', 'ClosePath', 'Rect', 'RoundRect', 'Circle', 'Ellipse', 'PolyStar'];\n\n/**\n * A fill or stroke style as Pixi takes it.\n */\ninterface IPaint {\n\tcolor: number;\n\talpha: number;\n\ttexture: PIXI.Texture | null;\n\tmatrix: PIXI.Matrix | null;\n}\n\nfunction paintOf(style: TDataValue | undefined, matrix: TDataValue | undefined, textures: ITextureSource): IPaint | null {\n\tconst solid = parseColor(style);\n\tif (solid) {\n\t\treturn { color: solid.color, alpha: solid.alpha, texture: null, matrix: null };\n\t}\n\n\tif (!isDataMap(style)) {\n\t\treturn null;\n\t}\n\n\tif (style.type === 'bitmap') {\n\t\tconst image = style.image;\n\t\tlet texture: PIXI.Texture | null = null;\n\t\tif (isDataMap(image)) {\n\t\t\tif (typeof image.image === 'string') {\n\t\t\t\ttexture = textures.image(image.image);\n\t\t\t} else if (typeof image.sheet === 'string' && typeof image.frame === 'number') {\n\t\t\t\ttexture = textures.frame(image.sheet, image.frame);\n\t\t\t}\n\t\t}\n\t\tconst m = isDataMap(matrix) ? new PIXI.Matrix(num(matrix, 'a'), num(matrix, 'b'), num(matrix, 'c'), num(matrix, 'd'), num(matrix, 'tx'), num(matrix, 'ty')) : null;\n\t\treturn texture ? { color: 0xffffff, alpha: 1, texture, matrix: m } : null;\n\t}\n\n\tconst gradient = gradientOf(style);\n\tif (!gradient) {\n\t\treturn null;\n\t}\n\tconst texture = gradientTexture(gradient);\n\t// A gradient canvas paints nothing with (a line of length 0, a circle of radius 0): nothing is drawn\n\treturn texture ? { color: 0xffffff, alpha: 1, texture, matrix: texture.toShape } : { color: 0, alpha: 0, texture: null, matrix: null };\n}\n\n/**\n * A linear or radial gradient as createjs makes it (the props of a Fill or\n * Stroke style made by beginLinearGradientFill and the like): colors at\n * ratios along the line from (x0, y0) to (x1, y1), or between the circles\n * (x0, y0, r0) and (x1, y1, r1), in the shape's coordinates.\n */\nexport interface IGradient {\n\ttype: 'linear' | 'radial';\n\tcolors: string[];\n\tratios: number[];\n\tx0: number;\n\ty0: number;\n\tr0: number;\n\tx1: number;\n\ty1: number;\n\tr1: number;\n}\n\nfunction gradientOf(style: IDataMap): IGradient | null {\n\tconst type = style.type;\n\tconst colors = style.colors;\n\tconst ratios = style.ratios;\n\tif ((type !== 'linear' && type !== 'radial') || !Array.isArray(colors) || !Array.isArray(ratios)) {\n\t\treturn null;\n\t}\n\treturn {\n\t\ttype,\n\t\tcolors: colors.map(color => String(color)),\n\t\tratios: ratios.map(ratio => Number(ratio)),\n\t\tx0: num(style, 'x0'), y0: num(style, 'y0'), r0: type === 'radial' ? num(style, 'r0') : 0,\n\t\tx1: num(style, 'x1'), y1: num(style, 'y1'), r1: type === 'radial' ? num(style, 'r1') : 0\n\t};\n}\n\n/** Pixels a gradient is drawn across: along the line of a linear one, across the circles of a radial one */\nconst GRADIENT_SIZE = 256;\n\n/**\n * A gradient drawn into a canvas by the browser's own gradient (so its\n * colors are what canvas, and createjs, paints), as a texture that Pixi's\n * Graphics fills and strokes with through a matrix. `gradient` is the\n * gradient in the shape's coordinates, `local` the same gradient in the\n * texture's pixels, and `toShape` takes texture pixels to the shape's\n * coordinates. Outside the drawn area the texture's edge pixels repeat\n * (Pixi clamps), which is how canvas pads a gradient with its end colors.\n */\nexport class GradientTexture extends PIXI.Texture {\n\treadonly gradient: IGradient;\n\treadonly local: IGradient;\n\treadonly toShape: PIXI.Matrix;\n\n\tconstructor(canvas: HTMLCanvasElement, gradient: IGradient, local: IGradient, toShape: PIXI.Matrix) {\n\t\tsuper(PIXI.BaseTexture.from(canvas));\n\t\tthis.gradient = gradient;\n\t\tthis.local = local;\n\t\tthis.toShape = toShape;\n\t}\n}\n\n/** Gradient textures by their gradient, shared by every drawing that uses the same gradient */\nconst gradientTextures = new Map<string, GradientTexture | null>();\n\nfunction gradientTexture(gradient: IGradient): GradientTexture | null {\n\tconst key = JSON.stringify(gradient);\n\tconst known = gradientTextures.get(key);\n\tif (known !== undefined) {\n\t\treturn known;\n\t}\n\tconst texture = gradient.type === 'linear' ? linearGradientTexture(gradient) : radialGradientTexture(gradient);\n\tgradientTextures.set(key, texture);\n\treturn texture;\n}\n\nfunction paintGradient(canvas: HTMLCanvasElement, local: IGradient): void {\n\tconst context = canvas.getContext('2d');\n\tif (!context) {\n\t\treturn;\n\t}\n\tconst paint = local.type === 'linear'\n\t\t? context.createLinearGradient(local.x0, local.y0, local.x1, local.y1)\n\t\t: context.createRadialGradient(local.x0, local.y0, local.r0, local.x1, local.y1, local.r1);\n\tlocal.colors.forEach((color, i) => {\n\t\tpaint.addColorStop(local.ratios[i], color);\n\t});\n\tcontext.fillStyle = paint;\n\tcontext.fillRect(0, 0, canvas.width, canvas.height);\n}\n\n/**\n * A linear gradient drawn from the left edge to the right edge of a canvas\n * one pixel high. The texture's x axis runs along the gradient's line and its\n * y axis across it (every row is the same, so how far across does not matter).\n */\nfunction linearGradientTexture(gradient: IGradient): GradientTexture | null {\n\tconst dx = gradient.x1 - gradient.x0;\n\tconst dy = gradient.y1 - gradient.y0;\n\tconst length = Math.sqrt(dx * dx + dy * dy);\n\tif (!length) {\n\t\treturn null;\n\t}\n\tconst canvas = document.createElement('canvas');\n\tcanvas.width = GRADIENT_SIZE;\n\tcanvas.height = 1;\n\tconst local: IGradient = {\n\t\ttype: 'linear', colors: gradient.colors, ratios: gradient.ratios,\n\t\tx0: 0, y0: 0, r0: 0, x1: GRADIENT_SIZE, y1: 0, r1: 0\n\t};\n\tpaintGradient(canvas, local);\n\tconst toShape = new PIXI.Matrix(dx / GRADIENT_SIZE, dy / GRADIENT_SIZE, -dy / length, dx / length, gradient.x0, gradient.y0);\n\treturn new GradientTexture(canvas, gradient, local, toShape);\n}\n\n/**\n * A radial gradient drawn into a square canvas covering both of its circles,\n * scaled to fit (the mapping is a scale and a move, so the circles stay\n * circles and every point keeps its place in the gradient).\n */\nfunction radialGradientTexture(gradient: IGradient): GradientTexture | null {\n\tconst left = Math.min(gradient.x0 - gradient.r0, gradient.x1 - gradient.r1);\n\tconst top = Math.min(gradient.y0 - gradient.r0, gradient.y1 - gradient.r1);\n\tconst right = Math.max(gradient.x0 + gradient.r0, gradient.x1 + gradient.r1);\n\tconst bottom = Math.max(gradient.y0 + gradient.r0, gradient.y1 + gradient.r1);\n\tconst size = Math.max(right - left, bottom - top);\n\tif (!(size > 0) || gradient.r1 === gradient.r0 && gradient.x0 === gradient.x1 && gradient.y0 === gradient.y1) {\n\t\treturn null;\n\t}\n\tconst scale = GRADIENT_SIZE / size;\n\tconst canvas = document.createElement('canvas');\n\tcanvas.width = GRADIENT_SIZE;\n\tcanvas.height = GRADIENT_SIZE;\n\tconst local: IGradient = {\n\t\ttype: 'radial', colors: gradient.colors, ratios: gradient.ratios,\n\t\tx0: (gradient.x0 - left) * scale, y0: (gradient.y0 - top) * scale, r0: gradient.r0 * scale,\n\t\tx1: (gradient.x1 - left) * scale, y1: (gradient.y1 - top) * scale, r1: gradient.r1 * scale\n\t};\n\tpaintGradient(canvas, local);\n\tconst toShape = new PIXI.Matrix(1 / scale, 0, 0, 1 / scale, left, top);\n\treturn new GradientTexture(canvas, gradient, local, toShape);\n}\n\nfunction drawPath(target: PIXI.Graphics, command: IGraphicsCommandDef): void {\n\tconst p = command.props;\n\tswitch (command.type) {\n\t\tcase 'MoveTo':\n\t\t\ttarget.moveTo(num(p, 'x'), num(p, 'y'));\n\t\t\tbreak;\n\t\tcase 'LineTo':\n\t\t\ttarget.lineTo(num(p, 'x'), num(p, 'y'));\n\t\t\tbreak;\n\t\tcase 'QuadraticCurveTo':\n\t\t\ttarget.quadraticCurveTo(num(p, 'cpx'), num(p, 'cpy'), num(p, 'x'), num(p, 'y'));\n\t\t\tbreak;\n\t\tcase 'BezierCurveTo':\n\t\t\ttarget.bezierCurveTo(num(p, 'cp1x'), num(p, 'cp1y'), num(p, 'cp2x'), num(p, 'cp2y'), num(p, 'x'), num(p, 'y'));\n\t\t\tbreak;\n\t\tcase 'ArcTo':\n\t\t\ttarget.arcTo(num(p, 'x1'), num(p, 'y1'), num(p, 'x2'), num(p, 'y2'), num(p, 'radius'));\n\t\t\tbreak;\n\t\tcase 'Arc':\n\t\t\ttarget.arc(num(p, 'x'), num(p, 'y'), num(p, 'radius'), num(p, 'startAngle'), num(p, 'endAngle'), !!p.anticlockwise);\n\t\t\tbreak;\n\t\tcase 'ClosePath':\n\t\t\ttarget.closePath();\n\t\t\tbreak;\n\t\tcase 'Rect':\n\t\t\ttarget.drawRect(num(p, 'x'), num(p, 'y'), num(p, 'w'), num(p, 'h'));\n\t\t\tbreak;\n\t\tcase 'RoundRect':\n\t\t\ttarget.drawRoundedRect(num(p, 'x'), num(p, 'y'), num(p, 'w'), num(p, 'h'), num(p, 'radiusTL'));\n\t\t\tbreak;\n\t\tcase 'Circle':\n\t\t\ttarget.drawCircle(num(p, 'x'), num(p, 'y'), num(p, 'radius'));\n\t\t\tbreak;\n\t\tcase 'Ellipse': {\n\t\t\tconst w = num(p, 'w');\n\t\t\tconst h = num(p, 'h');\n\t\t\ttarget.drawEllipse(num(p, 'x') + w / 2, num(p, 'y') + h / 2, w / 2, h / 2);\n\t\t\tbreak;\n\t\t}\n\t\tcase 'PolyStar': {\n\t\t\tconst sides = num(p, 'sides');\n\t\t\tconst pointSize = num(p, 'pointSize');\n\t\t\tconst radius = num(p, 'radius');\n\t\t\tconst rotation = num(p, 'angle') / 180 * Math.PI;\n\t\t\tif (pointSize > 0 && pointSize < 1) {\n\t\t\t\ttarget.drawStar(num(p, 'x'), num(p, 'y'), sides, radius, radius * (1 - pointSize), rotation);\n\t\t\t} else {\n\t\t\t\ttarget.drawRegularPolygon(num(p, 'x'), num(p, 'y'), radius, sides, rotation);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/**\n * A path and the paint that follows it. createjs keeps drawing commands the\n * way canvas draws: a path (BeginPath, then path commands), then the Fill\n * and/or Stroke that paint it.\n */\ninterface IPathSegment {\n\tpath: IGraphicsCommandDef[];\n\tfill: IGraphicsCommandDef | null;\n\tstroke: IGraphicsCommandDef | null;\n\tstrokeStyle: IDataMap | null;\n}\n\nfunction pathSegments(commands: IGraphicsCommandDef[]): IPathSegment[] {\n\tconst segments: IPathSegment[] = [];\n\tlet path: IGraphicsCommandDef[] = [];\n\tlet fill: IGraphicsCommandDef | null = null;\n\tlet stroke: IGraphicsCommandDef | null = null;\n\tlet strokeStyle: IDataMap | null = null;\n\tlet painted = false;\n\n\tconst push = (): void => {\n\t\tif (path.length && (fill || stroke)) {\n\t\t\tsegments.push({ path, fill, stroke, strokeStyle });\n\t\t}\n\t};\n\n\tcommands.forEach(command => {\n\t\tif (command.type === 'BeginPath') {\n\t\t\tif (painted) {\n\t\t\t\tpush();\n\t\t\t\tpath = [];\n\t\t\t\tfill = stroke = null;\n\t\t\t\tpainted = false;\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tif (PATH_COMMANDS.indexOf(command.type) >= 0) {\n\t\t\tif (painted) {\n\t\t\t\t// A path after paint without BeginPath continues the same path in canvas: what is painted so far is drawn, and the path goes on\n\t\t\t\tpush();\n\t\t\t\tpath = path.slice();\n\t\t\t\tfill = stroke = null;\n\t\t\t\tpainted = false;\n\t\t\t}\n\t\t\tpath.push(command);\n\t\t\treturn;\n\t\t}\n\t\tif (command.type === 'Fill') {\n\t\t\tfill = command;\n\t\t\tpainted = true;\n\t\t} else if (command.type === 'Stroke') {\n\t\t\tstroke = command;\n\t\t\tpainted = true;\n\t\t} else if (command.type === 'StrokeStyle') {\n\t\t\tstrokeStyle = command.props;\n\t\t}\n\t});\n\n\tpush();\n\treturn segments;\n}\n\n/** A Pixi Graphics that draws a geometry once (for working out holes, and for the shared geometries) */\nclass GeometryBuilder extends PIXI.Graphics {\n\tfinish(): void {\n\t\tthis.finishPoly();\n\t}\n}\n\nlet emptyGraphics: PIXI.Graphics | null = null;\n\n/** The geometry of a shape with no drawing, shared (kept by a Graphics that is never destroyed) */\nfunction getEmptyGeometry(): PIXI.GraphicsGeometry {\n\tif (!emptyGraphics) {\n\t\temptyGraphics = new PIXI.Graphics();\n\t}\n\treturn emptyGraphics.geometry;\n}\n\n/**\n * The subpaths of a filled path that cut holes: a subpath that starts inside\n * what the path's earlier subpaths cover (holes taken out) is a hole in it;\n * one that starts outside, or inside a hole, is a shape of its own. The\n * MoveTo commands that start holes are returned.\n */\nfunction findHoles(path: IGraphicsCommandDef[]): IGraphicsCommandDef[] {\n\tconst holes: IGraphicsCommandDef[] = [];\n\tconst probe = new GeometryBuilder();\n\tprobe.beginFill(0);\n\tlet first = true;\n\tlet inHole = false;\n\n\tpath.forEach(command => {\n\t\tif (command.type === 'MoveTo') {\n\t\t\tif (!first) {\n\t\t\t\tprobe.finish();\n\t\t\t\tconst inside = probe.geometry.containsPoint(new PIXI.Point(num(command.props, 'x'), num(command.props, 'y')));\n\t\t\t\tif (inside) {\n\t\t\t\t\tholes.push(command);\n\t\t\t\t\tif (!inHole) {\n\t\t\t\t\t\tprobe.beginHole();\n\t\t\t\t\t\tinHole = true;\n\t\t\t\t\t}\n\t\t\t\t} else if (inHole) {\n\t\t\t\t\tprobe.endHole();\n\t\t\t\t\tinHole = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfirst = false;\n\t\t}\n\t\tdrawPath(probe, command);\n\t});\n\n\tprobe.destroy();\n\treturn holes;\n}\n\n/** Replays a path, cutting the holes (Pixi attaches a hole to the shape drawn before it) */\nfunction drawPathWithHoles(target: PIXI.Graphics, path: IGraphicsCommandDef[], holes: IGraphicsCommandDef[] | null): void {\n\tlet inHole = false;\n\tpath.forEach(command => {\n\t\tif (holes && command.type === 'MoveTo') {\n\t\t\tconst hole = holes.indexOf(command) >= 0;\n\t\t\tif (hole && !inHole) {\n\t\t\t\ttarget.beginHole();\n\t\t\t\tinHole = true;\n\t\t\t} else if (!hole && inHole) {\n\t\t\t\ttarget.endHole();\n\t\t\t\tinHole = false;\n\t\t\t}\n\t\t}\n\t\tdrawPath(target, command);\n\t});\n\tif (inHole) {\n\t\ttarget.endHole();\n\t}\n}\n\n/**\n * Draws createjs drawing commands into a Pixi Graphics. Pixi takes the paint\n * first, so each path is replayed under the paint that follows it, with the\n * holes canvas's nonzero fill would cut (holes: the MoveTo commands that\n * start holes, see Graphics.holes).\n */\nexport function drawCommands(target: PIXI.Graphics, commands: IGraphicsCommandDef[], textures: ITextureSource, holes?: IGraphicsCommandDef[] | null): void {\n\ttarget.clear();\n\n\tpathSegments(commands).forEach(segment => {\n\t\tconst fill = segment.fill ? paintOf(segment.fill.props.style, segment.fill.props.matrix, textures) : null;\n\t\tconst stroke = segment.stroke ? paintOf(segment.stroke.props.style, null, textures) : null;\n\t\tconst strokeStyle = segment.strokeStyle;\n\t\tif (!fill && !stroke) {\n\t\t\treturn;\n\t\t}\n\t\tif (stroke && strokeStyle) {\n\t\t\ttarget.lineTextureStyle({\n\t\t\t\twidth: num(strokeStyle, 'width'),\n\t\t\t\tcolor: stroke.color,\n\t\t\t\talpha: stroke.alpha,\n\t\t\t\ttexture: stroke.texture || PIXI.Texture.WHITE,\n\t\t\t\tmatrix: stroke.matrix || undefined,\n\t\t\t\tcap: lineCap(strokeStyle.caps),\n\t\t\t\tjoin: lineJoin(strokeStyle.joints),\n\t\t\t\tmiterLimit: typeof strokeStyle.miterLimit === 'number' ? strokeStyle.miterLimit : 10\n\t\t\t});\n\t\t} else {\n\t\t\ttarget.lineStyle(0);\n\t\t}\n\t\tif (fill) {\n\t\t\ttarget.beginTextureFill({ texture: fill.texture || PIXI.Texture.WHITE, color: fill.color, alpha: fill.alpha, matrix: fill.matrix || undefined });\n\t\t}\n\t\tdrawPathWithHoles(target, segment.path, fill ? holes || null : null);\n\t\tif (fill) {\n\t\t\ttarget.endFill();\n\t\t}\n\t});\n}\n\n/**\n * A drawing command as createjs keeps it (Graphics.MoveTo, Graphics.Fill, ...):\n * the command's own properties, with fill and stroke styles as objects whose\n * `props` are the arguments they were made with.\n */\nexport class GraphicsCommand {\n}\n\n/** The createjs drawing command class names */\nexport const GRAPHICS_COMMANDS = [\n\t'MoveTo', 'LineTo', 'ArcTo', 'Arc', 'QuadraticCurveTo', 'BezierCurveTo', 'Rect', 'ClosePath', 'BeginPath',\n\t'Fill', 'Stroke', 'StrokeStyle', 'StrokeDash', 'RoundRect', 'Circle', 'Ellipse', 'PolyStar'\n];\n\nconst COMMAND_CLASSES: { [type: string]: typeof GraphicsCommand } = {};\nGRAPHICS_COMMANDS.forEach(type => {\n\tCOMMAND_CLASSES[type] = class extends GraphicsCommand {};\n});\n\nconst MATRIX_KEYS = ['a', 'b', 'c', 'd', 'tx', 'ty'];\n\n/** A recorded command value as createjs holds it (images as image assets) */\ntype TCommandValue = string | number | boolean | null | IImageAsset | TCommandValue[] | ICommandValueMap;\n\ninterface ICommandValueMap {\n\t[key: string]: TCommandValue;\n}\n\nfunction toCommandValue(value: TDataValue, assets: ITextureSource): TCommandValue {\n\tif (Array.isArray(value)) {\n\t\treturn value.map(v => toCommandValue(v, assets));\n\t}\n\tif (!isDataMap(value)) {\n\t\treturn value;\n\t}\n\tconst keys = Object.keys(value);\n\tif (keys.length === 1 && typeof value.image === 'string') {\n\t\treturn assets.imageAsset(value.image);\n\t}\n\tif (keys.length === 2 && typeof value.sheet === 'string' && typeof value.frame === 'number') {\n\t\treturn assets.frameAsset(value.sheet, value.frame);\n\t}\n\tconst map: ICommandValueMap = {};\n\tif (keys.length === 6 && MATRIX_KEYS.every(key => typeof value[key] === 'number')) {\n\t\tMATRIX_KEYS.forEach(key => { map[key] = value[key]; });\n\t\treturn map;\n\t}\n\tkeys.forEach(key => { map[key] = toCommandValue(value[key], assets); });\n\treturn map;\n}\n\n/**\n * Draws the path of createjs drawing commands filled, ignoring their fills\n * and strokes: the shape a createjs mask clips with (all the drawing as one\n * path, with the holes named by holes, see Graphics.maskHoles).\n */\nexport function drawMaskPath(target: PIXI.Graphics, commands: IGraphicsCommandDef[], holes?: IGraphicsCommandDef[] | null): void {\n\ttarget.clear();\n\tconst path = commands.filter(command => PATH_COMMANDS.indexOf(command.type) >= 0);\n\tif (!path.length) {\n\t\treturn;\n\t}\n\ttarget.beginFill(0xffffff, 1);\n\tdrawPathWithHoles(target, path, holes || null);\n\ttarget.endFill();\n}\n\n/**\n * createjs-compatible Graphics holding the drawing commands of a definition.\n */\nexport class Graphics {\n\treadonly commands: IGraphicsCommandDef[];\n\treadonly textures: ITextureSource;\n\tprivate _instructions: GraphicsCommand[] | null = null;\n\tprivate _holes: IGraphicsCommandDef[] | null = null;\n\tprivate _maskHoles: IGraphicsCommandDef[] | null = null;\n\tprivate _geometry: GeometryBuilder | null = null;\n\tprivate _maskGeometry: GeometryBuilder | null = null;\n\n\tconstructor(commands: IGraphicsCommandDef[], textures: ITextureSource) {\n\t\tthis.commands = commands;\n\t\tthis.textures = textures;\n\t}\n\n\t/** The commands as createjs's command objects (made when first read) */\n\tget instructions(): GraphicsCommand[] {\n\t\tif (!this._instructions) {\n\t\t\tconst assets = this.textures;\n\t\t\tthis._instructions = this.commands.map(command => {\n\t\t\t\tconst CommandClass = COMMAND_CLASSES[command.type] || GraphicsCommand;\n\t\t\t\tconst instruction = new CommandClass();\n\t\t\t\tObject.keys(command.props).forEach(key => {\n\t\t\t\t\tconst value = toCommandValue(command.props[key], assets);\n\t\t\t\t\t// A gradient or bitmap style object carries its arguments as props\n\t\t\t\t\tReflect.set(instruction, key, key === 'style' && value !== null && typeof value === 'object' ? { props: value } : value);\n\t\t\t\t});\n\t\t\t\treturn instruction;\n\t\t\t});\n\t\t}\n\t\treturn this._instructions;\n\t}\n\n\tisEmpty(): boolean {\n\t\treturn !this.commands.length;\n\t}\n\n\t/**\n\t * The MoveTo commands that start holes in the filled paths (worked out once\n\t * per drawing and shared by every shape that shows it)\n\t */\n\tholes(): IGraphicsCommandDef[] {\n\t\tif (!this._holes) {\n\t\t\tconst holes: IGraphicsCommandDef[] = [];\n\t\t\tpathSegments(this.commands).forEach(segment => {\n\t\t\t\tif (segment.fill) {\n\t\t\t\t\tfindHoles(segment.path).forEach(command => holes.push(command));\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis._holes = holes;\n\t\t}\n\t\treturn this._holes;\n\t}\n\n\t/**\n\t * The drawing as a Pixi geometry, drawn the first time it is asked for and\n\t * shared from then on by every shape that shows this drawing (a shape's\n\t * Pixi node must therefore not be drawn into: that would change it for all)\n\t */\n\tgeometry(): PIXI.GraphicsGeometry {\n\t\tif (!this._geometry) {\n\t\t\tconst builder = new GeometryBuilder();\n\t\t\tdrawCommands(builder, this.commands, this.textures, this.holes());\n\t\t\tbuilder.finish();\n\t\t\tthis._geometry = builder;\n\t\t}\n\t\treturn this._geometry.geometry;\n\t}\n\n\t/** The drawing as a mask (its path filled), shared the same way */\n\tmaskGeometry(): PIXI.GraphicsGeometry {\n\t\tif (!this._maskGeometry) {\n\t\t\tconst builder = new GeometryBuilder();\n\t\t\tdrawMaskPath(builder, this.commands, this.maskHoles());\n\t\t\tbuilder.finish();\n\t\t\tthis._maskGeometry = builder;\n\t\t}\n\t\treturn this._maskGeometry.geometry;\n\t}\n\n\t/** The holes of the drawing as a mask (all of it one path) */\n\tmaskHoles(): IGraphicsCommandDef[] {\n\t\tif (!this._maskHoles) {\n\t\t\tthis._maskHoles = findHoles(this.commands.filter(command => PATH_COMMANDS.indexOf(command.type) >= 0));\n\t\t}\n\t\treturn this._maskHoles;\n\t}\n}\n\nGRAPHICS_COMMANDS.forEach(type => {\n\tObject.defineProperty(Graphics, type, { value: COMMAND_CLASSES[type], enumerable: true });\n});\n\n/**\n * createjs-compatible Shape on a Pixi Graphics.\n */\nexport class Shape extends DisplayObject {\n\treadonly pixiGraphics: PixiGraphics;\n\tprivate _graphics: Graphics | null = null;\n\t/** The shape as a mask (made when first used as one), a child of this shape's node */\n\tprivate _maskGraphics: PixiGraphics | null = null;\n\n\tconstructor(graphics?: Graphics | null) {\n\t\tconst node = new PixiGraphics(graphics ? graphics.geometry() : getEmptyGeometry());\n\t\tsuper(node);\n\t\tthis.pixiGraphics = node;\n\t\tthis._graphics = graphics || null;\n\t}\n\n\tget graphics(): Graphics | null {\n\t\treturn this._graphics;\n\t}\n\n\tset graphics(value: Graphics | null) {\n\t\tif (value === this._graphics) {\n\t\t\treturn;\n\t\t}\n\t\tthis._graphics = value;\n\t\tthis.pixiGraphics.setGeometry(value ? value.geometry() : getEmptyGeometry());\n\t\tif (this._maskGraphics) {\n\t\t\tthis._maskGraphics.setGeometry(value ? value.maskGeometry() : getEmptyGeometry());\n\t\t}\n\t\tthis._maskTargets.forEach(target => target._updatePixiMask());\n\t}\n\n\t_clipsAsMask(): boolean {\n\t\treturn !!(this._graphics && !this._graphics.isEmpty());\n\t}\n\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tthis.pixiGraphics.setBlendMode(mode);\n\t}\n\n\t/**\n\t * createjs clips with the shape's path alone (Graphics.drawAsPath, then\n\t * clip), whatever its fill and stroke; published masks are paths with no\n\t * fill. The mask node is that path, filled. It is a child of the shape's\n\t * node, so it moves with the shape (the shape's own node is not drawn while\n\t * it serves as a mask).\n\t */\n\t_pixiMaskNode(): PIXI.Container {\n\t\tlet node = this._maskGraphics;\n\t\tif (!node) {\n\t\t\tnode = this._maskGraphics = new PixiGraphics(this._graphics ? this._graphics.maskGeometry() : getEmptyGeometry());\n\t\t\t// Never hit by the pointer, as createjs never hits a mask\n\t\t\tnode.hitArea = NO_HIT_AREA;\n\t\t\tthis.pixiGraphics.addChild(node);\n\t\t}\n\t\treturn node;\n\t}\n\n\t_releaseMaskNode(): void {\n\t\tconst node = this._maskGraphics;\n\t\tif (node && !node.isMask) {\n\t\t\tnode.renderable = false;\n\t\t}\n\t}\n\n\ttoString(): string {\n\t\treturn '[Shape (name=' + this.name + ')]';\n\t}\n}\n\n/**\n * A frame of a sprite sheet, as createjs describes it.\n */\nexport interface ISpriteFrame {\n\timage: IImageAsset;\n\trect: Rectangle;\n}\n\n/**\n * An image as content sees it (`src` names it).\n */\nexport interface IImageAsset {\n\tsrc: string;\n\ttexture: PIXI.Texture;\n}\n\n/**\n * createjs-compatible SpriteSheet: frames cut from an atlas image.\n */\nexport class SpriteSheet {\n\treadonly frames: ISpriteFrame[];\n\treadonly textures: PIXI.Texture[];\n\tframerate = 0;\n\tcomplete = true;\n\n\tconstructor(image: IImageAsset, rects: number[][]) {\n\t\tthis.frames = rects.map(rect => ({ image, rect: new Rectangle(rect[0], rect[1], rect[2], rect[3]) }));\n\t\tthis.textures = this.frames.map(frame => new PIXI.Texture(image.texture.baseTexture, frame.rect.toPixi()));\n\t}\n\n\tgetFrame(index: number): ISpriteFrame | null {\n\t\treturn this.frames[index] || null;\n\t}\n\n\tgetNumFrames(): number {\n\t\treturn this.frames.length;\n\t}\n}\n\n/**\n * createjs-compatible Sprite (frame by frame from a sprite sheet).\n */\nexport class Sprite extends DisplayObject {\n\treadonly pixiSprite: PixiSprite;\n\tspriteSheet: SpriteSheet;\n\tcurrentFrame = 0;\n\tpaused = false;\n\tframerate = 0;\n\n\tconstructor(spriteSheet: SpriteSheet, frame?: number) {\n\t\tconst node = new PixiSprite(PIXI.Texture.EMPTY);\n\t\tsuper(node);\n\t\tthis.pixiSprite = node;\n\t\tthis.spriteSheet = spriteSheet;\n\t\tif (frame != null) {\n\t\t\tthis.gotoAndPlay(frame);\n\t\t}\n\t}\n\n\tplay(): void { this.paused = false; }\n\tstop(): void { this.paused = true; }\n\n\tgotoAndPlay(frame: number): void {\n\t\tthis.paused = false;\n\t\tthis._goto(frame);\n\t}\n\n\tgotoAndStop(frame: number): void {\n\t\tthis.paused = true;\n\t\tthis._goto(frame);\n\t}\n\n\tadvance(): void {\n\t\tconst count = this.spriteSheet.getNumFrames();\n\t\tthis._goto(count ? (this.currentFrame + 1) % count : 0);\n\t}\n\n\t_goto(frame: number): void {\n\t\tthis.currentFrame = frame;\n\t\tconst texture = this.spriteSheet.textures[frame];\n\t\tthis.pixiSprite.texture = texture || PIXI.Texture.EMPTY;\n\t}\n\n\t_tick(event: Event): void {\n\t\tif (!this.paused) {\n\t\t\tthis.advance();\n\t\t}\n\t\tsuper._tick(event);\n\t}\n\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tthis.pixiSprite.blendMode = mode;\n\t}\n\n\ttoString(): string {\n\t\treturn '[Sprite (name=' + this.name + ')]';\n\t}\n}\n\n/**\n * createjs-compatible Bitmap.\n */\nexport class Bitmap extends DisplayObject {\n\treadonly pixiSprite: PixiSprite;\n\tprivate _image: IImageAsset | null = null;\n\tprivate _sourceRect: Rectangle | null = null;\n\n\tconstructor(image?: IImageAsset | null) {\n\t\tconst node = new PixiSprite(PIXI.Texture.EMPTY);\n\t\tsuper(node);\n\t\tthis.pixiSprite = node;\n\t\tthis.image = image || null;\n\t}\n\n\tget image(): IImageAsset | null { return this._image; }\n\tset image(value: IImageAsset | null) {\n\t\tthis._image = value;\n\t\tthis._updateTexture();\n\t}\n\n\tget sourceRect(): Rectangle | null { return this._sourceRect; }\n\tset sourceRect(value: Rectangle | null) {\n\t\tthis._sourceRect = value;\n\t\tthis._updateTexture();\n\t}\n\n\tprivate _updateTexture(): void {\n\t\tconst image = this._image;\n\t\tif (!image) {\n\t\t\tthis.pixiSprite.texture = PIXI.Texture.EMPTY;\n\t\t\treturn;\n\t\t}\n\t\tconst rect = this._sourceRect;\n\t\tthis.pixiSprite.texture = rect ? new PIXI.Texture(image.texture.baseTexture, rect.toPixi()) : image.texture;\n\t}\n\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tthis.pixiSprite.blendMode = mode;\n\t}\n\n\ttoString(): string {\n\t\treturn '[Bitmap (name=' + this.name + ')]';\n\t}\n}\n\ninterface IFontParts {\n\tfontStyle: string;\n\tfontWeight: string;\n\tfontSize: number;\n\tfontFamily: string;\n}\n\n/**\n * The parts of a CSS font shorthand (\"bold 20px 'Nirmala UI'\").\n */\nfunction parseFont(font: string): IFontParts {\n\tconst match = /^\\s*(.*?)\\s*(\\d+(?:\\.\\d+)?)px(?:\\/\\S+)?\\s+(.+)$/.exec(font);\n\tif (!match) {\n\t\treturn { fontStyle: 'normal', fontWeight: 'normal', fontSize: 10, fontFamily: 'sans-serif' };\n\t}\n\tconst words = match[1].split(/\\s+/);\n\tlet fontStyle = 'normal';\n\tlet fontWeight = 'normal';\n\twords.forEach(word => {\n\t\tif (word === 'italic' || word === 'oblique') {\n\t\t\tfontStyle = word;\n\t\t} else if (word === 'bold' || word === 'bolder' || word === 'lighter' || /^\\d{3}$/.test(word)) {\n\t\t\tfontWeight = word;\n\t\t}\n\t});\n\treturn { fontStyle, fontWeight, fontSize: parseFloat(match[2]), fontFamily: match[3].replace(/['\"]/g, '') };\n}\n\nconst TEXT_ANCHOR_X: { [align: string]: number } = { left: 0, start: 0, center: 0.5, right: 1, end: 1 };\nconst TEXT_ANCHOR_Y: { [baseline: string]: number } = { top: 0, hanging: 0, middle: 0.5, alphabetic: 0.8, ideographic: 0.9, bottom: 1 };\n\n/**\n * The lines createjs draws a text in (Text._drawText): the text split at line\n * breaks (CR LF, CR, LF), then a line wider than lineWidth broken at whitespace\n * only, words added while they fit (a word wider than lineWidth stays whole).\n * No breaking at all when lineWidth is null.\n */\nexport function breakLines(text: string, lineWidth: number | null, measure: (line: string) => number): string[] {\n\tconst lines: string[] = [];\n\tString(text).split(/(?:\\r\\n|\\r|\\n)/).forEach(source => {\n\t\tlet line = source;\n\t\tif (lineWidth != null && measure(line) > lineWidth) {\n\t\t\tconst words = line.split(/(\\s)/);\n\t\t\tline = words[0];\n\t\t\tlet width = measure(line);\n\t\t\tfor (let i = 1; i < words.length; i += 2) {\n\t\t\t\tconst wordWidth = measure(words[i] + words[i + 1]);\n\t\t\t\tif (width + wordWidth > lineWidth) {\n\t\t\t\t\tlines.push(line);\n\t\t\t\t\tline = words[i + 1];\n\t\t\t\t\twidth = measure(line);\n\t\t\t\t} else {\n\t\t\t\t\tline += words[i] + words[i + 1];\n\t\t\t\t\twidth += wordWidth;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlines.push(line);\n\t});\n\treturn lines;\n}\n\n/**\n * createjs-compatible Text on a Pixi Text.\n */\nexport class Text extends DisplayObject {\n\treadonly pixiText: PixiText;\n\tprivate _text = '';\n\t// As createjs: what the constructor is given, kept as given (none: null); drawing falls back to\n\t// 10px sans-serif and black\n\tprivate _font: string | null = null;\n\tprivate _color: string | null = null;\n\tprivate _textAlign = 'left';\n\tprivate _textBaseline = 'top';\n\tprivate _lineHeight = 0;\n\tprivate _lineWidth: number | null = null;\n\tprivate _maxWidth: number | null = null;\n\tprivate _outline = 0;\n\n\tconstructor(text?: string, font?: string, color?: string) {\n\t\tconst node = new PixiText('');\n\t\t// Pixi draws text into an image and places that image: at a position between pixels it is\n\t\t// blurred by sampling, where canvas (createjs) draws the glyphs sharp at any position\n\t\tnode.roundPixels = true;\n\t\tsuper(node);\n\t\tthis.pixiText = node;\n\t\tthis._text = text == null ? '' : String(text);\n\t\tthis._font = font == null ? null : font;\n\t\tthis._color = color == null ? null : color;\n\t\tthis._updateText();\n\t}\n\n\tget text(): string { return this._text; }\n\tset text(value: string) { this._text = value; this._updateText(); }\n\tget font(): string | null { return this._font; }\n\tset font(value: string | null) { this._font = value; this._updateText(); }\n\tget color(): string | null { return this._color; }\n\tset color(value: string | null) { this._color = value; this._updateText(); }\n\tget textAlign(): string { return this._textAlign; }\n\tset textAlign(value: string) { this._textAlign = value; this._updateText(); }\n\tget textBaseline(): string { return this._textBaseline; }\n\tset textBaseline(value: string) { this._textBaseline = value; this._updateText(); }\n\tget lineHeight(): number { return this._lineHeight; }\n\tset lineHeight(value: number) { this._lineHeight = value; this._updateText(); }\n\tget lineWidth(): number | null { return this._lineWidth; }\n\tset lineWidth(value: number | null) { this._lineWidth = value; this._updateText(); }\n\tget maxWidth(): number | null { return this._maxWidth; }\n\tset maxWidth(value: number | null) { this._maxWidth = value; this._updateText(); }\n\tget outline(): number { return this._outline; }\n\tset outline(value: number) { this._outline = value; this._updateText(); }\n\n\tprivate _updateText(): void {\n\t\tconst node = this.pixiText;\n\t\tconst font = parseFont(this._font || '10px sans-serif');\n\t\tconst color = parseColor(this._color || '#000');\n\t\tconst style = new PIXI.TextStyle({\n\t\t\tfontStyle: font.fontStyle,\n\t\t\tfontWeight: font.fontWeight,\n\t\t\tfontSize: font.fontSize,\n\t\t\tfontFamily: font.fontFamily,\n\t\t\tfill: this._outline ? 'rgba(0,0,0,0)' : (color ? color.color : 0),\n\t\t\tstroke: color ? color.color : 0,\n\t\t\tstrokeThickness: this._outline || 0,\n\t\t\talign: this._textAlign === 'center' ? 'center' : (this._textAlign === 'right' || this._textAlign === 'end') ? 'right' : 'left',\n\t\t\t// Lines are broken here the way createjs breaks them, not by Pixi's word wrap\n\t\t\twordWrap: false\n\t\t});\n\t\tconst measure = (line: string): number => PIXI.TextMetrics.measureText(line, style, false).width;\n\t\t// createjs's line height when none is set: 1.2 times the width of an M\n\t\tstyle.lineHeight = this._lineHeight || 1.2 * measure('M');\n\t\tnode.style = style;\n\t\tnode.text = breakLines(this._text, this._lineWidth, measure).join('\\n');\n\t\tconst anchorX = TEXT_ANCHOR_X[this._textAlign];\n\t\tconst anchorY = TEXT_ANCHOR_Y[this._textBaseline];\n\t\tnode.anchor.set(anchorX === undefined ? 0 : anchorX, anchorY === undefined ? 0 : anchorY);\n\t}\n\n\t_setBlendMode(mode: PIXI.BLEND_MODES): void {\n\t\tthis.pixiText.blendMode = mode;\n\t}\n\n\ttoString(): string {\n\t\treturn '[Text (text=' + this._text + ')]';\n\t}\n}\n\n/**\n * createjs-compatible ColorFilter on a Pixi ColorMatrixFilter.\n */\nexport class ColorFilter {\n\treadonly pixiFilter: PIXI.filters.ColorMatrixFilter;\n\tprivate _values: number[];\n\n\tconstructor(redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaMultiplier?: number,\n\t\tredOffset?: number, greenOffset?: number, blueOffset?: number, alphaOffset?: number) {\n\t\tthis.pixiFilter = new PIXI.filters.ColorMatrixFilter();\n\t\tthis._values = [\n\t\t\tredMultiplier == null ? 1 : redMultiplier,\n\t\t\tgreenMultiplier == null ? 1 : greenMultiplier,\n\t\t\tblueMultiplier == null ? 1 : blueMultiplier,\n\t\t\talphaMultiplier == null ? 1 : alphaMultiplier,\n\t\t\tredOffset || 0, greenOffset || 0, blueOffset || 0, alphaOffset || 0\n\t\t];\n\t\tthis._updateMatrix();\n\t}\n\n\tget redMultiplier(): number { return this._values[0]; }\n\tset redMultiplier(value: number) { this._set(0, value); }\n\tget greenMultiplier(): number { return this._values[1]; }\n\tset greenMultiplier(value: number) { this._set(1, value); }\n\tget blueMultiplier(): number { return this._values[2]; }\n\tset blueMultiplier(value: number) { this._set(2, value); }\n\tget alphaMultiplier(): number { return this._values[3]; }\n\tset alphaMultiplier(value: number) { this._set(3, value); }\n\tget redOffset(): number { return this._values[4]; }\n\tset redOffset(value: number) { this._set(4, value); }\n\tget greenOffset(): number { return this._values[5]; }\n\tset greenOffset(value: number) { this._set(5, value); }\n\tget blueOffset(): number { return this._values[6]; }\n\tset blueOffset(value: number) { this._set(6, value); }\n\tget alphaOffset(): number { return this._values[7]; }\n\tset alphaOffset(value: number) { this._set(7, value); }\n\n\tprivate _set(index: number, value: number): void {\n\t\tthis._values[index] = value;\n\t\tthis._updateMatrix();\n\t}\n\n\tprivate _updateMatrix(): void {\n\t\tconst v = this._values;\n\t\tconst m = this.pixiFilter.matrix;\n\t\tfor (let i = 0; i < 20; i++) {\n\t\t\tm[i] = 0;\n\t\t}\n\t\tm[0] = v[0];\n\t\tm[6] = v[1];\n\t\tm[12] = v[2];\n\t\tm[18] = v[3];\n\t\tm[4] = v[4] / 255;\n\t\tm[9] = v[5] / 255;\n\t\tm[14] = v[6] / 255;\n\t\tm[19] = v[7] / 255;\n\t}\n\n\ttoString(): string {\n\t\treturn '[ColorFilter]';\n\t}\n}\n\n/**\n * Members ButtonHelper needs from its target (a MovieClip).\n */\nexport interface IButtonTarget extends Container {\n\tpaused: boolean;\n\tactionsEnabled: boolean;\n\tgotoAndPlay(frame: string | number): void;\n\tgotoAndStop(frame: string | number): void;\n\t_reset(): void;\n}\n\n/**\n * createjs-compatible ButtonHelper: sends its target to the out / over /\n * down frames on mouse events, and stops it on the out frame from the start.\n */\nexport class ButtonHelper {\n\treadonly target: IButtonTarget;\n\toverLabel: string | number;\n\toutLabel: string | number;\n\tdownLabel: string | number;\n\tplay: boolean;\n\t_isPressed = false;\n\t_isOver = false;\n\t_enabled = false;\n\tprivate _originalReset: (() => void) | null = null;\n\n\tconstructor(target: IButtonTarget, outLabel?: string | number | null, overLabel?: string | number | null, downLabel?: string | number | null,\n\t\tplay?: boolean, hitArea?: IButtonTarget | null, hitLabel?: string | number | null) {\n\t\tthis.target = target;\n\t\tthis.overLabel = overLabel == null ? 'over' : overLabel;\n\t\tthis.outLabel = outLabel == null ? 'out' : outLabel;\n\t\tthis.downLabel = downLabel == null ? 'down' : downLabel;\n\t\tthis.play = !!play;\n\t\ttarget.mouseChildren = false;\n\t\tthis.enabled = true;\n\t\tthis.handleEvent(new Event(''));\n\t\tif (hitArea) {\n\t\t\t// As createjs: only a truthy label sends the hit area there (frame 0 leaves it as it is)\n\t\t\tif (hitLabel) {\n\t\t\t\thitArea.actionsEnabled = false;\n\t\t\t\thitArea.gotoAndStop(hitLabel);\n\t\t\t}\n\t\t\ttarget.hitArea = hitArea;\n\t\t}\n\t}\n\n\tget enabled(): boolean { return this._enabled; }\n\tset enabled(value: boolean) {\n\t\tif (value === this._enabled) {\n\t\t\treturn;\n\t\t}\n\t\tconst target = this.target;\n\t\tthis._enabled = value;\n\t\tif (value) {\n\t\t\ttarget.cursor = 'pointer';\n\t\t\ttarget.addEventListener('rollover', this);\n\t\t\ttarget.addEventListener('rollout', this);\n\t\t\ttarget.addEventListener('mousedown', this);\n\t\t\ttarget.addEventListener('pressup', this);\n\t\t\t// The target keeps its paused state when its timeline resets it on re-entry\n\t\t\tconst reset = target._reset;\n\t\t\tthis._originalReset = reset;\n\t\t\ttarget._reset = function (): void {\n\t\t\t\tconst paused = target.paused;\n\t\t\t\treset.call(target);\n\t\t\t\ttarget.paused = paused;\n\t\t\t};\n\t\t} else {\n\t\t\ttarget.cursor = null;\n\t\t\ttarget.removeEventListener('rollover', this);\n\t\t\ttarget.removeEventListener('rollout', this);\n\t\t\ttarget.removeEventListener('mousedown', this);\n\t\t\ttarget.removeEventListener('pressup', this);\n\t\t\tconst original = this._originalReset;\n\t\t\tif (original) {\n\t\t\t\ttarget._reset = original;\n\t\t\t\tthis._originalReset = null;\n\t\t\t}\n\t\t}\n\t}\n\n\thandleEvent(event: Event): void {\n\t\tconst type = event.type;\n\t\tlet label: string | number;\n\t\tif (type === 'mousedown') {\n\t\t\tthis._isPressed = true;\n\t\t\tlabel = this.downLabel;\n\t\t} else if (type === 'pressup') {\n\t\t\tthis._isPressed = false;\n\t\t\tlabel = this._isOver ? this.overLabel : this.outLabel;\n\t\t} else if (type === 'rollover') {\n\t\t\tthis._isOver = true;\n\t\t\tlabel = this._isPressed ? this.downLabel : this.overLabel;\n\t\t} else {\n\t\t\tthis._isOver = false;\n\t\t\tlabel = this._isPressed ? this.overLabel : this.outLabel;\n\t\t}\n\t\tif (this.play) {\n\t\t\tthis.target.gotoAndPlay(label);\n\t\t} else {\n\t\t\tthis.target.gotoAndStop(label);\n\t\t}\n\t}\n\n\ttoString(): string {\n\t\treturn '[ButtonHelper]';\n\t}\n}\n","/**\n * Semantic version numbers and ranges, as far as the version checks of\n * definitions and runtime content need them: versions are MAJOR.MINOR.PATCH,\n * and ranges are written as npm writes them (`1.2.3`, `1.x`, `^1.2.0`,\n * `~1.2.0`, `>=1.0.0 <2.0.0`, `0.x || 1.x`). Pre-release tags are not handled.\n */\n\ntype TVersion = [number, number, number];\n\n/** A version as its three numbers, or null when it is not MAJOR.MINOR.PATCH */\nexport function parseVersion(text: string): TVersion | null {\n\tconst match = /^\\s*v?(\\d+)\\.(\\d+)\\.(\\d+)\\s*$/.exec(text);\n\treturn match ? [Number(match[1]), Number(match[2]), Number(match[3])] : null;\n}\n\nfunction compareParsed(a: TVersion, b: TVersion): number {\n\tfor (let i = 0; i < 3; i++) {\n\t\tif (a[i] !== b[i]) {\n\t\t\treturn a[i] < b[i] ? -1 : 1;\n\t\t}\n\t}\n\treturn 0;\n}\n\n/** -1, 0 or 1 as a is lower than, the same as or higher than b (both have to be versions) */\nexport function compareVersions(a: string, b: string): number {\n\tconst pa = parseVersion(a);\n\tconst pb = parseVersion(b);\n\tif (!pa || !pb) {\n\t\tthrow new Error('not a version: ' + (pa ? b : a));\n\t}\n\treturn compareParsed(pa, pb);\n}\n\n/** A test on a version: the version compared with a bound */\ninterface IComparator {\n\top: '>=' | '<';\n\tbound: TVersion;\n}\n\n/** A partial version (1, 1.2, 1.x, *): the numbers given, the rest left open */\nfunction parsePartial(text: string): number[] | null {\n\tif (text === '*' || text === 'x' || text === 'X') {\n\t\treturn [];\n\t}\n\tconst parts = text.split('.');\n\tif (parts.length > 3) {\n\t\treturn null;\n\t}\n\tconst numbers: number[] = [];\n\tfor (let i = 0; i < parts.length; i++) {\n\t\tconst part = parts[i];\n\t\tif (part === 'x' || part === 'X' || part === '*') {\n\t\t\tbreak;\n\t\t}\n\t\tif (!/^\\d+$/.test(part)) {\n\t\t\treturn null;\n\t\t}\n\t\tnumbers.push(Number(part));\n\t}\n\treturn numbers;\n}\n\nfunction lowest(numbers: number[]): TVersion {\n\treturn [numbers[0] || 0, numbers[1] || 0, numbers[2] || 0];\n}\n\n/** The first version above every version the given numbers start (1.2 -> 1.3.0); null for none (*) */\nfunction above(numbers: number[]): TVersion | null {\n\tif (numbers.length === 0) {\n\t\treturn null;\n\t}\n\tif (numbers.length === 1) {\n\t\treturn [numbers[0] + 1, 0, 0];\n\t}\n\tif (numbers.length === 2) {\n\t\treturn [numbers[0], numbers[1] + 1, 0];\n\t}\n\treturn [numbers[0], numbers[1], numbers[2] + 1];\n}\n\n/** The tests one word of a range stands for, or null when the word is not understood */\nfunction parseComparator(word: string): IComparator[] | null {\n\tconst match = /^(\\^|~|>=|<=|>|<|=)?(.+)$/.exec(word);\n\tif (!match) {\n\t\treturn null;\n\t}\n\tconst op = match[1] || '=';\n\tconst numbers = parsePartial(match[2]);\n\tif (!numbers) {\n\t\treturn null;\n\t}\n\tconst low = lowest(numbers);\n\tconst result: IComparator[] = [];\n\tconst atLeast = (bound: TVersion): void => {\n\t\tresult.push({ op: '>=', bound });\n\t};\n\tconst below = (bound: TVersion | null): void => {\n\t\tif (bound) {\n\t\t\tresult.push({ op: '<', bound });\n\t\t}\n\t};\n\tif (op === '=') {\n\t\tatLeast(low);\n\t\tbelow(above(numbers));\n\t} else if (op === '^') {\n\t\t// The left-most non-zero number given stays the same (^1.2.3 <2.0.0, ^0.2.3 <0.3.0, ^0.0.3 <0.0.4)\n\t\tlet fixed = 0;\n\t\twhile (fixed < numbers.length - 1 && numbers[fixed] === 0) {\n\t\t\tfixed++;\n\t\t}\n\t\tatLeast(low);\n\t\tbelow(above(numbers.slice(0, fixed + 1)));\n\t} else if (op === '~') {\n\t\tatLeast(low);\n\t\tbelow(above(numbers.slice(0, numbers.length > 1 ? 2 : 1)));\n\t} else if (op === '>=') {\n\t\tatLeast(low);\n\t} else if (op === '>') {\n\t\tconst next = above(numbers);\n\t\tif (!next) {\n\t\t\treturn null;\n\t\t}\n\t\tatLeast(next);\n\t} else if (op === '<') {\n\t\tbelow(low);\n\t} else {\n\t\t// <=\n\t\tbelow(above(numbers));\n\t}\n\treturn result;\n}\n\n/** Whether a version is in a range (npm's notation, see above); a range not understood throws */\nexport function satisfies(version: string, range: string): boolean {\n\tconst parsed = parseVersion(version);\n\tif (!parsed) {\n\t\treturn false;\n\t}\n\treturn range.split('||').some(set => {\n\t\tconst words = set.trim().split(/\\s+/).filter(word => word !== '');\n\t\tif (!words.length) {\n\t\t\tthrow new Error('not a version range: ' + range);\n\t\t}\n\t\treturn words.every(word => {\n\t\t\tconst comparators = parseComparator(word);\n\t\t\tif (!comparators) {\n\t\t\t\tthrow new Error('not a version range: ' + range);\n\t\t\t}\n\t\t\treturn comparators.every(c => {\n\t\t\t\tconst order = compareParsed(parsed, c.bound);\n\t\t\t\treturn c.op === '>=' ? order >= 0 : order < 0;\n\t\t\t});\n\t\t});\n\t});\n}\n\n/**\n * Whether data a reader is given can be read: `error` when its writer's\n * version is outside the range the reader reads, `warning` when it is in the\n * range but newer than the version the reader knows of (the data may hold\n * what the reader does not know and leaves out). Both null when it reads.\n */\nexport interface IVersionCheck {\n\terror: string | null;\n\twarning: string | null;\n\t/** With an error: whether the writer is newer than the reader (update the reader) or older (write the data again) */\n\tnewer: boolean;\n}\n\nexport function checkVersion(version: string, range: string, known: string): IVersionCheck {\n\tconst parsed = parseVersion(version);\n\tif (!parsed) {\n\t\treturn { error: 'no version (' + JSON.stringify(version) + ')', warning: null, newer: false };\n\t}\n\tconst newer = compareVersions(version, known) > 0;\n\tif (!satisfies(version, range)) {\n\t\treturn { error: version + ' is outside ' + range, warning: null, newer };\n\t}\n\treturn { error: null, warning: newer ? version + ' is newer than ' + known : null, newer };\n}\n","/** The version of this package (written in from package.json when the package is built) */\nexport const VERSION: string = '__PACKAGE_VERSION__';\n","/**\n * The eases of CreateJS (createjs.Ease), computed as CreateJS computes them,\n * by name. Runtime content names the ease of an interpolated stretch of a\n * tween; the player computes the stretch's values with it once, when a symbol's\n * class is made. `get:<amount>` is Ease.get(amount) (Animate's classic ease).\n */\n\nexport type TEase = (t: number) => number;\n\nfunction powIn(pow: number): TEase {\n\treturn t => Math.pow(t, pow);\n}\n\nfunction powOut(pow: number): TEase {\n\treturn t => 1 - Math.pow(1 - t, pow);\n}\n\nfunction powInOut(pow: number): TEase {\n\treturn t => ((t *= 2) < 1 ? 0.5 * Math.pow(t, pow) : 1 - 0.5 * Math.abs(Math.pow(2 - t, pow)));\n}\n\nfunction backIn(amount: number): TEase {\n\treturn t => t * t * ((amount + 1) * t - amount);\n}\n\nfunction backOut(amount: number): TEase {\n\treturn t => --t * t * ((amount + 1) * t + amount) + 1;\n}\n\nfunction backInOut(amount: number): TEase {\n\tamount *= 1.525;\n\treturn t => ((t *= 2) < 1 ? 0.5 * (t * t * ((amount + 1) * t - amount)) : 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2));\n}\n\nfunction elasticIn(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tif (t == 0 || t == 1) {\n\t\t\treturn t;\n\t\t}\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));\n\t};\n}\n\nfunction elasticOut(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tif (t == 0 || t == 1) {\n\t\t\treturn t;\n\t\t}\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn amplitude * Math.pow(2, -10 * t) * Math.sin((t - s) * pi2 / period) + 1;\n\t};\n}\n\nfunction elasticInOut(amplitude: number, period: number): TEase {\n\tconst pi2 = 2 * Math.PI;\n\treturn t => {\n\t\tconst s = period / pi2 * Math.asin(1 / amplitude);\n\t\treturn (t *= 2) < 1\n\t\t\t? -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period))\n\t\t\t: amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * 0.5 + 1;\n\t};\n}\n\nfunction bounceOut(t: number): number {\n\treturn 1 / 2.75 > t ? 7.5625 * t * t\n\t\t: 2 / 2.75 > t ? 7.5625 * (t -= 1.5 / 2.75) * t + 0.75\n\t\t: 2.5 / 2.75 > t ? 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375\n\t\t: 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;\n}\n\nfunction bounceIn(t: number): number {\n\treturn 1 - bounceOut(1 - t);\n}\n\n/** Ease.get(amount): Animate's classic ease, amount from -1 (in) to 1 (out) */\nfunction classic(amount: number): TEase {\n\tamount = amount < -1 ? -1 : amount > 1 ? 1 : amount;\n\treturn t => (amount == 0 ? t : amount < 0 ? t * (t * -amount + 1 + amount) : t * ((2 - t) * amount + (1 - amount)));\n}\n\nconst EASES: { [name: string]: TEase } = {\n\tlinear: t => t,\n\tquadIn: powIn(2), quadOut: powOut(2), quadInOut: powInOut(2),\n\tcubicIn: powIn(3), cubicOut: powOut(3), cubicInOut: powInOut(3),\n\tquartIn: powIn(4), quartOut: powOut(4), quartInOut: powInOut(4),\n\tquintIn: powIn(5), quintOut: powOut(5), quintInOut: powInOut(5),\n\tsineIn: t => 1 - Math.cos(t * Math.PI / 2),\n\tsineOut: t => Math.sin(t * Math.PI / 2),\n\tsineInOut: t => -0.5 * (Math.cos(Math.PI * t) - 1),\n\tbackIn: backIn(1.7), backOut: backOut(1.7), backInOut: backInOut(1.7),\n\tcircIn: t => -(Math.sqrt(1 - t * t) - 1),\n\tcircOut: t => Math.sqrt(1 - --t * t),\n\tcircInOut: t => ((t *= 2) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1)),\n\tbounceIn, bounceOut,\n\tbounceInOut: t => (0.5 > t ? 0.5 * bounceIn(2 * t) : 0.5 * bounceOut(2 * t - 1) + 0.5),\n\telasticIn: elasticIn(1, 0.3), elasticOut: elasticOut(1, 0.3), elasticInOut: elasticInOut(1, 0.3 * 1.5)\n};\n\n/** The ease runtime content names (null for a name the player does not know) */\nexport function easeOf(id: string): TEase | null {\n\tif (id.indexOf('get:') === 0) {\n\t\treturn classic(Number(id.slice(4)));\n\t}\n\treturn Object.prototype.hasOwnProperty.call(EASES, id) ? EASES[id] : null;\n}\n\n/** The eases the generator tries for a stretch of a tween, by name: the named ones, then Ease.get(-1 .. 1) in hundredths */\nexport function easeIds(): string[] {\n\tconst ids = Object.keys(EASES);\n\tfor (let n = -100; n <= 100; n++) {\n\t\tids.push('get:' + n / 100);\n\t}\n\treturn ids;\n}\n","/**\n * The data of runtime content (what the generator writes and the player reads): the definition\n * extracted by @tawaship/animate-data-converter, with every frame script\n * taken out of the data and referenced by its index in the runtime content's\n * script list (the scripts themselves are code in the runtime content), and with\n * the writes of each tween and of each instance's initial values compiled\n * into writer functions (code in the runtime content as well, referenced by index).\n * Drawings are gathered into one table for the whole content, identical\n * ones merged, and a symbol refers to them by index.\n */\n\nimport type {\n\tIMovieClipSymbolDef, ISpriteSymbolDef, IBitmapSymbolDef, ITweenDef, IPropMapDef, ISlotDef,\n\tIManifestEntryDef, ISpriteSheetDef, IGraphicsCommandDef, IStateEntryDef, IDataMap, TDataValue, TFrameValue\n} from '@tawaship/animate-data-converter';\nimport { easeOf, TEase } from './ease';\n\n/** A kind of drawing command: its type and the names of its props, in order */\nexport type TRuntimeCommandKind = [string, string[]];\n\n/** A drawing command as written in runtime content: the index of its kind, then its props' values in the kind's order */\nexport type TRuntimeCommand = TDataValue[];\n\n/** A drawing as written in runtime content */\nexport interface IRuntimeGraphicsData {\n\tcommands: TRuntimeCommand[];\n}\n\n/** A drawing's commands as the player draws them, from their written form */\nexport function commandsOf(kinds: TRuntimeCommandKind[], graphics: IRuntimeGraphicsData): IGraphicsCommandDef[] {\n\treturn graphics.commands.map(command => {\n\t\tconst kind = kinds[typeof command[0] === 'number' ? command[0] : 0];\n\t\tconst props: IDataMap = {};\n\t\tkind[1].forEach((name, i) => {\n\t\t\tprops[name] = command[i + 1];\n\t\t});\n\t\treturn { type: kind[0], props };\n\t});\n}\n\nexport type {\n\tISlotDef, ITweenDef, IStateEntryDef, IGraphicsDef, IGraphicsCommandDef, ISpriteDef, IBitmapDef,\n\tIFilterDef, ICacheDef, IButtonDef, IFilterCacheEntryDef, IRectDef, IDataMap, IPropMapDef,\n\tIManifestEntryDef, ISpriteSheetDef, ILabelDef, IMemberDef, TTargetDef, TFrameValue, TDataValue,\n\tISpriteSymbolDef, IBitmapSymbolDef\n} from '@tawaship/animate-data-converter';\n\n/**\n * The pixi-animate-runtime versions whose runtime content this player plays\n * (npm's range notation). Raised when the player stops playing runtime\n * content older versions made.\n */\nexport const RUNTIME_CONTENT_RANGE = '0.x';\n\nexport interface IRuntimeActionDef {\n\t/** Timeline position the action sits on */\n\tposition: number;\n\t/** Index into the runtime content's script list */\n\tscript: number;\n\tparams: TFrameValue[] | null;\n}\n\nexport interface IRuntimeTweenDef extends Omit<ITweenDef, 'actions' | 'frames'> {\n\tactions: IRuntimeActionDef[];\n\t/** The tween's distinct frame values (each the values of its props, in order) */\n\tvalues: TFrameValue[][];\n\t/** For every position, the index of its values in values (a position holding the same values as another shares them) */\n\tframes: number[];\n\t/**\n\t * Index into the runtime content's writer list: the function that writes a frame's\n\t * values (values[frames[position]]) to the target, one property after another by\n\t * name (null when the tween writes no property)\n\t */\n\twriter: number | null;\n}\n\n/**\n * A slot as the player uses it. Its initial values are in code only (the\n * writer), not in the data.\n */\n/**\n * A frame value as written in runtime content: a display list (`state`) may\n * give an entry that places a slot as it is (no props) as the slot's index\n */\nexport type TRuntimeFrameValue = TFrameValue | Array<IStateEntryDef | number>;\n\n/**\n * A position, or a stretch of positions, of a tween as written in runtime\n * content: the index of the position's values, or an interpolated stretch\n * [from, to, length, ease] whose positions run from values[from] toward\n * values[to] (the position after the stretch) as CreateJS interpolates a\n * step with that ease (see interpolated)\n */\nexport type TRuntimeFrameRef = number | [number, number, number, string];\n\n/** A tween as written in runtime content (tweenOf makes its values for every position) */\nexport interface IRuntimeTweenData extends Omit<IRuntimeTweenDef, 'values' | 'frames'> {\n\tvalues: TRuntimeFrameValue[][];\n\tframes: TRuntimeFrameRef[];\n}\n\n/**\n * The values at a position of a step, as CreateJS's Tween computes them: the\n * ratio of the position in the step, eased, then each value from its start\n * toward its end (a value that is not a number, or does not change, keeps its\n * start until the eased ratio reaches 1).\n */\nexport function interpolated(from: TFrameValue[], to: TFrameValue[], position: number, length: number, ease: TEase | null): TFrameValue[] {\n\tlet ratio = position / length;\n\tif (ease) {\n\t\tratio = ease(ratio);\n\t}\n\treturn from.map((v0, i) => {\n\t\tconst v1 = to[i];\n\t\treturn v0 !== v1 && typeof v0 === 'number' && typeof v1 === 'number' ? v0 + (v1 - v0) * ratio : ratio >= 1 ? v1 : v0;\n\t});\n}\n\n/** A display list entry as the player uses it, from its written form */\nfunction stateEntryOf(entry: IStateEntryDef | number): IStateEntryDef {\n\treturn typeof entry === 'number' ? { target: { type: 'slot', slot: entry }, props: null } : entry;\n}\n\n/**\n * A tween with the values of every position: its display lists (the values of\n * its `state` prop) as entries, and its interpolated stretches computed (each\n * position of a stretch gets values of its own)\n */\nexport function tweenOf(data: IRuntimeTweenData): IRuntimeTweenDef {\n\tconst state = data.props.indexOf('state');\n\tconst values = data.values.map(frame => frame.map((value, i): TFrameValue => {\n\t\tif (i === state && Array.isArray(value)) {\n\t\t\treturn value.map(stateEntryOf);\n\t\t}\n\t\treturn isFrameValue(value) ? value : null;\n\t}));\n\tconst frames: number[] = [];\n\tdata.frames.forEach(ref => {\n\t\tif (typeof ref === 'number') {\n\t\t\tframes.push(ref);\n\t\t\treturn;\n\t\t}\n\t\tconst ease = easeOf(ref[3]);\n\t\tfor (let position = 0; position < ref[2]; position++) {\n\t\t\tframes.push(values.push(interpolated(values[ref[0]], values[ref[1]], position, ref[2], ease)) - 1);\n\t\t}\n\t});\n\treturn Object.assign({}, data, { values, frames });\n}\n\n/** Whether a written value is a frame value as it is (all but a display list with slot indexes) */\nfunction isFrameValue(value: TRuntimeFrameValue): value is TFrameValue {\n\treturn !Array.isArray(value) || value.every(entry => typeof entry !== 'number');\n}\n\nexport interface IRuntimeSlotDef extends Omit<ISlotDef, 'init'> {\n\t/** Index into the runtime content's writer list: the function that writes the slot's initial values (initValues) */\n\tinitWriter: number | null;\n\t/** The slot's initial values, in the order its writer writes them */\n\tinitValues: TFrameValue[] | null;\n}\n\n/** The values a slot's fields have when runtime content leaves them out */\nexport const SLOT_DEFAULTS: Omit<IRuntimeSlotDef, 'kind'> = {\n\tsymbol: null, mode: null, startPosition: null, loop: null, graphics: null, sprite: null, bitmap: null, text: null,\n\tmask: null, hitArea: null, filters: null, cache: null, button: null, filterCacheListener: false, parentSet: false,\n\tinitWriter: null, initValues: null\n};\n\n/**\n * A slot template as written in runtime content: its kind, and the fields not\n * at their defaults (SLOT_DEFAULTS); its initial values are the slot's own\n */\nexport type TRuntimeSlotData = Pick<IRuntimeSlotDef, 'kind'> & Partial<Omit<IRuntimeSlotDef, 'kind' | 'initValues'>>;\n\n/**\n * A slot as written in a symbol: the index of its template in the content's\n * slotTemplates, with its initial values when it has some\n */\nexport type TRuntimeSlotRef = number | [number, TFrameValue[]];\n\n/** A slot from its template (the fields left out at their defaults) and its initial values */\nexport function slotOf(templates: TRuntimeSlotData[], ref: TRuntimeSlotRef): IRuntimeSlotDef {\n\tconst template = templates[typeof ref === 'number' ? ref : ref[0]];\n\treturn Object.assign({}, SLOT_DEFAULTS, template, { initValues: typeof ref === 'number' ? null : ref[1] });\n}\n\nexport interface IRuntimeMovieClipDef extends Omit<IMovieClipSymbolDef, 'tweens' | 'slots' | 'graphics' | 'members'> {\n\t/** The slots as written (templates and initial values; slotOf makes them whole) */\n\tslots: TRuntimeSlotRef[];\n\t/** The tweens as written (display lists with slot indexes; tweenOf turns them back into entries) */\n\ttweens: IRuntimeTweenData[];\n\t/**\n\t * Index into the runtime content's member writer list: the function that\n\t * gives an instance its named children (`this.instance = ...`), or null\n\t * when it has none\n\t */\n\tmemberWriter: number | null;\n\t/**\n\t * The symbol's drawings as indexes into the content's drawing table\n\t * (graphics[n] is the drawing the symbol's slots and tween values call n)\n\t */\n\tgraphics: number[];\n}\n\nexport type TRuntimeSymbolDef = IRuntimeMovieClipDef | ISpriteSymbolDef | IBitmapSymbolDef;\n\nexport interface IRuntimeData {\n\t/** The version of pixi-animate-runtime that generated the runtime content */\n\truntimeVersion: string;\n\t/** Primitive entries of the published lib.properties (width, height, fps, color, ...) */\n\tproperties: IPropMapDef;\n\t/** Images of the published manifest (sounds are left out) */\n\timages: IManifestEntryDef[];\n\t/** The published lib.ssMetadata */\n\tspriteSheets: ISpriteSheetDef[];\n\t/** Every drawing of the content, identical ones merged (shared by every symbol that shows them); commandsOf reads them */\n\tgraphics: IRuntimeGraphicsData[];\n\t/** The kinds of the drawings' commands (a type and the names of its props) */\n\tcommandKinds: TRuntimeCommandKind[];\n\t/** The slots of every symbol but their initial values, identical ones merged */\n\tslotTemplates: TRuntimeSlotData[];\n\tsymbols: { [id: string]: TRuntimeSymbolDef };\n}\n","import * as PIXI from 'pixi.js';\nimport { checkVersion } from './semver';\nimport { VERSION } from './version';\nimport { DisplayObject, Container } from './display';\nimport { Rectangle } from './geom';\nimport { Event, EventDispatcher } from './events';\nimport { MovieClip, Timeline, TweenState, ITweenScope, TScript, TWriter, TMemberWriter, TWrittenValue, INDEPENDENT } from './movieclip';\nimport {\n\tShape, Graphics, Sprite, SpriteSheet, Bitmap, Text, ColorFilter, ButtonHelper,\n\tITextureSource, IImageAsset\n} from './objects';\nimport {\n\tRUNTIME_CONTENT_RANGE, IRuntimeData, IRuntimeMovieClipDef, IRuntimeTweenDef, ISpriteSymbolDef, IBitmapSymbolDef, slotOf, tweenOf, commandsOf,\n\tIRuntimeSlotDef, ISpriteDef, IBitmapDef, IRectDef, IStateEntryDef, TTargetDef, TFrameValue, TDataValue\n} from './data';\n\n/**\n * Whether this player plays runtime content: an error when the version of\n * pixi-animate-runtime that generated it is outside the range the player\n * plays, a warning when it is newer than the player (it may hold what the\n * player does not know and leaves out).\n */\nfunction checkRuntimeContent(data: IRuntimeData): void {\n\tconst made = typeof data.runtimeVersion === 'string' ? data.runtimeVersion : '';\n\tconst check = checkVersion(made, RUNTIME_CONTENT_RANGE, VERSION);\n\tconst by = 'This runtime content was generated by pixi-animate-runtime ' + (made || '(no version)');\n\tif (check.error) {\n\t\tthrow new Error(by + ', which this player (' + VERSION + ') does not play (it plays runtime content generated by ' + RUNTIME_CONTENT_RANGE + '). '\n\t\t\t+ (check.newer ? 'Update the player.' : 'Generate the runtime content again with pixi-animate-runtime ' + VERSION + '.'));\n\t}\n\tif (check.warning) {\n\t\tconsole.warn(by + ', newer than this player (' + VERSION + '). What the newer version added may not play; update the player.');\n\t}\n}\n\nexport type TMovieClipClass = new (mode?: string | null, startPosition?: number | null, loop?: boolean | number | null) => MovieClip;\nexport type TSpriteClass = new () => Sprite;\nexport type TBitmapClass = new () => Bitmap;\nexport type TSymbolClass = TMovieClipClass | TSpriteClass | TBitmapClass;\n\n/**\n * The symbol classes of a content by symbol id: what published code calls `lib`.\n */\nexport interface ILibrary {\n\t[id: string]: TSymbolClass;\n}\n\n/**\n * The createjs-compatible names frame scripts reach as `cjs` / `createjs`.\n */\nexport const namespace = {\n\tDisplayObject, Container, MovieClip, Shape, Graphics, Sprite, SpriteSheet, Bitmap, Text,\n\tColorFilter, ButtonHelper, Event, EventDispatcher, Rectangle, Point: PIXI.Point\n};\n\nexport type TNamespace = typeof namespace;\n\n/** What frame scripts get for the template's global playSound: nothing is played */\nexport interface ISilentSound {\n\tpaused: boolean;\n\tvolume: number;\n\taddEventListener(): void;\n\tremoveEventListener(): void;\n\ton(): void;\n\tstop(): void;\n\tplay(): void;\n}\n\nfunction playSound(): ISilentSound {\n\treturn {\n\t\tpaused: false, volume: 1,\n\t\taddEventListener() { /* silent */ }, removeEventListener() { /* silent */ },\n\t\ton() { /* silent */ }, stop() { /* silent */ }, play() { /* silent */ }\n\t};\n}\n\nexport interface IGeneratedContent {\n\tdata: IRuntimeData;\n\tscripts: TScript[];\n\twriters: TWriter[];\n\tmemberWriters: TMemberWriter[];\n}\n\n/**\n * What runtime content exports: given the names frame scripts refer\n * to, it returns the content's data and its frame scripts (as code, closed\n * over those names). exportRoot and stage are passed as undefined: they are\n * the template's root and stage, which a player of any symbol does not have.\n */\nexport type TContentFactory = (cjs: TNamespace, createjs: TNamespace, lib: ILibrary, exportRoot: undefined, stage: undefined, playSound: () => ISilentSound) => IGeneratedContent;\n\nexport interface IContentAssets {\n\t/** Textures of the manifest images (sprite sheet atlases included), by manifest id */\n\timages?: { [id: string]: PIXI.Texture };\n}\n\nfunction isMovieClipClass(content: Content, id: string, value: TSymbolClass): value is TMovieClipClass {\n\tconst def = content.data.symbols[id];\n\treturn !!def && def.kind === 'movieclip';\n}\n\nfunction isSpriteClass(content: Content, id: string, value: TSymbolClass): value is TSpriteClass {\n\tconst def = content.data.symbols[id];\n\treturn !!def && def.kind === 'sprite';\n}\n\nfunction isBitmapClass(content: Content, id: string, value: TSymbolClass): value is TBitmapClass {\n\tconst def = content.data.symbols[id];\n\treturn !!def && def.kind === 'bitmap';\n}\n\nfunction toRect(rect: IRectDef | null): Rectangle | null {\n\treturn rect ? new Rectangle(rect.x, rect.y, rect.width, rect.height) : null;\n}\n\nfunction toRects(rects: IRectDef[] | null): Rectangle[] | null {\n\treturn rects ? rects.map(rect => new Rectangle(rect.x, rect.y, rect.width, rect.height)) : null;\n}\n\nfunction numbers(value: TDataValue): number[] {\n\treturn Array.isArray(value) ? value.map(v => (typeof v === 'number' ? v : 0)) : [0, 0, 0, 0];\n}\n\n/**\n * The template's AdobeAn.handleFilterCache: re-caches the instances a clip's\n * filterCacheList names while the clip is within their frame ranges.\n */\nfunction handleFilterCache(event: Event): void {\n\tif (event.paused) {\n\t\treturn;\n\t}\n\tconst target = event.target;\n\tif (!(target instanceof MovieClip) || !target.filterCacheList) {\n\t\treturn;\n\t}\n\ttarget.filterCacheList.forEach(entry => {\n\t\tif (entry.startFrame <= target.currentFrame && target.currentFrame <= entry.endFrame) {\n\t\t\tentry.instance.cache(entry.x, entry.y, entry.w, entry.h);\n\t\t}\n\t});\n}\n\n/** A value of the published lib.properties (width, height, fps, color, ...) */\nexport type TContentProperty = number | string | boolean | null;\n\nexport interface IContentProperties {\n\t[key: string]: TContentProperty;\n}\n\n/**\n * A loaded content, as the application uses it.\n */\nexport interface IContent {\n\t/** The composition id (lib.properties.id of the published content) */\n\treadonly id: string;\n\t/** The symbol classes by symbol name: what frame scripts reach as `lib` */\n\treadonly lib: ILibrary;\n\t/** The values of the published lib.properties (its lists, such as the manifest, left out) */\n\treadonly properties: Readonly<IContentProperties>;\n\t/**\n\t * An instance of a symbol for the application to place, set up as the HTML\n\t * template sets up the root it creates.\n\t */\n\tcreate(id: string): DisplayObject;\n}\n\n/** A MovieClip symbol as the player builds its instances from: its slots with every field */\ninterface IMovieClipPlan extends Omit<IRuntimeMovieClipDef, 'slots' | 'tweens'> {\n\tslots: IRuntimeSlotDef[];\n\ttweens: IRuntimeTweenDef[];\n}\n\n/**\n * A content: the symbol classes built from generated data, sharing one\n * definition per symbol. Not part of the API: applications get an IContent.\n * @internal\n */\nexport class Content implements ITextureSource {\n\treadonly data: IRuntimeData;\n\treadonly scripts: TScript[];\n\treadonly writers: TWriter[];\n\treadonly memberWriters: TMemberWriter[];\n\treadonly lib: ILibrary = {};\n\treadonly images: { [id: string]: IImageAsset } = {};\n\t/** One Graphics per drawing of the content, shared by every symbol that shows it */\n\treadonly graphics: Graphics[] = [];\n\treadonly spriteSheets: { [name: string]: SpriteSheet } = {};\n\tprivate readonly _frameAssets: { [key: string]: IImageAsset } = {};\n\n\tconstructor(factory: TContentFactory, assets?: IContentAssets) {\n\t\tconst generated = factory(namespace, namespace, this.lib, undefined, undefined, playSound);\n\t\tcheckRuntimeContent(generated.data);\n\t\tthis.data = generated.data;\n\t\tthis.scripts = generated.scripts;\n\t\tthis.writers = generated.writers;\n\t\tthis.memberWriters = generated.memberWriters;\n\n\t\tthis.data.graphics.forEach(def => {\n\t\t\tthis.graphics.push(new Graphics(commandsOf(this.data.commandKinds, def), this));\n\t\t});\n\n\t\tthis._applyImages(assets && assets.images ? assets.images : {});\n\n\t\tObject.keys(this.data.symbols).forEach(id => {\n\t\t\tconst def = this.data.symbols[id];\n\t\t\tif (def.kind === 'movieclip') {\n\t\t\t\tthis.lib[id] = this._movieClipClass(def);\n\t\t\t} else if (def.kind === 'sprite') {\n\t\t\t\tthis.lib[id] = this._spriteClass(def);\n\t\t\t} else if (def.kind === 'bitmap') {\n\t\t\t\tthis.lib[id] = this._bitmapClass(def);\n\t\t\t}\n\t\t});\n\t}\n\n\t/**\n\t * Sets the textures of the content's images (by manifest id) and the sprite\n\t * sheets cut from them. Done before any instance is made: the constructor's\n\t * assets, or the textures a loader read for the content afterwards.\n\t */\n\t_applyImages(textures: { [id: string]: PIXI.Texture }): void {\n\t\tthis.data.images.forEach(entry => {\n\t\t\tconst texture = textures[entry.id];\n\t\t\tthis.images[entry.id] = { src: entry.src, texture: texture || PIXI.Texture.EMPTY };\n\t\t});\n\t\tthis.data.spriteSheets.forEach(sheet => {\n\t\t\tconst image = this.images[sheet.name] || { src: sheet.name, texture: PIXI.Texture.EMPTY };\n\t\t\tthis.spriteSheets[sheet.name] = new SpriteSheet(image, sheet.frames.map(numbers));\n\t\t});\n\t}\n\n\timage(id: string): PIXI.Texture | null {\n\t\tconst image = this.images[id];\n\t\treturn image ? image.texture : null;\n\t}\n\n\tframe(sheet: string, index: number): PIXI.Texture | null {\n\t\tconst spriteSheet = this.spriteSheets[sheet];\n\t\treturn spriteSheet ? spriteSheet.textures[index] || null : null;\n\t}\n\n\timageAsset(id: string): IImageAsset | null {\n\t\treturn this.images[id] || null;\n\t}\n\n\t/** The image a frame of a sheet is drawn into for a bitmap fill (named after the atlas and the frame) */\n\tframeAsset(sheet: string, index: number): IImageAsset | null {\n\t\tconst key = sheet + '#' + index;\n\t\tlet asset = this._frameAssets[key];\n\t\tif (!asset) {\n\t\t\tconst spriteSheet = this.spriteSheets[sheet];\n\t\t\tconst texture = spriteSheet ? spriteSheet.textures[index] : undefined;\n\t\t\tif (!spriteSheet || !texture) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tasset = this._frameAssets[key] = { src: spriteSheet.frames[index].image.src + '#' + index, texture };\n\t\t}\n\t\treturn asset;\n\t}\n\n\t/**\n\t * An instance of a symbol for the application to place, set up as the HTML\n\t * template sets up the root it creates: a clip that re-caches its children's\n\t * color effects (it has a filterCacheList) gets the filter cache handling,\n\t * which published code otherwise gets from the symbol that creates it (an\n\t * instance made by `new lib[id]()` in a frame script gets none, as in\n\t * CreateJS). The handling does not change what the player draws (it draws\n\t * color effects without caches); it keeps the instance's state the\n\t * template's.\n\t */\n\tcreate(id: string): DisplayObject {\n\t\tconst symbolClass = this.lib[id];\n\t\tif (!symbolClass) {\n\t\t\tthrow new Error('no symbol \"' + id + '\"');\n\t\t}\n\t\tconst instance = new symbolClass();\n\t\tif (instance instanceof MovieClip && instance.filterCacheList) {\n\t\t\tinstance.addEventListener('tick', handleFilterCache);\n\t\t}\n\t\treturn instance;\n\t}\n\n\tprivate _movieClipClass(data: IRuntimeMovieClipDef): TMovieClipClass {\n\t\tconst content = this;\n\t\t// The slots filled in, and the display lists turned back into entries, once for the symbol, not for every instance\n\t\tconst templates = this.data.slotTemplates;\n\t\tconst def: IMovieClipPlan = Object.assign({}, data, { slots: data.slots.map(ref => slotOf(templates, ref)), tweens: data.tweens.map(tweenOf) });\n\t\t// The symbol's drawings, from the content's table (shared with every symbol that shows the same drawing)\n\t\tconst graphics = def.graphics.map(index => content.graphics[index]);\n\t\tconst fps = typeof this.data.properties.fps === 'number' ? this.data.properties.fps : null;\n\t\tconst nominalBounds = toRect(def.nominalBounds);\n\t\tconst frameBounds = toRects(def.frameBounds);\n\n\t\treturn class extends MovieClip {\n\t\t\tconstructor(mode?: string | null, startPosition?: number | null, loop?: boolean | number | null) {\n\t\t\t\t// Constructed with no arguments (a root, or new lib.X()): the resolved defaults\n\t\t\t\tconst defaults = def.defaults;\n\t\t\t\tconst noArgs = mode === undefined && startPosition === undefined && loop === undefined;\n\t\t\t\tsuper(\n\t\t\t\t\tnoArgs && defaults ? defaults.mode : mode,\n\t\t\t\t\tnoArgs && defaults ? defaults.startPosition : startPosition,\n\t\t\t\t\tnoArgs && defaults ? defaults.loop : loop,\n\t\t\t\t\tnew Timeline(def.duration, def.labels)\n\t\t\t\t);\n\t\t\t\tthis.contentFps = fps;\n\t\t\t\tif (nominalBounds) {\n\t\t\t\t\tthis.nominalBounds = nominalBounds;\n\t\t\t\t}\n\t\t\t\tif (frameBounds) {\n\t\t\t\t\tthis.frameBounds = frameBounds;\n\t\t\t\t}\n\t\t\t\tcontent._populate(this, def, graphics);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _spriteClass(def: ISpriteSymbolDef): TSpriteClass {\n\t\tconst content = this;\n\t\tconst nominalBounds = toRect(def.nominalBounds);\n\t\tconst frameBounds = toRects(def.frameBounds);\n\t\treturn class extends Sprite {\n\t\t\tconstructor() {\n\t\t\t\tsuper(content._sheet(def.sprite.sheet));\n\t\t\t\tif (nominalBounds) {\n\t\t\t\t\tthis.nominalBounds = nominalBounds;\n\t\t\t\t}\n\t\t\t\tif (frameBounds) {\n\t\t\t\t\tthis.frameBounds = frameBounds;\n\t\t\t\t}\n\t\t\t\tcontent._applySprite(this, def.sprite);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _bitmapClass(def: IBitmapSymbolDef): TBitmapClass {\n\t\tconst content = this;\n\t\tconst nominalBounds = toRect(def.nominalBounds);\n\t\tconst frameBounds = toRects(def.frameBounds);\n\t\treturn class extends Bitmap {\n\t\t\tconstructor() {\n\t\t\t\tsuper(content._image(def.bitmap.image));\n\t\t\t\tif (nominalBounds) {\n\t\t\t\t\tthis.nominalBounds = nominalBounds;\n\t\t\t\t}\n\t\t\t\tif (frameBounds) {\n\t\t\t\t\tthis.frameBounds = frameBounds;\n\t\t\t\t}\n\t\t\t\tcontent._applyBitmap(this, def.bitmap);\n\t\t\t}\n\t\t};\n\t}\n\n\tprivate _sheet(name: string): SpriteSheet {\n\t\tconst sheet = this.spriteSheets[name];\n\t\tif (!sheet) {\n\t\t\tthrow new Error('no sprite sheet \"' + name + '\"');\n\t\t}\n\t\treturn sheet;\n\t}\n\n\tprivate _image(id: string): IImageAsset | null {\n\t\treturn this.images[id] || null;\n\t}\n\n\t_applySprite(sprite: Sprite, def: ISpriteDef | null): void {\n\t\tif (!def) {\n\t\t\treturn;\n\t\t}\n\t\tsprite.spriteSheet = this._sheet(def.sheet);\n\t\tif (def.paused) {\n\t\t\tsprite.gotoAndStop(def.frame);\n\t\t} else {\n\t\t\tsprite.gotoAndPlay(def.frame);\n\t\t}\n\t}\n\n\t_applyBitmap(bitmap: Bitmap, def: IBitmapDef | null): void {\n\t\tif (!def) {\n\t\t\treturn;\n\t\t}\n\t\tbitmap.image = this._image(def.image);\n\t\tbitmap.sourceRect = toRect(def.sourceRect);\n\t}\n\n\tprivate _createSlot(slot: IRuntimeSlotDef, graphics: Graphics[]): DisplayObject {\n\t\tconst symbol = slot.symbol;\n\t\tconst symbolClass = symbol ? this.lib[symbol] : undefined;\n\n\t\tif (slot.kind === 'movieclip') {\n\t\t\tif (!symbol || !symbolClass || !isMovieClipClass(this, symbol, symbolClass)) {\n\t\t\t\tthrow new Error('missing MovieClip symbol ' + symbol);\n\t\t\t}\n\t\t\treturn new symbolClass(slot.mode, slot.startPosition, slot.loop);\n\t\t}\n\n\t\tif (slot.kind === 'shape') {\n\t\t\treturn new Shape(slot.graphics === null ? null : graphics[slot.graphics]);\n\t\t}\n\n\t\tif (slot.kind === 'sprite') {\n\t\t\tlet sprite: Sprite;\n\t\t\tif (symbol && symbolClass && isSpriteClass(this, symbol, symbolClass)) {\n\t\t\t\tsprite = new symbolClass();\n\t\t\t} else {\n\t\t\t\tsprite = new Sprite(this._sheet(slot.sprite ? slot.sprite.sheet : ''));\n\t\t\t}\n\t\t\tthis._applySprite(sprite, slot.sprite);\n\t\t\treturn sprite;\n\t\t}\n\n\t\tif (slot.kind === 'bitmap') {\n\t\t\tlet bitmap: Bitmap;\n\t\t\tif (symbol && symbolClass && isBitmapClass(this, symbol, symbolClass)) {\n\t\t\t\tbitmap = new symbolClass();\n\t\t\t} else {\n\t\t\t\tbitmap = new Bitmap(null);\n\t\t\t}\n\t\t\tthis._applyBitmap(bitmap, slot.bitmap);\n\t\t\treturn bitmap;\n\t\t}\n\n\t\tif (slot.kind === 'text') {\n\t\t\tconst props = slot.text || {};\n\t\t\tconst text = new Text(String(props.text == null ? '' : props.text), typeof props.font === 'string' ? props.font : undefined, typeof props.color === 'string' ? props.color : undefined);\n\t\t\tObject.keys(props).forEach(key => {\n\t\t\t\tReflect.set(text, key, props[key]);\n\t\t\t});\n\t\t\treturn text;\n\t\t}\n\n\t\tthrow new Error('unsupported display object in the content data');\n\t}\n\n\t/**\n\t * Builds an instance of a MovieClip symbol: what the published\n\t * constructor builds, from the shared definition.\n\t */\n\t_populate(self: MovieClip, def: IMovieClipPlan, graphics: Graphics[]): void {\n\t\tconst slots = def.slots.map(slot => {\n\t\t\tconst obj = this._createSlot(slot, graphics);\n\t\t\tif (slot.initWriter !== null) {\n\t\t\t\tthis.writers[slot.initWriter](obj, slot.initValues === null ? undefined : slot.initValues);\n\t\t\t}\n\t\t\tif (slot.parentSet) {\n\t\t\t\tobj.parent = self;\n\t\t\t}\n\t\t\tif (slot.filters) {\n\t\t\t\tobj.filters = slot.filters.map(filter => {\n\t\t\t\t\tconst p = filter.props;\n\t\t\t\t\tconst n = (key: string): number => { const v = p[key]; return typeof v === 'number' ? v : 0; };\n\t\t\t\t\treturn new ColorFilter(n('redMultiplier'), n('greenMultiplier'), n('blueMultiplier'), n('alphaMultiplier'),\n\t\t\t\t\t\tn('redOffset'), n('greenOffset'), n('blueOffset'), n('alphaOffset'));\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (slot.cache) {\n\t\t\t\tconst c = slot.cache;\n\t\t\t\tobj.cache(c.x, c.y, c.width, c.height, c.scale);\n\t\t\t}\n\t\t\treturn obj;\n\t\t});\n\n\t\tconst resolve = (target: TTargetDef): object => {\n\t\t\tif (target.type === 'self') {\n\t\t\t\treturn self;\n\t\t\t}\n\t\t\tif (target.type === 'slot') {\n\t\t\t\treturn slots[target.slot];\n\t\t\t}\n\t\t\tif (target.type === 'filter') {\n\t\t\t\tconst filters = slots[target.slot].filters;\n\t\t\t\treturn filters ? filters[target.filter] : {};\n\t\t\t}\n\t\t\treturn {};\n\t\t};\n\n\t\tdef.slots.forEach((slot, i) => {\n\t\t\tconst obj = slots[i];\n\t\t\tif (slot.mask !== null) {\n\t\t\t\tobj.mask = slots[slot.mask];\n\t\t\t}\n\t\t\tif (slot.button) {\n\t\t\t\tconst b = slot.button;\n\t\t\t\tconst hit = b.hit === null ? null : slots[b.hit];\n\t\t\t\tif (obj instanceof MovieClip) {\n\t\t\t\t\tnew ButtonHelper(obj, b.out, b.over, b.down, b.play, hit instanceof MovieClip ? hit : null, b.hitFrame);\n\t\t\t\t}\n\t\t\t\tif (hit && !(hit instanceof MovieClip)) {\n\t\t\t\t\tobj.hitArea = hit;\n\t\t\t\t}\n\t\t\t} else if (slot.hitArea !== null) {\n\t\t\t\tobj.hitArea = slots[slot.hitArea];\n\t\t\t}\n\t\t\tif (slot.filterCacheListener) {\n\t\t\t\tobj.addEventListener('tick', handleFilterCache);\n\t\t\t}\n\t\t});\n\n\t\tif (def.filterCacheList) {\n\t\t\tself.filterCacheList = def.filterCacheList.map(entry => {\n\t\t\t\tconst instance = resolve(entry.instance);\n\t\t\t\treturn {\n\t\t\t\t\tinstance: instance instanceof DisplayObject ? instance : self,\n\t\t\t\t\tstartFrame: entry.startFrame, endFrame: entry.endFrame,\n\t\t\t\t\tx: entry.x, y: entry.y, w: entry.w, h: entry.h\n\t\t\t\t};\n\t\t\t});\n\t\t}\n\n\t\tif (def.memberWriter !== null) {\n\t\t\tthis.memberWriters[def.memberWriter](self, slots);\n\t\t}\n\t\tdef.unmanaged.forEach(index => {\n\t\t\tself.addChild(slots[index]);\n\t\t});\n\n\t\tconst content = this;\n\t\tconst scope: ITweenScope = {\n\t\t\tstateTarget(entry: IStateEntryDef): DisplayObject | null {\n\t\t\t\tconst target = resolve(entry.target);\n\t\t\t\treturn target instanceof DisplayObject ? target : null;\n\t\t\t},\n\t\t\tvalue(value: TFrameValue): TWrittenValue {\n\t\t\t\tif (value !== null && typeof value === 'object' && !Array.isArray(value)) {\n\t\t\t\t\treturn graphics[value.graphics] || null;\n\t\t\t\t}\n\t\t\t\treturn value;\n\t\t\t},\n\t\t\tscript(index: number): TScript {\n\t\t\t\treturn content.scripts[index];\n\t\t\t},\n\t\t\twriter(index: number): TWriter {\n\t\t\t\treturn content.writers[index];\n\t\t\t}\n\t\t};\n\n\t\tdef.tweens.forEach(tween => {\n\t\t\tself.timeline.tweens.push(new TweenState(tween, resolve(tween.target), scope, self));\n\t\t});\n\n\t\tself._renderFirstFrame();\n\t}\n}\n\n/**\n * What the application gets of a content: the content itself stays out of\n * reach, the methods closing over it.\n */\nexport function contentInterface(content: Content): IContent {\n\tconst properties: IContentProperties = {};\n\tObject.keys(content.data.properties).forEach(key => {\n\t\tconst value = content.data.properties[key];\n\t\tif (value === null || typeof value === 'number' || typeof value === 'string' || typeof value === 'boolean') {\n\t\t\tproperties[key] = value;\n\t\t}\n\t});\n\tconst id = properties.id;\n\treturn {\n\t\tid: typeof id === 'string' ? id : '',\n\t\tlib: content.lib,\n\t\tproperties: Object.freeze(properties),\n\t\tcreate(symbol: string): DisplayObject {\n\t\t\treturn content.create(symbol);\n\t\t}\n\t};\n}\n\n/**\n * Plays one frame of a display tree the way createjs does on a stage update:\n * the tick phase (playheads advance, children in reverse order, tick\n * listeners), then the resolve phase (each MovieClip settles its timeline,\n * children in reverse order).\n */\nexport function tick(root: DisplayObject, event?: Event): void {\n\troot._tick(event || new Event('tick'));\n\tresolveState(root);\n}\n\n/**\n * The resolve phase alone: each MovieClip settles its timeline (children in\n * reverse order), without playing a frame.\n */\nexport function resolveState(node: DisplayObject): void {\n\tnode._pendingResolve = false;\n\tif (node instanceof MovieClip) {\n\t\tnode._updateState();\n\t}\n\tif (node instanceof Container) {\n\t\tconst children = node.children;\n\t\tfor (let i = children.length - 1; i >= 0; i--) {\n\t\t\tif (children[i] instanceof MovieClip) {\n\t\t\t\tresolveState(children[i]);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Settles a display tree for drawing without playing it on, as a createjs\n * stage draw shows it (MovieClip.draw settles each clip): the synched and\n * single frame clips are placed at the frame their parent gives, and a clip\n * waiting to start over (an independent clip reset when its parent placed it\n * again) is shown at its first frame the way a new clip is (no frame script,\n * its playhead left to start on the next frame, as in the template, where\n * createjs draws only after a frame). Children after their parent, in reverse\n * order as the resolve phase.\n */\nexport function settleForDrawing(node: DisplayObject): void {\n\tif (node instanceof MovieClip) {\n\t\tif (node.mode !== INDEPENDENT) {\n\t\t\tnode._updateState();\n\t\t} else if (node._rawPosition === -1) {\n\t\t\tnode._renderFirstFrame();\n\t\t}\n\t}\n\tif (node instanceof Container) {\n\t\tconst children = node.children.slice();\n\t\tfor (let i = children.length - 1; i >= 0; i--) {\n\t\t\tif (children[i] instanceof MovieClip) {\n\t\t\t\tsettleForDrawing(children[i]);\n\t\t\t}\n\t\t}\n\t}\n}\n","import * as PIXI from 'pixi.js';\nimport { DisplayObject } from './display';\nimport { MovieClip } from './movieclip';\nimport { tick, resolveState, settleForDrawing } from './content';\n\n/** The frame rate a root plays at when its content does not give one */\nconst DEFAULT_FPS = 60;\n/** How many of the latest deltas the usual delta of the display is the median of */\nconst DELTA_SAMPLES = 30;\n/** The share of its distance from the real time the steady clock moves by on each call */\nconst PULL = 0.05;\n\ninterface ITarget {\n\troot: MovieClip;\n\t/** Frames owed by the real time (the deltas as given) */\n\tt: number;\n\t/** Frames owed by the steady clock (the usual delta on every call), kept within a frame of t */\n\tclock: number;\n\tisFirst: boolean;\n}\n\n/**\n * Plays the content roots put on a Pixi container at their content's frame\n * rate (the rate the content was published with). AnimateContainer is a Pixi\n * container with one; a container of another framework can hold one too.\n *\n * Each handleTick call owes every root `delta x speed x fps / 60` frames\n * (delta being the ticker's: 1 per frame of a 60 fps display) and plays the\n * whole frames owed. With `smooth`, the frames played follow a steady clock\n * instead of the deltas themselves: it advances by the usual delta of the\n * display (the median of the latest ones) on every call, so that small changes\n * of the delta do not play a frame early or late (0 frames on one call and 2\n * on the next), and it is pulled toward the real time a little on every call,\n * and set to it when they are a frame apart (a frame of the display was\n * missed), so that the content keeps the real time. One frame is createjs's\n * tick phase followed by its resolve phase. The first call after a root is put\n * on only settles it on its first frame.\n */\nexport class AnimateController {\n\t/** Playback speed (1 is the content's own frame rate, 0 stops; a value below 0 is taken as 0) */\n\tspeed = 1;\n\t/** Whether one call may play more than one frame (when the display runs slower than the content) */\n\toverSpeed = true;\n\t/** Whether frames are played by a steady clock, so that small changes of the delta do not make the playing uneven */\n\tsmooth = true;\n\tprivate readonly _container: PIXI.Container;\n\tprivate _targets: { [id: number]: ITarget } = {};\n\tprivate _nextId = 0;\n\t/** The latest deltas (a ring of DELTA_SAMPLES) */\n\tprivate _deltas: number[] = [];\n\tprivate _nextDelta = 0;\n\n\t/** @param container The container the roots are put on */\n\tconstructor(container: PIXI.Container) {\n\t\tthis._container = container;\n\t\t// Pixi updates the transforms of the tree before every draw: the roots a goto changed outside\n\t\t// the playing are settled then, as a createjs draw settles them (frames played meanwhile settle them first)\n\t\tconst updateTransform = container.updateTransform;\n\t\tconst controller = this;\n\t\tcontainer.updateTransform = function (this: PIXI.Container): void {\n\t\t\tcontroller._settleForDrawing();\n\t\t\tupdateTransform.call(this);\n\t\t};\n\t}\n\n\t/** Settles the roots marked by a goto since they were last resolved */\n\tprivate _settleForDrawing(): void {\n\t\tconst targets = this._targets;\n\t\tObject.keys(targets).forEach(key => {\n\t\t\tconst target = targets[Number(key)];\n\t\t\tif (target && target.root._pendingResolve) {\n\t\t\t\ttarget.root._pendingResolve = false;\n\t\t\t\tsettleForDrawing(target.root);\n\t\t\t}\n\t\t});\n\t}\n\n\thandleTick(delta: number): void {\n\t\t// A speed below 0 plays as 0 does (nothing is played backward): the frames owed stay where they\n\t\t// were, and the playing goes on from there once the speed is above 0 again\n\t\tconst speed = Math.max(this.speed, 0);\n\t\tconst d = delta * speed;\n\t\tconst usual = this._usualDelta(delta) * speed;\n\t\tconst targets = this._targets;\n\n\t\tObject.keys(targets).forEach(key => {\n\t\t\tconst target = targets[Number(key)];\n\t\t\tif (!target) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst fps = target.root.contentFps != null ? target.root.contentFps : DEFAULT_FPS;\n\t\t\ttarget.t += d * fps / 60;\n\n\t\t\t// The steady clock follows the real time half a step ahead, so that it sits\n\t\t\t// midway between whole frames, not on one (where the pull alone would move it across)\n\t\t\tconst step = usual * fps / 60;\n\t\t\tconst lead = Math.min(step, 1) / 2;\n\n\t\t\tif (target.isFirst) {\n\t\t\t\ttarget.isFirst = false;\n\t\t\t\ttarget.clock = target.t + lead;\n\t\t\t\tresolveState(target.root);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.smooth) {\n\t\t\t\ttarget.clock += step;\n\t\t\t\tconst behind = target.t + lead - target.clock;\n\t\t\t\tif (behind >= 1 || behind <= -1) {\n\t\t\t\t\ttarget.clock = target.t + lead;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.clock += behind * PULL;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttarget.clock = target.t;\n\t\t\t}\n\n\t\t\tconst whole = Math.max(Math.floor(target.clock), 0);\n\t\t\tconst frames = this.overSpeed ? whole : Math.min(whole, 1);\n\t\t\ttarget.t -= whole;\n\t\t\ttarget.clock -= whole;\n\t\t\tfor (let f = 0; f < frames; f++) {\n\t\t\t\ttick(target.root);\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Records a delta and gives the median of the latest ones */\n\tprivate _usualDelta(delta: number): number {\n\t\tconst deltas = this._deltas;\n\t\tdeltas[this._nextDelta] = delta;\n\t\tthis._nextDelta = (this._nextDelta + 1) % DELTA_SAMPLES;\n\t\tconst sorted = deltas.slice().sort((a, b) => a - b);\n\t\tconst middle = sorted.length >> 1;\n\t\treturn sorted.length % 2 ? sorted[middle] : (sorted[middle - 1] + sorted[middle]) / 2;\n\t}\n\n\t/** Puts a content object on the container; a MovieClip plays from then on */\n\taddCreatejs<T extends DisplayObject>(obj: T): T {\n\t\tthis._register(obj);\n\t\tthis._container.addChild(obj.pixi);\n\t\treturn obj;\n\t}\n\n\taddCreatejsAt<T extends DisplayObject>(obj: T, index: number): T {\n\t\tthis._register(obj);\n\t\tthis._container.addChildAt(obj.pixi, index);\n\t\treturn obj;\n\t}\n\n\tremoveCreatejs<T extends DisplayObject>(obj: T): T {\n\t\tthis._container.removeChild(obj.pixi);\n\t\treturn obj;\n\t}\n\n\t/**\n\t * A MovieClip is played while its node is on the container. Coming from\n\t * another parent, it starts over from its first frame.\n\t */\n\tprivate _register(obj: DisplayObject): void {\n\t\tif (!(obj instanceof MovieClip)) {\n\t\t\treturn;\n\t\t}\n\t\tconst node = obj.pixi;\n\t\tconst previous = node.parent;\n\t\tnode.once('added', () => {\n\t\t\tif (node.parent !== previous) {\n\t\t\t\tobj.gotoAndPlay(0);\n\t\t\t}\n\t\t\tconst id = this._nextId++;\n\t\t\tthis._targets[id] = { root: obj, t: 0, clock: 0, isFirst: true };\n\t\t\tnode.once('removed', () => {\n\t\t\t\tdelete this._targets[id];\n\t\t\t});\n\t\t});\n\t}\n}\n\n/**\n * A Pixi container that plays the content roots put on it at their\n * content's frame rate (see AnimateController).\n *\n * Call handleTick from the application's ticker:\n * `app.ticker.add(container.handleTick, container)`.\n */\nexport class AnimateContainer extends PIXI.Container {\n\tprivate readonly _controller: AnimateController = new AnimateController(this);\n\n\t/** Playback speed (1 is the content's own frame rate, 0 stops; a value below 0 is taken as 0) */\n\tget speed(): number { return this._controller.speed; }\n\tset speed(value: number) { this._controller.speed = value; }\n\n\t/** Whether one call may play more than one frame (when the display runs slower than the content) */\n\tget overSpeed(): boolean { return this._controller.overSpeed; }\n\tset overSpeed(value: boolean) { this._controller.overSpeed = value; }\n\n\t/** Whether frames are played by a steady clock, so that small changes of the delta do not make the playing uneven */\n\tget smooth(): boolean { return this._controller.smooth; }\n\tset smooth(value: boolean) { this._controller.smooth = value; }\n\n\thandleTick(delta: number): void {\n\t\tthis._controller.handleTick(delta);\n\t}\n\n\t/** Puts a content object on this container; a MovieClip plays from then on */\n\taddCreatejs<T extends DisplayObject>(obj: T): T {\n\t\treturn this._controller.addCreatejs(obj);\n\t}\n\n\taddCreatejsAt<T extends DisplayObject>(obj: T, index: number): T {\n\t\treturn this._controller.addCreatejsAt(obj, index);\n\t}\n\n\tremoveCreatejs<T extends DisplayObject>(obj: T): T {\n\t\treturn this._controller.removeCreatejs(obj);\n\t}\n}\n","import * as PIXI from 'pixi.js';\nimport { Content, IContent, TContentFactory, contentInterface } from './content';\n\n/**\n * The global runtime content files register their factories in, by\n * composition id: `window.PixiAnimateRuntimeContents[id] = factory`. It is not\n * under the player's namespace, so that a runtime content file can be loaded\n * before the player, and the same file serves every player package.\n */\nexport const CONTENTS_GLOBAL = 'PixiAnimateRuntimeContents';\n\n/** What to load a content from: its composition id, and the directory its images are relative to */\nexport interface IContentTarget {\n\t/** The content's composition id (lib.properties.id of the published content) */\n\tid: string;\n\t/** The directory the content's image paths are relative to (usually where its runtime content file is) */\n\tbasepath: string;\n\toptions?: {\n\t\t/** Whether images are requested with CORS (anonymous). true when omitted */\n\t\tcrossOrigin?: boolean;\n\t\t/**\n\t\t * Called with the content's images before they are loaded (a copy for this\n\t\t * load): changing an entry's src changes what is loaded, such as a data: or\n\t\t * blob: URL in place of the file\n\t\t */\n\t\thandleManifest?: (manifest: IContentManifestEntry[]) => Promise<void> | void;\n\t};\n}\n\n/** An image of a content: its manifest id and its path (relative to the base path, as published) */\nexport interface IContentManifestEntry {\n\tid: string;\n\tsrc: string;\n}\n\nexport interface ILoadContentOptions {\n\t/** Added to every image URL as the query `_fv=<version>` (the query an image path already has stays) */\n\tversion?: string | number;\n}\n\n/** An image of a content to load: its manifest id and its URL */\ninterface IContentImageRequest {\n\tid: string;\n\turl: string;\n}\n\n/** The factories registered so far (none when no runtime content file was loaded) */\nfunction registeredContents(): object | null {\n\tconst contents = Reflect.get(window, CONTENTS_GLOBAL);\n\treturn contents !== null && typeof contents === 'object' ? contents : null;\n}\n\nfunction describeRegistered(contents: object | null): string {\n\tif (!contents || !Object.keys(contents).length) {\n\t\treturn 'none is loaded';\n\t}\n\treturn 'loaded: ' + Object.keys(contents).map(id => {\n\t\tconst source = Reflect.get(Reflect.get(contents, id), 'source');\n\t\treturn JSON.stringify(id) + (typeof source === 'string' ? ' (' + source + ')' : '');\n\t}).join(', ');\n}\n\n/**\n * The factory a runtime content file registered under a composition id. The\n * file has to be loaded first (a script tag, or any other way).\n */\nexport function getContentFactory(id: string): TContentFactory {\n\tconst contents = registeredContents();\n\tconst found = contents ? Reflect.get(contents, id) : undefined;\n\tconst factory: TContentFactory | null = typeof found === 'function' ? found : null;\n\tif (!factory) {\n\t\tthrow new Error('No runtime content ' + JSON.stringify(id) + ' (' + describeRegistered(contents) + '). Load its runtime content file before loading the content.');\n\t}\n\treturn factory;\n}\n\n/**\n * A query added to a URL, keeping the queries it has (one of the same name is\n * replaced). The same as Pixim.js's utils.resolveQuery, so that both players\n * request the same URL.\n */\nfunction withQuery(url: string, name: string, value: string): string {\n\tconst parts = url.split('?');\n\tconst kept = parts[1] ? parts[1].split('&').filter(query => query.split('=')[0] !== name) : [];\n\tkept.push(name + '=' + value);\n\treturn parts[0] + '?' + kept.join('&');\n}\n\n/**\n * The URL of a content's image: its path resolved against the base path, with\n * the version added as `_fv=<version>` (the query the path already has, such as\n * the one Animate adds on every publish, stays). data: and blob: URLs are used\n * as they are. The same as Pixim.js's utils.resolveUri.\n */\nexport function resolveContentUrl(basepath: string, src: string, version?: string | number | null): string {\n\tif (src.indexOf('data:') === 0 || src.indexOf('blob:') === 0) {\n\t\treturn src;\n\t}\n\tconst url = PIXI.utils.url.resolve(basepath, src);\n\treturn version === undefined || version === null || version === '' ? url : withQuery(url, '_fv', String(version));\n}\n\n/** The images a content loads, with their URLs */\nfunction imageRequests(manifest: IContentManifestEntry[], basepath: string, version?: string | number | null): IContentImageRequest[] {\n\treturn manifest.map(entry => ({ id: entry.id, url: resolveContentUrl(basepath, entry.src, version) }));\n}\n\nfunction loadContent(target: IContentTarget, options: ILoadContentOptions): Promise<IContent> {\n\treturn Promise.resolve().then(() => {\n\t\tconst content = new Content(getContentFactory(target.id));\n\t\tconst manifest = content.data.images.map(entry => ({ id: entry.id, src: entry.src }));\n\t\tconst handleManifest = target.options && target.options.handleManifest;\n\t\treturn Promise.resolve(handleManifest ? handleManifest(manifest) : undefined).then(() => loadImages(target, content, imageRequests(manifest, target.basepath, options.version)));\n\t});\n}\n\nfunction loadImages(target: IContentTarget, content: Content, requests: IContentImageRequest[]): Promise<IContent> {\n\treturn new Promise<IContent>((resolve, reject) => {\n\t\tif (!requests.length) {\n\t\t\tresolve(contentInterface(content));\n\t\t\treturn;\n\t\t}\n\t\tconst crossOrigin = !target.options || target.options.crossOrigin !== false;\n\t\tconst loader = new PIXI.Loader();\n\t\trequests.forEach(request => {\n\t\t\t// Loaded as images whatever the URL looks like (a blob: URL has no extension to tell)\n\t\t\tloader.add({ name: request.id, url: request.url, crossOrigin: crossOrigin ? 'anonymous' : undefined, loadType: PIXI.LoaderResource.LOAD_TYPE.IMAGE });\n\t\t});\n\t\tconst failed: string[] = [];\n\t\tloader.onError.add((error: Error, _loader: PIXI.Loader, resource: PIXI.LoaderResource) => {\n\t\t\tfailed.push(resource.url);\n\t\t});\n\t\tloader.load((_loader: PIXI.Loader, resources: Partial<Record<string, PIXI.LoaderResource>>) => {\n\t\t\tif (failed.length) {\n\t\t\t\treject(new Error('Could not load the images of runtime content ' + JSON.stringify(target.id) + ': ' + failed.join(', ')));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst textures: { [id: string]: PIXI.Texture } = {};\n\t\t\trequests.forEach(request => {\n\t\t\t\tconst resource = resources[request.id];\n\t\t\t\tif (resource && resource.texture) {\n\t\t\t\t\ttextures[request.id] = resource.texture;\n\t\t\t\t}\n\t\t\t});\n\t\t\tcontent._applyImages(textures);\n\t\t\tresolve(contentInterface(content));\n\t\t});\n\t});\n}\n\n/**\n * Loads contents: the factory each runtime content file registered under the\n * target's composition id (the file has to be loaded already), the content's\n * images from the target's base path, and the content built with them.\n */\nexport function loadContentAsync(target: IContentTarget, options?: ILoadContentOptions): Promise<IContent>;\nexport function loadContentAsync(targets: IContentTarget[], options?: ILoadContentOptions): Promise<IContent[]>;\nexport function loadContentAsync(targets: IContentTarget | IContentTarget[], options?: ILoadContentOptions): Promise<IContent | IContent[]> {\n\tconst opts = options || {};\n\tif (Array.isArray(targets)) {\n\t\treturn Promise.all(targets.map(target => loadContent(target, opts)));\n\t}\n\treturn loadContent(targets, opts);\n}\n"],"names":["this","prototypeAccessors","let","const","i","super","prototypeAccessors$1","texture","value"],"mappings":";;;;;;;;;AAAA;;;AAGG;IAeU,KAAK,GAgBjB,SAAA,KAAA,CAAY,IAAY,EAAE,OAAiB,EAAE,UAAoB,EAAA;IAdjE,IAAA,CAAA,MAAM,GAA2B,IAAI;IACrC,IAAA,CAA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