diff --git a/samples/_output/events.js b/samples/_output/events.js index c9f3f26d..c91fe68e 100644 --- a/samples/_output/events.js +++ b/samples/_output/events.js @@ -115,10 +115,12 @@ samples_events_Main.prototype = $extend(pixi_plugins_app_Application.prototype,{ this._img.anchor.set(0.5,0.5); this._img.position.set(400,300); this._img.interactive = true; - this._img.on("click",$bind(this,this._onEvent)); + this._img.scale.set(3); this._img.on("mouseover",$bind(this,this._onEvent)); - this._img.on("mousedown",$bind(this,this._onEvent)); this._img.on("touchstart",$bind(this,this._onEvent)); + this._img.tap = $bind(this,this._onEvent); + this._img.click = $bind(this,this._onEvent); + this._img.hitArea = new PIXI.Rectangle(0,0,10,10); this._stage.addChild(this._img); var style = { }; style.fill = "#000000"; diff --git a/samples/_output/events.js.map b/samples/_output/events.js.map index 02a45257..c79039df 100644 --- a/samples/_output/events.js.map +++ b/samples/_output/events.js.map @@ -3,7 +3,7 @@ "file":"events.js", "sourceRoot":"file:///", "sources":["/haxe/pixi-haxe/pixi/plugins/app/Application.hx","/haxe/pixi-haxe/samples/events/Main.hx"], -"sourcesContent":["package pixi.plugins.app;\n\nimport js.html.Element;\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.SystemRenderer;\nimport pixi.plugins.stats.Stats;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio(null, default):Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(null, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width(null, default):Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height(null, default):Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent(null, default):Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias(null, default):Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster)\n\t * default - false\n\t */\n\tpublic var forceFXAA(null, default):Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize(null, default):Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor(null, default):Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tvar _stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _canvas:CanvasElement;\n\tvar _renderer:SystemRenderer;\n\tvar _stats:Stats;\n\tvar _lastTime:Date;\n\tvar _currentTime:Date;\n\tvar _elapsedTime:Float;\n\n\tvar _frameCount:Int;\n\n\tpublic function new() {\n\t\t_lastTime = Date.now();\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tfunction _setDefaultValues() {\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [renderer] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\tpublic function start(?renderer:String = AUTO, ?stats:Bool = true, ?parentDom:Element) {\n\t\t_canvas = Browser.document.createCanvasElement();\n\t\t_canvas.style.width = width + \"px\";\n\t\t_canvas.style.height = height + \"px\";\n\t\t_canvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(_canvas);\n\t\telse parentDom.appendChild(_canvas);\n\n\t\t_stage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = _canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\n\t\tif (renderer == AUTO) _renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (renderer == CANVAS) _renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse _renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tBrowser.document.body.appendChild(_renderer.view);\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tBrowser.window.requestAnimationFrame(cast _onRequestAnimationFrame);\n\t\t_lastTime = Date.now();\n\n\t\tif (stats) _addStats();\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\t_renderer.resize(width, height);\n\t\t_canvas.style.width = width + \"px\";\n\t\t_canvas.style.height = height + \"px\";\n\n\t\tif (_stats != null) {\n\t\t\t_stats.domElement.style.top = \"2px\";\n\t\t\t_stats.domElement.style.right = \"2px\";\n\t\t}\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame() {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\t_calculateElapsedTime();\n\t\t\tif (onUpdate != null) onUpdate(_elapsedTime);\n\t\t\t_renderer.render(_stage);\n\t\t}\n\t\tBrowser.window.requestAnimationFrame(cast _onRequestAnimationFrame);\n\t\tif (_stats != null) _stats.update();\n\t}\n\n\t@:noCompletion function _calculateElapsedTime() {\n\t\t_currentTime = Date.now();\n\t\t_elapsedTime = _currentTime.getTime() - _lastTime.getTime();\n\t\t_lastTime = _currentTime;\n\t}\n\n\t@:noCompletion function _addStats() {\n\t\tif (untyped __js__(\"window\").Stats != null) {\n\t\t\tvar _container = Browser.document.createElement(\"div\");\n\t\t\tBrowser.document.body.appendChild(_container);\n\t\t\t_stats = new Stats();\n\t\t\t_stats.domElement.style.position = \"absolute\";\n\t\t\t_stats.domElement.style.top = \"2px\";\n\t\t\t_stats.domElement.style.right = \"2px\";\n\t\t\t_container.appendChild(_stats.domElement);\n\t\t\t_stats.begin();\n\t\t}\n\t}\n}","package samples.events;\n\nimport pixi.interaction.EventTarget;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\n\nclass Main extends Application {\n\n\tvar _img:Sprite;\n\tvar _label:Text;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start();\n\n\t\t_img = new Sprite(Texture.fromImage(\"assets/basics/bunny.png\"));\n\t\t_img.anchor.set(0.5, 0.5);\n\t\t_img.position.set(400, 300);\n\t\t_img.interactive = true;\n\t\t_img.on(\"click\", _onEvent);\n\t\t_img.on(\"mouseover\", _onEvent);\n\t\t_img.on(\"mousedown\", _onEvent);\n\t\t_img.on(\"touchstart\", _onEvent);\n\t\t_stage.addChild(_img);\n\n\t\tvar style:TextStyle = {};\n\t\tstyle.fill = \"#000000\";\n\t\tstyle.font = \"12px Courier\";\n\n\t\t_label = new Text(\"EVENTS\", style);\n\t\t_label.position.set(0, 0);\n\t\t_stage.addChild(_label);\n\t}\n\n\tfunction _onEvent(target:EventTarget) {\n\t\t_label.text = target.type;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], +"sourcesContent":["package pixi.plugins.app;\n\nimport js.html.Element;\nimport pixi.core.renderers.webgl.WebGLRenderer;\nimport pixi.core.renderers.canvas.CanvasRenderer;\nimport pixi.core.renderers.SystemRenderer;\nimport pixi.plugins.stats.Stats;\nimport pixi.core.renderers.Detector;\nimport pixi.core.display.Container;\nimport js.html.Event;\nimport js.html.CanvasElement;\nimport js.Browser;\n\n/**\n * Pixi Boilerplate Helper class that can be used by any application\n * @author Adi Reddy Mora\n * http://adireddy.github.io\n * @license MIT\n * @copyright 2015\n */\nclass Application {\n\n\t/**\n * Sets the pixel ratio of the application.\n * default - 1\n */\n\tpublic var pixelRatio(null, default):Float;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to true to get 30 FPS.\n\t * default - false\n\t */\n\tpublic var skipFrame(null, set):Bool;\n\n\t/**\n\t * Default frame rate is 60 FPS and this can be set to anything between 1 - 60.\n\t * default - 60\n\t */\n\tpublic var fps(default, set):Int;\n\n\t/**\n\t * Width of the application.\n\t * default - Browser.window.innerWidth\n\t */\n\tpublic var width(null, default):Float;\n\n\t/**\n\t * Height of the application.\n\t * default - Browser.window.innerHeight\n\t */\n\tpublic var height(null, default):Float;\n\n\t/**\n\t * Renderer transparency property.\n\t * default - false\n\t */\n\tpublic var transparent(null, default):Bool;\n\n\t/**\n\t * Graphics antialias property.\n\t * default - false\n\t */\n\tpublic var antialias(null, default):Bool;\n\n\t/**\n\t * Force FXAA shader antialias instead of native (faster)\n\t * default - false\n\t */\n\tpublic var forceFXAA(null, default):Bool;\n\n\t/**\n\t * Whether you want to resize the canvas and renderer on browser resize.\n\t * Should be set to false when custom width and height are used for the application.\n\t * default - true\n\t */\n\tpublic var autoResize(null, default):Bool;\n\n\t/**\n\t * Sets the background color of the stage.\n\t * default - 0xFFFFFF\n\t */\n\tpublic var backgroundColor(null, default):Int;\n\n\t/**\n\t * Update listener \tfunction\n\t */\n\tpublic var onUpdate:Float -> Void;\n\n\t/**\n\t * Window resize listener \tfunction\n\t */\n\tpublic var onResize:Void -> Void;\n\n\t/**\n\t * Global Container.\n\t * Read-only\n\t */\n\tvar _stage(default, null):Container;\n\n\tpublic static inline var AUTO:String = \"auto\";\n\tpublic static inline var RECOMMENDED:String = \"recommended\";\n\tpublic static inline var CANVAS:String = \"canvas\";\n\tpublic static inline var WEBGL:String = \"webgl\";\n\n\tvar _canvas:CanvasElement;\n\tvar _renderer:SystemRenderer;\n\tvar _stats:Stats;\n\tvar _lastTime:Date;\n\tvar _currentTime:Date;\n\tvar _elapsedTime:Float;\n\n\tvar _frameCount:Int;\n\n\tpublic function new() {\n\t\t_lastTime = Date.now();\n\t\t_setDefaultValues();\n\t}\n\n\tfunction set_fps(val:Int):Int {\n\t\t_frameCount = 0;\n\t\treturn fps = (val >= 1 && val < 60) ? Std.int(val) : 60;\n\t}\n\n\tfunction set_skipFrame(val:Bool):Bool {\n\t\tif (val) {\n\t\t\ttrace(\"pixi.plugins.app.Application > Deprecated: skipFrame - use fps property and set it to 30 instead\");\n\t\t\tfps = 30;\n\t\t}\n\t\treturn skipFrame = val;\n\t}\n\n\tfunction _setDefaultValues() {\n\t\tpixelRatio = 1;\n\t\tskipFrame = false;\n\t\tautoResize = true;\n\t\ttransparent = false;\n\t\tantialias = false;\n\t\tforceFXAA = false;\n\t\tbackgroundColor = 0xFFFFFF;\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\tfps = 60;\n\t}\n\n\t/**\n\t * Starts pixi application setup using the properties set or default values\n\t * @param [renderer] - Renderer type to use AUTO (default) | CANVAS | WEBGL\n\t * @param [stats] - Enable/disable stats for the application.\n\t * Note that stats.js is not part of pixi so don't forget to include it you html page\n\t * Can be found in libs folder. \"libs/stats.min.js\" \n\t * @param [parentDom] - By default canvas will be appended to body or it can be appended to custom element if passed\n\t */\n\tpublic function start(?renderer:String = AUTO, ?stats:Bool = true, ?parentDom:Element) {\n\t\t_canvas = Browser.document.createCanvasElement();\n\t\t_canvas.style.width = width + \"px\";\n\t\t_canvas.style.height = height + \"px\";\n\t\t_canvas.style.position = \"absolute\";\n\t\tif (parentDom == null) Browser.document.body.appendChild(_canvas);\n\t\telse parentDom.appendChild(_canvas);\n\n\t\t_stage = new Container();\n\n\t\tvar renderingOptions:RenderingOptions = {};\n\t\trenderingOptions.view = _canvas;\n\t\trenderingOptions.backgroundColor = backgroundColor;\n\t\trenderingOptions.resolution = pixelRatio;\n\t\trenderingOptions.antialias = antialias;\n\t\trenderingOptions.forceFXAA = forceFXAA;\n\t\trenderingOptions.autoResize = autoResize;\n\t\trenderingOptions.transparent = transparent;\n\n\t\tif (renderer == AUTO) _renderer = Detector.autoDetectRenderer(width, height, renderingOptions);\n\t\telse if (renderer == CANVAS) _renderer = new CanvasRenderer(width, height, renderingOptions);\n\t\telse _renderer = new WebGLRenderer(width, height, renderingOptions);\n\n\t\tBrowser.document.body.appendChild(_renderer.view);\n\t\tif (autoResize) Browser.window.onresize = _onWindowResize;\n\t\tBrowser.window.requestAnimationFrame(cast _onRequestAnimationFrame);\n\t\t_lastTime = Date.now();\n\n\t\tif (stats) _addStats();\n\t}\n\n\t@:noCompletion function _onWindowResize(event:Event) {\n\t\twidth = Browser.window.innerWidth;\n\t\theight = Browser.window.innerHeight;\n\t\t_renderer.resize(width, height);\n\t\t_canvas.style.width = width + \"px\";\n\t\t_canvas.style.height = height + \"px\";\n\n\t\tif (_stats != null) {\n\t\t\t_stats.domElement.style.top = \"2px\";\n\t\t\t_stats.domElement.style.right = \"2px\";\n\t\t}\n\n\t\tif (onResize != null) onResize();\n\t}\n\n\t@:noCompletion function _onRequestAnimationFrame() {\n\t\t_frameCount++;\n\t\tif (_frameCount == Std.int(60 / fps)) {\n\t\t\t_frameCount = 0;\n\t\t\t_calculateElapsedTime();\n\t\t\tif (onUpdate != null) onUpdate(_elapsedTime);\n\t\t\t_renderer.render(_stage);\n\t\t}\n\t\tBrowser.window.requestAnimationFrame(cast _onRequestAnimationFrame);\n\t\tif (_stats != null) _stats.update();\n\t}\n\n\t@:noCompletion function _calculateElapsedTime() {\n\t\t_currentTime = Date.now();\n\t\t_elapsedTime = _currentTime.getTime() - _lastTime.getTime();\n\t\t_lastTime = _currentTime;\n\t}\n\n\t@:noCompletion function _addStats() {\n\t\tif (untyped __js__(\"window\").Stats != null) {\n\t\t\tvar _container = Browser.document.createElement(\"div\");\n\t\t\tBrowser.document.body.appendChild(_container);\n\t\t\t_stats = new Stats();\n\t\t\t_stats.domElement.style.position = \"absolute\";\n\t\t\t_stats.domElement.style.top = \"2px\";\n\t\t\t_stats.domElement.style.right = \"2px\";\n\t\t\t_container.appendChild(_stats.domElement);\n\t\t\t_stats.begin();\n\t\t}\n\t}\n}","package samples.events;\n\nimport pixi.core.math.shapes.Rectangle;\nimport pixi.interaction.EventTarget;\nimport pixi.core.text.Text;\nimport pixi.plugins.app.Application;\nimport pixi.core.textures.Texture;\nimport pixi.core.sprites.Sprite;\n\nclass Main extends Application {\n\n\tvar _img:Sprite;\n\tvar _label:Text;\n\n\tpublic function new() {\n\t\tsuper();\n\t\t_init();\n\t}\n\n\tfunction _init() {\n\t\tbackgroundColor = 0xFFFFFF;\n\t\tsuper.start();\n\n\t\t_img = new Sprite(Texture.fromImage(\"assets/basics/bunny.png\"));\n\t\t_img.anchor.set(0.5, 0.5);\n\t\t_img.position.set(400, 300);\n\t\t_img.interactive = true;\n\t\t_img.scale.set(3);\n\t\t_img.on(\"mouseover\", _onEvent);\n\t\t_img.on(\"touchstart\", _onEvent);\n\t\t_img.tap = _onEvent;\n\t\t_img.click = _onEvent;\n\n\t\t_img.hitArea = new Rectangle(0, 0, 10, 10);\n\t\t_stage.addChild(_img);\n\n\t\tvar style:TextStyle = {};\n\t\tstyle.fill = \"#000000\";\n\t\tstyle.font = \"12px Courier\";\n\n\t\t_label = new Text(\"EVENTS\", style);\n\t\t_label.position.set(0, 0);\n\t\t_stage.addChild(_label);\n\t}\n\n\tfunction _onEvent(target:EventTarget) {\n\t\t_label.text = target.type;\n\t}\n\n\tstatic function main() {\n\t\tnew Main();\n\t}\n}"], "names":[], -"mappings":";;;;;;;+BAiHO,pBAAe;CACrB,EAAY;CACZ;;;SAGD,KAA8B;EAC7B,CAAc;EACd,KAAa,AAAC,HAAO,AAAK,DAAM,FAAzB,EAA+B,AAAQ,AAAR,FAA/B,EAA8C;;eAGtD,DAAsC;EACrC,AAAI,DAAK;GACR,SAAM;GACN,FAAM;;EAEP,KAAO,JAAY;;mBAGpB,RAA6B;EAC5B,CAAa;EACb,DAAY;EACZ,CAAa;EACb,CAAc;EACd,CAAY;EACZ,CAAY;EACZ,CAAkB;EAClB,CAAQ;EACR,CAAS;EACT,DAAM;;OAWA;;;EACI;EAAV,CAAU;EACV,CAAsB,AAAQ;EAC9B,CAAuB,AAAS;EAChC,CAAyB;EACzB,AAAI,EAAa,HAAM,AAAkC,KACpD,LAAsB;EAE3B,CAAS;EAE+B;EACxC,CAAwB;EACxB,CAAmC;EACnC,CAA8B;EAC9B,CAA6B;EAC7B,CAA6B;EAC7B,CAA8B;EAC9B,CAA+B;EAE/B,AAAI,EAAY,HAAM,EAAY,FAA4B,AAAO,AAAQ,KACxE,JAAI,EAAY,HAAQ,EAAY,iBAAmB,nBAAO,AAAQ,KACtE,HAAY,gBAAkB,lBAAO,AAAQ;EAElD,DAAkC;EAClC,AAAI,DAAY,EAA0B;EAC1C,DAAqC,AAAK;EAC1C,CAAY;EAEZ,AAAI,DAAO;;iBAGG,DAAsC;EACpD,CAAQ;EACR,CAAS;EACT,DAAiB,AAAO;EACxB,CAAsB,AAAQ;EAC9B,CAAuB,AAAS;EAEhC,AAAI,EAAU,HAAM;GACnB,AAA8B;GAC9B,AAAgC;;EAGjC,AAAI,EAAY,HAAM;;0BAGR,fAAoC;EAClD;EACA,AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd;GACA,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAiB;;EAElB,DAAqC,AAAK;EAC1C,AAAI,EAAU,HAAM;;uBAGN,ZAAiC;EAC/C,CAAe;EACf,CAAe,AAAyB;EACxC,CAAY;;WAGE,AACd;EAAY,EAA0B,HAAM;GAC1B,FAA+B;GAChD,FAAkC;GAClC,AAAS;GACT,AAAmC;GACnC,AAA8B;GAC9B,AAAgC;GAChC,FAAuB;GACvB;;;;sBCpNK,XAAe;CACrB;CACA;;2BA8BM,hBACN;;;;;OA5BD,IAAiB;EAChB,CAAkB;EAClB;EAEA,CAAO,SAAW,XAAkB;EACpC,DAAgB,AAAK;EACrB,DAAkB,AAAK;EACvB,CAAmB;EACnB,DAAQ,AAAS;EACjB,DAAQ,AAAa;EACrB,DAAQ,AAAa;EACrB,DAAQ,AAAc;EACtB,DAAgB;EAEM;EACtB,CAAa;EACb,CAAa;EAEb,CAAS,OAAS,TAAU;EAC5B,DAAoB,AAAG;EACvB,DAAgB;;UAGjB,OACC;GAAc;;;;;;;;" +"mappings":";;;;;;;+BAiHO,pBAAe;CACrB,EAAY;CACZ;;;SAGD,KAA8B;EAC7B,CAAc;EACd,KAAa,AAAC,HAAO,AAAK,DAAM,FAAzB,EAA+B,AAAQ,AAAR,FAA/B,EAA8C;;eAGtD,DAAsC;EACrC,AAAI,DAAK;GACR,SAAM;GACN,FAAM;;EAEP,KAAO,JAAY;;mBAGpB,RAA6B;EAC5B,CAAa;EACb,DAAY;EACZ,CAAa;EACb,CAAc;EACd,CAAY;EACZ,CAAY;EACZ,CAAkB;EAClB,CAAQ;EACR,CAAS;EACT,DAAM;;OAWA;;;EACI;EAAV,CAAU;EACV,CAAsB,AAAQ;EAC9B,CAAuB,AAAS;EAChC,CAAyB;EACzB,AAAI,EAAa,HAAM,AAAkC,KACpD,LAAsB;EAE3B,CAAS;EAE+B;EACxC,CAAwB;EACxB,CAAmC;EACnC,CAA8B;EAC9B,CAA6B;EAC7B,CAA6B;EAC7B,CAA8B;EAC9B,CAA+B;EAE/B,AAAI,EAAY,HAAM,EAAY,FAA4B,AAAO,AAAQ,KACxE,JAAI,EAAY,HAAQ,EAAY,iBAAmB,nBAAO,AAAQ,KACtE,HAAY,gBAAkB,lBAAO,AAAQ;EAElD,DAAkC;EAClC,AAAI,DAAY,EAA0B;EAC1C,DAAqC,AAAK;EAC1C,CAAY;EAEZ,AAAI,DAAO;;iBAGG,DAAsC;EACpD,CAAQ;EACR,CAAS;EACT,DAAiB,AAAO;EACxB,CAAsB,AAAQ;EAC9B,CAAuB,AAAS;EAEhC,AAAI,EAAU,HAAM;GACnB,AAA8B;GAC9B,AAAgC;;EAGjC,AAAI,EAAY,HAAM;;0BAGR,fAAoC;EAClD;EACA,AAAI,EAAe,HAAQ,EAAK,AAAb,FAAmB;GACrC,AAAc;GACd;GACA,DAAI,EAAY,HAAM,AAAS;GAC/B,FAAiB;;EAElB,DAAqC,AAAK;EAC1C,AAAI,EAAU,HAAM;;uBAGN,ZAAiC;EAC/C,CAAe;EACf,CAAe,AAAyB;EACxC,CAAY;;WAGE,AACd;EAAY,EAA0B,HAAM;GAC1B,FAA+B;GAChD,FAAkC;GAClC,AAAS;GACT,AAAmC;GACnC,AAA8B;GAC9B,AAAgC;GAChC,FAAuB;GACvB;;;;sBCnNK,XAAe;CACrB;CACA;;2BAiCM,hBACN;;;;;OA/BD,IAAiB;EAChB,CAAkB;EAClB;EAEA,CAAO,SAAW,XAAkB;EACpC,DAAgB,AAAK;EACrB,DAAkB,AAAK;EACvB,CAAmB;EACnB,DAAe;EACf,DAAQ,AAAa;EACrB,DAAQ,AAAc;EACtB,CAAW;EACX,CAAa;EAEb,CAAe,YAAc,dAAG,AAAG,AAAI;EACvC,DAAgB;EAEM;EACtB,CAAa;EACb,CAAa;EAEb,CAAS,OAAS,TAAU;EAC5B,DAAoB,AAAG;EACvB,DAAgB;;UAGjB,OACC;GAAc;;;;;;;;" } \ No newline at end of file diff --git a/samples/_output/libs/pixi.min.js b/samples/_output/libs/pixi.min.js index b3617bef..aa43a8db 100644 --- a/samples/_output/libs/pixi.min.js +++ b/samples/_output/libs/pixi.min.js @@ -1,6 +1,8 @@ -!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.PIXI=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function d(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d=-1&&!e;f--){var g=f>=0?arguments[f]:a.cwd();if("string"!=typeof g)throw new TypeError("Arguments to path.resolve must be strings");g&&(c=g+"/"+c,e="/"===g.charAt(0))}return c=b(d(c.split("/"),function(a){return!!a}),!e).join("/"),(e?"/":"")+c||"."},c.normalize=function(a){var e=c.isAbsolute(a),f="/"===g(a,-1);return a=b(d(a.split("/"),function(a){return!!a}),!e).join("/"),a||e||(a="."),a&&f&&(a+="/"),(e?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(d(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;g>i;i++)if(e[i]!==f[i]){h=i;break}for(var j=[],i=h;ib&&(b=a.length+b),a.substr(b,c)}}).call(this,a("_process"))},{_process:2}],2:[function(a,b,c){function d(){if(!h){h=!0;for(var a,b=g.length;b;){a=g,g=[];for(var c=-1;++ce;)b=a.charCodeAt(e++),b>=55296&&56319>=b&&f>e?(c=a.charCodeAt(e++),56320==(64512&c)?d.push(((1023&b)<<10)+(1023&c)+65536):(d.push(b),e--)):d.push(b);return d}function j(a){return g(a,function(a){var b="";return a>65535&&(a-=65536,b+=L(a>>>10&1023|55296),a=56320|1023&a),b+=L(a)}).join("")}function k(a){return 10>a-48?a-22:26>a-65?a-65:26>a-97?a-97:x}function l(a,b){return a+22+75*(26>a)-((0!=b)<<5)}function m(a,b,c){var d=0;for(a=c?K(a/B):a>>1,a+=K(a/b);a>J*z>>1;d+=x)a=K(a/J);return K(d+(J+1)*a/(a+A))}function n(a){var b,c,d,e,g,h,i,l,n,o,p=[],q=a.length,r=0,s=D,t=C;for(c=a.lastIndexOf(E),0>c&&(c=0),d=0;c>d;++d)a.charCodeAt(d)>=128&&f("not-basic"),p.push(a.charCodeAt(d));for(e=c>0?c+1:0;q>e;){for(g=r,h=1,i=x;e>=q&&f("invalid-input"),l=k(a.charCodeAt(e++)),(l>=x||l>K((w-r)/h))&&f("overflow"),r+=l*h,n=t>=i?y:i>=t+z?z:i-t,!(n>l);i+=x)o=x-n,h>K(w/o)&&f("overflow"),h*=o;b=p.length+1,t=m(r-g,b,0==g),K(r/b)>w-s&&f("overflow"),s+=K(r/b),r%=b,p.splice(r++,0,s)}return j(p)}function o(a){var b,c,d,e,g,h,j,k,n,o,p,q,r,s,t,u=[];for(a=i(a),q=a.length,b=D,c=0,g=C,h=0;q>h;++h)p=a[h],128>p&&u.push(L(p));for(d=e=u.length,e&&u.push(E);q>d;){for(j=w,h=0;q>h;++h)p=a[h],p>=b&&j>p&&(j=p);for(r=d+1,j-b>K((w-c)/r)&&f("overflow"),c+=(j-b)*r,b=j,h=0;q>h;++h)if(p=a[h],b>p&&++c>w&&f("overflow"),p==b){for(k=c,n=x;o=g>=n?y:n>=g+z?z:n-g,!(o>k);n+=x)t=k-o,s=x-o,u.push(L(l(o+t%s,0))),k=K(t/s);u.push(L(l(k,0))),g=m(c,r,d==e),c=0,++d}++c,++b}return u.join("")}function p(a){return h(a,function(a){return F.test(a)?n(a.slice(4).toLowerCase()):a})}function q(a){return h(a,function(a){return G.test(a)?"xn--"+o(a):a})}var r="object"==typeof d&&d,s="object"==typeof c&&c&&c.exports==r&&c,t="object"==typeof b&&b;(t.global===t||t.window===t)&&(e=t);var u,v,w=2147483647,x=36,y=1,z=26,A=38,B=700,C=72,D=128,E="-",F=/^xn--/,G=/[^ -~]/,H=/\x2E|\u3002|\uFF0E|\uFF61/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},J=x-y,K=Math.floor,L=String.fromCharCode;if(u={version:"1.2.4",ucs2:{decode:i,encode:j},decode:n,encode:o,toASCII:q,toUnicode:p},"function"==typeof a&&"object"==typeof a.amd&&a.amd)a("punycode",function(){return u});else if(r&&!r.nodeType)if(s)s.exports=u;else for(v in u)u.hasOwnProperty(v)&&(r[v]=u[v]);else e.punycode=u}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(a,b,c){"use strict";function d(a,b){return Object.prototype.hasOwnProperty.call(a,b)}b.exports=function(a,b,c,f){b=b||"&",c=c||"=";var g={};if("string"!=typeof a||0===a.length)return g;var h=/\+/g;a=a.split(b);var i=1e3;f&&"number"==typeof f.maxKeys&&(i=f.maxKeys);var j=a.length;i>0&&j>i&&(j=i);for(var k=0;j>k;++k){var l,m,n,o,p=a[k].replace(h,"%20"),q=p.indexOf(c);q>=0?(l=p.substr(0,q),m=p.substr(q+1)):(l=p,m=""),n=decodeURIComponent(l),o=decodeURIComponent(m),d(g,n)?e(g[n])?g[n].push(o):g[n]=[g[n],o]:g[n]=o}return g};var e=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}},{}],5:[function(a,b,c){"use strict";function d(a,b){if(a.map)return a.map(b);for(var c=[],d=0;d",'"',"`"," ","\r","\n"," "],q=["{","}","|","\\","^","`"].concat(p),r=["'"].concat(q),s=["%","/","?",";","#"].concat(r),t=["/","?","#"],u=255,v=/^[a-z0-9A-Z_-]{0,63}$/,w=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},z={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=a("querystring");d.prototype.parse=function(a,b,c){if(!i(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var d=a;d=d.trim();var e=n.exec(d);if(e){e=e[0];var f=e.toLowerCase();this.protocol=f,d=d.substr(e.length)}if(c||e||d.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===d.substr(0,2);!g||e&&y[e]||(d=d.substr(2),this.slashes=!0)}if(!y[e]&&(g||e&&!z[e])){for(var h=-1,j=0;jk)&&(h=k)}var l,o;o=-1===h?d.lastIndexOf("@"):d.lastIndexOf("@",h),-1!==o&&(l=d.slice(0,o),d=d.slice(o+1),this.auth=decodeURIComponent(l)),h=-1;for(var j=0;jk)&&(h=k)}-1===h&&(h=d.length),this.host=d.slice(0,h),d=d.slice(h),this.parseHost(),this.hostname=this.hostname||"";var p="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!p)for(var q=this.hostname.split(/\./),j=0,B=q.length;B>j;j++){var C=q[j];if(C&&!C.match(v)){for(var D="",E=0,F=C.length;F>E;E++)D+=C.charCodeAt(E)>127?"x":C[E];if(!D.match(v)){var G=q.slice(0,j),H=q.slice(j+1),I=C.match(w);I&&(G.push(I[1]),H.unshift(I[2])),H.length&&(d="/"+H.join(".")+d),this.hostname=G.join(".");break}}}if(this.hostname=this.hostname.length>u?"":this.hostname.toLowerCase(),!p){for(var J=this.hostname.split("."),K=[],j=0;jj;j++){var O=r[j],P=encodeURIComponent(O);P===O&&(P=escape(O)),d=d.split(O).join(P)}var Q=d.indexOf("#");-1!==Q&&(this.hash=d.substr(Q),d=d.slice(0,Q));var R=d.indexOf("?");if(-1!==R?(this.search=d.substr(R),this.query=d.substr(R+1),b&&(this.query=A.parse(this.query)),d=d.slice(0,R)):b&&(this.search="",this.query={}),d&&(this.pathname=d),z[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var M=this.pathname||"",L=this.search||"";this.path=M+L}return this.href=this.format(),this},d.prototype.format=function(){var a=this.auth||"";a&&(a=encodeURIComponent(a),a=a.replace(/%3A/i,":"),a+="@");var b=this.protocol||"",c=this.pathname||"",d=this.hash||"",e=!1,f="";this.host?e=a+this.host:this.hostname&&(e=a+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(e+=":"+this.port)),this.query&&j(this.query)&&Object.keys(this.query).length&&(f=A.stringify(this.query));var g=this.search||f&&"?"+f||"";return b&&":"!==b.substr(-1)&&(b+=":"),this.slashes||(!b||z[b])&&e!==!1?(e="//"+(e||""),c&&"/"!==c.charAt(0)&&(c="/"+c)):e||(e=""),d&&"#"!==d.charAt(0)&&(d="#"+d),g&&"?"!==g.charAt(0)&&(g="?"+g),c=c.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),g=g.replace("#","%23"),b+e+c+g+d},d.prototype.resolve=function(a){return this.resolveObject(e(a,!1,!0)).format()},d.prototype.resolveObject=function(a){if(i(a)){var b=new d;b.parse(a,!1,!0),a=b}var c=new d;if(Object.keys(this).forEach(function(a){c[a]=this[a]},this),c.hash=a.hash,""===a.href)return c.href=c.format(),c;if(a.slashes&&!a.protocol)return Object.keys(a).forEach(function(b){"protocol"!==b&&(c[b]=a[b])}),z[c.protocol]&&c.hostname&&!c.pathname&&(c.path=c.pathname="/"),c.href=c.format(),c;if(a.protocol&&a.protocol!==c.protocol){if(!z[a.protocol])return Object.keys(a).forEach(function(b){c[b]=a[b]}),c.href=c.format(),c;if(c.protocol=a.protocol,a.host||y[a.protocol])c.pathname=a.pathname;else{for(var e=(a.pathname||"").split("/");e.length&&!(a.host=e.shift()););a.host||(a.host=""),a.hostname||(a.hostname=""),""!==e[0]&&e.unshift(""),e.length<2&&e.unshift(""),c.pathname=e.join("/")}if(c.search=a.search,c.query=a.query,c.host=a.host||"",c.auth=a.auth,c.hostname=a.hostname||a.host,c.port=a.port,c.pathname||c.search){var f=c.pathname||"",g=c.search||"";c.path=f+g}return c.slashes=c.slashes||a.slashes,c.href=c.format(),c}var h=c.pathname&&"/"===c.pathname.charAt(0),j=a.host||a.pathname&&"/"===a.pathname.charAt(0),m=j||h||c.host&&a.pathname,n=m,o=c.pathname&&c.pathname.split("/")||[],e=a.pathname&&a.pathname.split("/")||[],p=c.protocol&&!z[c.protocol];if(p&&(c.hostname="",c.port=null,c.host&&(""===o[0]?o[0]=c.host:o.unshift(c.host)),c.host="",a.protocol&&(a.hostname=null,a.port=null,a.host&&(""===e[0]?e[0]=a.host:e.unshift(a.host)),a.host=null),m=m&&(""===e[0]||""===o[0])),j)c.host=a.host||""===a.host?a.host:c.host,c.hostname=a.hostname||""===a.hostname?a.hostname:c.hostname,c.search=a.search,c.query=a.query,o=e;else if(e.length)o||(o=[]),o.pop(),o=o.concat(e),c.search=a.search,c.query=a.query;else if(!l(a.search)){if(p){c.hostname=c.host=o.shift();var q=c.host&&c.host.indexOf("@")>0?c.host.split("@"):!1;q&&(c.auth=q.shift(),c.host=c.hostname=q.shift())}return c.search=a.search,c.query=a.query,k(c.pathname)&&k(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.href=c.format(),c}if(!o.length)return c.pathname=null,c.path=c.search?"/"+c.search:null,c.href=c.format(),c;for(var r=o.slice(-1)[0],s=(c.host||a.host)&&("."===r||".."===r)||""===r,t=0,u=o.length;u>=0;u--)r=o[u],"."==r?o.splice(u,1):".."===r?(o.splice(u,1),t++):t&&(o.splice(u,1),t--);if(!m&&!n)for(;t--;t)o.unshift("..");!m||""===o[0]||o[0]&&"/"===o[0].charAt(0)||o.unshift(""),s&&"/"!==o.join("/").substr(-1)&&o.push("");var v=""===o[0]||o[0]&&"/"===o[0].charAt(0);if(p){c.hostname=c.host=v?"":o.length?o.shift():"";var q=c.host&&c.host.indexOf("@")>0?c.host.split("@"):!1;q&&(c.auth=q.shift(),c.host=c.hostname=q.shift())}return m=m||c.host&&o.length,m&&!v&&o.unshift(""),o.length?c.pathname=o.join("/"):(c.pathname=null,c.path=null),k(c.pathname)&&k(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.auth=a.auth||c.auth,c.slashes=c.slashes||a.slashes,c.href=c.format(),c},d.prototype.parseHost=function(){var a=this.host,b=o.exec(a);b&&(b=b[0],":"!==b&&(this.port=b.substr(1)),a=a.substr(0,a.length-b.length)),a&&(this.hostname=a)}},{punycode:3,querystring:6}],8:[function(b,c,d){(function(b){!function(){function d(a){var b=!1;return function(){if(b)throw new Error("Callback was already called.");b=!0,a.apply(e,arguments)}}var e,f,g={};e=this,null!=e&&(f=e.async),g.noConflict=function(){return e.async=f,g};var h=Object.prototype.toString,i=Array.isArray||function(a){return"[object Array]"===h.call(a)},j=function(a,b){for(var c=0;c=a.length&&c())}if(c=c||function(){},!a.length)return c();var f=0;j(a,function(a){b(a,d(e))})},g.forEach=g.each,g.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},g.forEachSeries=g.eachSeries,g.eachLimit=function(a,b,c,d){var e=n(b);e.apply(null,[a,c,d])},g.forEachLimit=g.eachLimit;var n=function(a){return function(b,c,d){if(d=d||function(){},!b.length||0>=a)return d();var e=0,f=0,g=0;!function h(){if(e>=b.length)return d();for(;a>g&&f=b.length?d():h())})}()}},o=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[g.each].concat(b))}},p=function(a,b){return function(){var c=Array.prototype.slice.call(arguments);return b.apply(null,[n(a)].concat(c))}},q=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[g.eachSeries].concat(b))}},r=function(a,b,c,d){if(b=k(b,function(a,b){return{index:b,value:a}}),d){var e=[];a(b,function(a,b){c(a.value,function(c,d){e[a.index]=d,b(c)})},function(a){d(a,e)})}else a(b,function(a,b){c(a.value,function(a){b(a)})})};g.map=o(r),g.mapSeries=q(r),g.mapLimit=function(a,b,c,d){return s(b)(a,c,d)};var s=function(a){return p(a,r)};g.reduce=function(a,b,c,d){g.eachSeries(a,function(a,d){c(b,a,function(a,c){b=c,d(a)})},function(a){d(a,b)})},g.inject=g.reduce,g.foldl=g.reduce,g.reduceRight=function(a,b,c,d){var e=k(a,function(a){return a}).reverse();g.reduce(e,b,c,d)},g.foldr=g.reduceRight;var t=function(a,b,c,d){var e=[];b=k(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c&&e.push(a),b()})},function(a){d(k(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};g.filter=o(t),g.filterSeries=q(t),g.select=g.filter,g.selectSeries=g.filterSeries;var u=function(a,b,c,d){var e=[];b=k(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c||e.push(a),b()})},function(a){d(k(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};g.reject=o(u),g.rejectSeries=q(u);var v=function(a,b,c,d){a(b,function(a,b){c(a,function(c){c?(d(a),d=function(){}):b()})},function(a){d()})};g.detect=o(v),g.detectSeries=q(v),g.some=function(a,b,c){g.each(a,function(a,d){b(a,function(a){a&&(c(!0),c=function(){}),d()})},function(a){c(!1)})},g.any=g.some,g.every=function(a,b,c){g.each(a,function(a,d){b(a,function(a){a||(c(!1),c=function(){}),d()})},function(a){c(!0)})},g.all=g.every,g.sortBy=function(a,b,c){g.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){if(a)return c(a);var d=function(a,b){var c=a.criteria,d=b.criteria;return d>c?-1:c>d?1:0};c(null,k(b.sort(d),function(a){return a.value}))})},g.auto=function(a,b){b=b||function(){};var c=m(a),d=c.length;if(!d)return b();var e={},f=[],h=function(a){f.unshift(a)},k=function(a){for(var b=0;bd;){var f=d+(e-d+1>>>1);c(b,a[f])>=0?d=f:e=f-1}return d}function e(a,b,e,f){return a.started||(a.started=!0),i(b)||(b=[b]),0==b.length?g.setImmediate(function(){a.drain&&a.drain()}):void j(b,function(b){var h={data:b,priority:e,callback:"function"==typeof f?f:null};a.tasks.splice(d(a.tasks,h,c)+1,0,h),a.saturated&&a.tasks.length===a.concurrency&&a.saturated(),g.setImmediate(a.process)})}var f=g.queue(a,b);return f.push=function(a,b,c){e(f,a,b,c)},delete f.unshift,f},g.cargo=function(a,b){var c=!1,d=[],e={tasks:d,payload:b,saturated:null,empty:null,drain:null,drained:!0,push:function(a,c){i(a)||(a=[a]),j(a,function(a){d.push({data:a,callback:"function"==typeof c?c:null}),e.drained=!1,e.saturated&&d.length===b&&e.saturated()}),g.setImmediate(e.process)},process:function f(){if(!c){if(0===d.length)return e.drain&&!e.drained&&e.drain(),void(e.drained=!0);var g="number"==typeof b?d.splice(0,b):d.splice(0,d.length),h=k(g,function(a){return a.data});e.empty&&e.empty(),c=!0,a(h,function(){c=!1;var a=arguments;j(g,function(b){b.callback&&b.callback.apply(null,a)}),f()})}},length:function(){return d.length},running:function(){return c}};return e};var y=function(a){return function(b){var c=Array.prototype.slice.call(arguments,1);b.apply(null,c.concat([function(b){var c=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(b?console.error:console[a]&&j(c,function(a){}))}]))}};g.log=y("log"),g.dir=y("dir"),g.memoize=function(a,b){var c={},d={};b=b||function(a){return a};var e=function(){var e=Array.prototype.slice.call(arguments),f=e.pop(),h=b.apply(null,e);h in c?g.nextTick(function(){f.apply(null,c[h])}):h in d?d[h].push(f):(d[h]=[f],a.apply(null,e.concat([function(){c[h]=arguments;var a=d[h];delete d[h];for(var b=0,e=a.length;e>b;b++)a[b].apply(null,arguments)}])))};return e.memo=c,e.unmemoized=a,e},g.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},g.times=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return g.map(d,b,c)},g.timesSeries=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return g.mapSeries(d,b,c)},g.seq=function(){var a=arguments;return function(){var b=this,c=Array.prototype.slice.call(arguments),d=c.pop();g.reduce(a,c,function(a,c,d){c.apply(b,a.concat([function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);d(a,b)}]))},function(a,c){d.apply(b,[a].concat(c))})}},g.compose=function(){return g.seq.apply(null,Array.prototype.reverse.call(arguments))};var z=function(a,b){var c=function(){var c=this,d=Array.prototype.slice.call(arguments),e=d.pop();return a(b,function(a,b){a.apply(c,d.concat([b]))},e)};if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return c.apply(this,d)}return c};g.applyEach=o(z),g.applyEachSeries=q(z),g.forever=function(a,b){function c(d){if(d){if(b)return b(d);throw d}a(c)}c()},"undefined"!=typeof c&&c.exports?c.exports=g:"undefined"!=typeof a&&a.amd?a([],function(){return g}):e.async=g}()}).call(this,b("_process"))},{_process:2}],9:[function(a,b,c){"use strict";function d(a,b,c){c=c||2;var d=b&&b.length,h=d?b[0]*c:a.length,i=f(a,e(a,0,h,c,!0)),j=[];if(!i)return j;var l,m,n,o,p,q,r;if(d&&(i=k(a,b,i,c)),a.length>80*c){l=n=a[0],m=o=a[1];for(var s=c;h>s;s+=c)p=a[s],q=a[s+1],l>p&&(l=p),m>q&&(m=q),p>n&&(n=p),q>o&&(o=q);r=Math.max(n-l,o-m)}return g(a,i,j,c,l,m,r),j}function e(a,b,c,d,e){var f,g,h,i=0;for(f=b,g=c-d;c>f;f+=d)i+=(a[g]-a[f])*(a[f+1]+a[g+1]),g=f;if(e===i>0)for(f=b;c>f;f+=d)h=z(f,h);else for(f=c-d;f>=b;f-=d)h=z(f,h);return h}function f(a,b,c){c||(c=b);var d,e=b;do if(d=!1,e.steiner||!t(a,e.i,e.next.i)&&0!==s(a,e.prev.i,e.i,e.next.i))e=e.next;else{if(e.prev.next=e.next,e.next.prev=e.prev,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),e=c=e.prev,e===e.next)return null;d=!0}while(d||e!==c);return c}function g(a,b,c,d,e,k,l,m){if(b){m||void 0===e||n(a,b,e,k,l);for(var o,p,q=b;b.prev!==b.next;)if(o=b.prev,p=b.next,h(a,b,e,k,l))c.push(o.i/d),c.push(b.i/d),c.push(p.i/d),p.prev=o,o.next=p,b.prevZ&&(b.prevZ.nextZ=b.nextZ),b.nextZ&&(b.nextZ.prevZ=b.prevZ),b=p.next,q=p.next;else if(b=p,b===q){m?1===m?(b=i(a,b,c,d),g(a,b,c,d,e,k,l,2)):2===m&&j(a,b,c,d,e,k,l):g(a,f(a,b),c,d,e,k,l,1);break}}}function h(a,b,c,d,e){var f=b.prev.i,g=b.i,h=b.next.i,i=a[f],j=a[f+1],k=a[g],l=a[g+1],m=a[h],n=a[h+1],o=i*l-j*k,q=i*n-j*m,r=m*l-n*k,s=o-q-r;if(0>=s)return!1;var t,u,v,w,x,y,z,A=n-j,B=i-m,C=j-l,D=k-i;if(void 0!==c){var E=k>i?m>i?i:m:m>k?k:m,F=l>j?n>j?j:n:n>l?l:n,G=i>k?i>m?i:m:k>m?k:m,H=j>l?j>n?j:n:l>n?l:n,I=p(E,F,c,d,e),J=p(G,H,c,d,e);for(z=b.nextZ;z&&z.z<=J;)if(t=z.i,z=z.nextZ,t!==f&&t!==h&&(u=a[t],v=a[t+1],w=A*u+B*v-q,w>=0&&(x=C*u+D*v+o,x>=0&&(y=s-w-x,y>=0&&(w&&x||w&&y||x&&y)))))return!1;for(z=b.prevZ;z&&z.z>=I;)if(t=z.i,z=z.prevZ,t!==f&&t!==h&&(u=a[t],v=a[t+1],w=A*u+B*v-q,w>=0&&(x=C*u+D*v+o,x>=0&&(y=s-w-x,y>=0&&(w&&x||w&&y||x&&y)))))return!1}else for(z=b.next.next;z!==b.prev;)if(t=z.i,z=z.next,u=a[t],v=a[t+1],w=A*u+B*v-q,w>=0&&(x=C*u+D*v+o,x>=0&&(y=s-w-x,y>=0&&(w&&x||w&&y||x&&y))))return!1;return!0}function i(a,b,c,d){var e=b;do{var f=e.prev,g=e.next.next;if(f.i!==g.i&&u(a,f.i,e.i,e.next.i,g.i)&&w(a,f,g)&&w(a,g,f)){c.push(f.i/d),c.push(e.i/d),c.push(g.i/d),f.next=g,g.prev=f;var h=e.prevZ,i=e.nextZ&&e.nextZ.nextZ;h&&(h.nextZ=i),i&&(i.prevZ=h),e=b=g}e=e.next}while(e!==b);return e}function j(a,b,c,d,e,h,i){var j=b;do{for(var k=j.next.next;k!==j.prev;){if(j.i!==k.i&&r(a,j,k)){var l=y(j,k);return j=f(a,j,j.next),l=f(a,l,l.next),g(a,j,c,d,e,h,i),void g(a,l,c,d,e,h,i)}k=k.next}j=j.next}while(j!==b)}function k(a,b,c,d){var g,h,i,j,k,m=[];for(g=0,h=b.length;h>g;g++)i=b[g]*d,j=h-1>g?b[g+1]*d:a.length,k=e(a,i,j,d,!1),k===k.next&&(k.steiner=!0),k=f(a,k),k&&m.push(q(a,k));for(m.sort(function(b,c){return a[b.i]-a[c.i]}),g=0;g=a[f+1]){var l=a[e]+(j-a[e+1])*(a[f]-a[e])/(a[f+1]-a[e+1]);i>=l&&l>k&&(k=l,d=a[e]=B?-1:1,D=d,E=1/0;for(g=d.next;g!==D;)m=a[g.i],n=a[g.i+1],o=i-m,o>=0&&m>=s&&(p=(x*m+y*n-v)*C,p>=0&&(q=(z*m+A*n+u)*C,q>=0&&B*C-p-q>=0&&(r=Math.abs(j-n)/o,E>r&&w(a,g,b)&&(d=g,E=r)))),g=g.next;return d}function n(a,b,c,d,e){var f=b;do null===f.z&&(f.z=p(a[f.i],a[f.i+1],c,d,e)),f.prevZ=f.prev,f.nextZ=f.next,f=f.next;while(f!==b);f.prevZ.nextZ=null,f.prevZ=null,o(f)}function o(a){var b,c,d,e,f,g,h,i,j=1;do{for(c=a,a=null,f=null,g=0;c;){for(g++,d=c,h=0,b=0;j>b&&(h++,d=d.nextZ,d);b++);for(i=j;h>0||i>0&&d;)0===h?(e=d,d=d.nextZ,i--):0!==i&&d?c.z<=d.z?(e=c,c=c.nextZ,h--):(e=d,d=d.nextZ,i--):(e=c,c=c.nextZ,h--),f?f.nextZ=e:a=e,e.prevZ=f,f=e;c=d}f.nextZ=null,j*=2}while(g>1);return a}function p(a,b,c,d,e){return a=1e3*(a-c)/e,a=16711935&(a|a<<8),a=252645135&(a|a<<4),a=858993459&(a|a<<2),a=1431655765&(a|a<<1),b=1e3*(b-d)/e,b=16711935&(b|b<<8),b=252645135&(b|b<<4),b=858993459&(b|b<<2),b=1431655765&(b|b<<1),a|b<<1}function q(a,b){var c=b,d=b;do a[c.i]0?1:0>e?-1:0}function t(a,b,c){return a[b]===a[c]&&a[b+1]===a[c+1]}function u(a,b,c,d,e){return s(a,b,c,d)!==s(a,b,c,e)&&s(a,d,e,b)!==s(a,d,e,c)}function v(a,b,c,d){var e=b;do{var f=e.i,g=e.next.i;if(f!==c&&g!==c&&f!==d&&g!==d&&u(a,f,g,c,d))return!0;e=e.next}while(e!==b);return!1}function w(a,b,c){return-1===s(a,b.prev.i,b.i,b.next.i)?-1!==s(a,b.i,c.i,b.next.i)&&-1!==s(a,b.i,b.prev.i,c.i):-1===s(a,b.i,c.i,b.prev.i)||-1===s(a,b.i,b.next.i,c.i)}function x(a,b,c,d){var e=b,f=!1,g=(a[c]+a[d])/2,h=(a[c+1]+a[d+1])/2;do{var i=e.i,j=e.next.i;a[i+1]>h!=a[j+1]>h&&g<(a[j]-a[i])*(h-a[i+1])/(a[j+1]-a[i+1])+a[i]&&(f=!f),e=e.next}while(e!==b);return f}function y(a,b){var c=new A(a.i),d=new A(b.i),e=a.next,f=b.prev;return a.next=b,b.prev=a,c.next=e,e.prev=c,d.next=c,c.prev=d,f.next=d,d.prev=f,d}function z(a,b){var c=new A(a);return b?(c.next=b.next,c.prev=b,b.next.prev=c,b.next=c):(c.prev=c,c.next=c),c}function A(a){this.i=a,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}b.exports=d},{}],10:[function(a,b,c){"use strict";function d(a,b,c){this.fn=a,this.context=b,this.once=c||!1}function e(){}var f="function"!=typeof Object.create?"~":!1;e.prototype._events=void 0,e.prototype.listeners=function(a,b){var c=f?f+a:a,d=this._events&&this._events[c];if(b)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var e=0,g=d.length,h=new Array(g);g>e;e++)h[e]=d[e].fn;return h},e.prototype.emit=function(a,b,c,d,e,g){ -var h=f?f+a:a;if(!this._events||!this._events[h])return!1;var i,j,k=this._events[h],l=arguments.length;if("function"==typeof k.fn){switch(k.once&&this.removeListener(a,k.fn,void 0,!0),l){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,b),!0;case 3:return k.fn.call(k.context,b,c),!0;case 4:return k.fn.call(k.context,b,c,d),!0;case 5:return k.fn.call(k.context,b,c,d,e),!0;case 6:return k.fn.call(k.context,b,c,d,e,g),!0}for(j=1,i=new Array(l-1);l>j;j++)i[j-1]=arguments[j];k.fn.apply(k.context,i)}else{var m,n=k.length;for(j=0;n>j;j++)switch(k[j].once&&this.removeListener(a,k[j].fn,void 0,!0),l){case 1:k[j].fn.call(k[j].context);break;case 2:k[j].fn.call(k[j].context,b);break;case 3:k[j].fn.call(k[j].context,b,c);break;default:if(!i)for(m=1,i=new Array(l-1);l>m;m++)i[m-1]=arguments[m];k[j].fn.apply(k[j].context,i)}}return!0},e.prototype.on=function(a,b,c){var e=new d(b,c||this),g=f?f+a:a;return this._events||(this._events=f?{}:Object.create(null)),this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],e]:this._events[g].push(e):this._events[g]=e,this},e.prototype.once=function(a,b,c){var e=new d(b,c||this,!0),g=f?f+a:a;return this._events||(this._events=f?{}:Object.create(null)),this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],e]:this._events[g].push(e):this._events[g]=e,this},e.prototype.removeListener=function(a,b,c,d){var e=f?f+a:a;if(!this._events||!this._events[e])return this;var g=this._events[e],h=[];if(b)if(g.fn)(g.fn!==b||d&&!g.once||c&&g.context!==c)&&h.push(g);else for(var i=0,j=g.length;j>i;i++)(g[i].fn!==b||d&&!g[i].once||c&&g[i].context!==c)&&h.push(g[i]);return h.length?this._events[e]=1===h.length?h[0]:h:delete this._events[e],this},e.prototype.removeAllListeners=function(a){return this._events?(a?delete this._events[f?f+a:a]:this._events=f?{}:Object.create(null),this):this},e.prototype.off=e.prototype.removeListener,e.prototype.addListener=e.prototype.on,e.prototype.setMaxListeners=function(){return this},e.prefixed=f,"undefined"!=typeof b&&(b.exports=e)},{}],11:[function(a,b,c){"use strict";function d(a){if(null==a)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}b.exports=Object.assign||function(a,b){for(var c,e,f=d(a),g=1;g0)if(this.xhrType===d.XHR_RESPONSE_TYPE.TEXT)this.data=a.responseText;else if(this.xhrType===d.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(a.responseText),this.isJson=!0}catch(c){this.error=new Error("Error trying to parse loaded json:",c)}else if(this.xhrType===d.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var e=new DOMParser;this.data=e.parseFromString(a.responseText,"text/xml")}else{var f=document.createElement("div");f.innerHTML=a.responseText,this.data=f}this.isXml=!0}catch(c){this.error=new Error("Error trying to parse loaded xml:",c)}else this.data=a.response||a.responseText;else this.error=new Error("["+a.status+"]"+a.statusText+":"+a.responseURL);this.complete()},d.prototype._determineCrossOrigin=function(a,b){if(0===a.indexOf("data:"))return"";b=b||window.location,j||(j=document.createElement("a")),j.href=a,a=h.parse(j.href);var c=!a.port&&""===b.port||a.port===b.port;return a.hostname===b.hostname&&c&&a.protocol===b.protocol?"":"anonymous"},d.prototype._determineXhrType=function(){return d._xhrTypeMap[this._getExtension()]||d.XHR_RESPONSE_TYPE.TEXT},d.prototype._determineLoadType=function(){return d._loadTypeMap[this._getExtension()]||d.LOAD_TYPE.XHR},d.prototype._getExtension=function(){var a,b=this.url;if(this.isDataUrl){var c=b.indexOf("/");a=b.substring(c+1,b.indexOf(";",c))}else{var d=b.indexOf("?");-1!==d&&(b=b.substring(0,d)),a=b.substring(b.lastIndexOf(".")+1)}return a},d.prototype._getMimeFromXhrType=function(a){switch(a){case d.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case d.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case d.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case d.XHR_RESPONSE_TYPE.JSON:return"application/json";case d.XHR_RESPONSE_TYPE.DEFAULT:case d.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},d.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},d.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},d.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},d._loadTypeMap={gif:d.LOAD_TYPE.IMAGE,png:d.LOAD_TYPE.IMAGE,bmp:d.LOAD_TYPE.IMAGE,jpg:d.LOAD_TYPE.IMAGE,jpeg:d.LOAD_TYPE.IMAGE,tif:d.LOAD_TYPE.IMAGE,tiff:d.LOAD_TYPE.IMAGE,webp:d.LOAD_TYPE.IMAGE,tga:d.LOAD_TYPE.IMAGE},d._xhrTypeMap={xhtml:d.XHR_RESPONSE_TYPE.DOCUMENT,html:d.XHR_RESPONSE_TYPE.DOCUMENT,htm:d.XHR_RESPONSE_TYPE.DOCUMENT,xml:d.XHR_RESPONSE_TYPE.DOCUMENT,tmx:d.XHR_RESPONSE_TYPE.DOCUMENT,tsx:d.XHR_RESPONSE_TYPE.DOCUMENT,svg:d.XHR_RESPONSE_TYPE.DOCUMENT,gif:d.XHR_RESPONSE_TYPE.BLOB,png:d.XHR_RESPONSE_TYPE.BLOB,bmp:d.XHR_RESPONSE_TYPE.BLOB,jpg:d.XHR_RESPONSE_TYPE.BLOB,jpeg:d.XHR_RESPONSE_TYPE.BLOB,tif:d.XHR_RESPONSE_TYPE.BLOB,tiff:d.XHR_RESPONSE_TYPE.BLOB,webp:d.XHR_RESPONSE_TYPE.BLOB,tga:d.XHR_RESPONSE_TYPE.BLOB,json:d.XHR_RESPONSE_TYPE.JSON,text:d.XHR_RESPONSE_TYPE.TEXT,txt:d.XHR_RESPONSE_TYPE.TEXT},d.setExtensionLoadType=function(a,b){f(d._loadTypeMap,a,b)},d.setExtensionXhrType=function(a,b){f(d._xhrTypeMap,a,b)}},{eventemitter3:10,url:7}],14:[function(a,b,c){b.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(a){for(var b,c="",d=new Array(4),e=0,f=0,g=0;e>2,d[1]=(3&b[0])<<4|b[1]>>4,d[2]=(15&b[1])<<2|b[2]>>6,d[3]=63&b[2],g=e-(a.length-1)){case 2:d[3]=64,d[2]=64;break;case 1:d[3]=64}for(f=0;f=0&&b<=this.children.length)return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),a.emit("added",this),a;throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length)},d.prototype.swapChildren=function(a,b){if(a!==b){var c=this.getChildIndex(a),d=this.getChildIndex(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[c]=b,this.children[d]=a}},d.prototype.getChildIndex=function(a){var b=this.children.indexOf(a);if(-1===b)throw new Error("The supplied DisplayObject must be a child of the caller");return b},d.prototype.setChildIndex=function(a,b){if(0>b||b>=this.children.length)throw new Error("The supplied index is out of bounds");var c=this.getChildIndex(a);this.children.splice(c,1),this.children.splice(b,0,a)},d.prototype.getChildAt=function(a){if(0>a||a>=this.children.length)throw new Error("getChildAt: Supplied index "+a+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[a]},d.prototype.removeChild=function(a){var b=this.children.indexOf(a);if(-1!==b)return this.removeChildAt(b)},d.prototype.removeChildAt=function(a){var b=this.getChildAt(a);return b.parent=null,this.children.splice(a,1),b.emit("removed",this),b},d.prototype.removeChildren=function(a,b){var c=a||0,d="number"==typeof b?b:this.children.length,e=d-c;if(e>0&&d>=e){for(var f=this.children.splice(c,e),g=0;ga;++a)this.children[a].updateTransform()}},d.prototype.containerUpdateTransform=d.prototype.updateTransform,d.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return e.Rectangle.EMPTY;for(var a,b,c,d=1/0,f=1/0,g=-(1/0),h=-(1/0),i=!1,j=0,k=this.children.length;k>j;++j){var l=this.children[j];l.visible&&(i=!0,a=this.children[j].getBounds(),d=db?g:b,h=h>c?h:c)}if(!i)return e.Rectangle.EMPTY;var m=this._bounds;m.x=d,m.y=f,m.width=g-d,m.height=h-f,this._currentBounds=m}return this._currentBounds},d.prototype.containerGetBounds=d.prototype.getBounds,d.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=e.Matrix.IDENTITY;for(var b=0,c=this.children.length;c>b;++b)this.children[b].updateTransform();return this.worldTransform=a,this._currentBounds=null,this.getBounds(e.Matrix.IDENTITY)},d.prototype.renderWebGL=function(a){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var b,c;if(this._mask||this._filters){for(a.currentRenderer.flush(),this._filters&&a.filterManager.pushFilter(this,this._filters),this._mask&&a.maskManager.pushMask(this,this._mask),a.currentRenderer.start(),this._renderWebGL(a),b=0,c=this.children.length;c>b;b++)this.children[b].renderWebGL(a);a.currentRenderer.flush(),this._mask&&a.maskManager.popMask(this,this._mask),this._filters&&a.filterManager.popFilter(),a.currentRenderer.start()}else for(this._renderWebGL(a),b=0,c=this.children.length;c>b;++b)this.children[b].renderWebGL(a)}},d.prototype._renderWebGL=function(a){},d.prototype._renderCanvas=function(a){},d.prototype.renderCanvas=function(a){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&a.maskManager.pushMask(this._mask,a),this._renderCanvas(a);for(var b=0,c=this.children.length;c>b;++b)this.children[b].renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},d.prototype.destroy=function(a){if(f.prototype.destroy.call(this),a)for(var b=0,c=this.children.length;c>b;++b)this.children[b].destroy(a);this.removeChildren(),this.children=null}},{"../math":29,"../textures/RenderTexture":67,"./DisplayObject":21}],21:[function(a,b,c){function d(){g.call(this),this.position=new e.Point,this.scale=new e.Point(1,1),this.pivot=new e.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new e.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new e.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cachedObject=null}var e=a("../math"),f=a("../textures/RenderTexture"),g=a("eventemitter3"),h=a("../const"),i=new e.Matrix;d.prototype=Object.create(g.prototype),d.prototype.constructor=d,b.exports=d,Object.defineProperties(d.prototype,{x:{get:function(){return this.position.x},set:function(a){this.position.x=a}},y:{get:function(){return this.position.y},set:function(a){this.position.y=a}},worldVisible:{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}},mask:{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.renderable=!0),this._mask=a,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(a){this._filters=a&&a.slice()}}}),d.prototype.updateTransform=function(){var a,b,c,d,e,f,g=this.parent.worldTransform,i=this.worldTransform;this.rotation%h.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),a=this._cr*this.scale.x,b=this._sr*this.scale.x,c=-this._sr*this.scale.y,d=this._cr*this.scale.y,e=this.position.x,f=this.position.y,(this.pivot.x||this.pivot.y)&&(e-=this.pivot.x*a+this.pivot.y*c,f-=this.pivot.x*b+this.pivot.y*d),i.a=a*g.a+b*g.c,i.b=a*g.b+b*g.d,i.c=c*g.a+d*g.c,i.d=c*g.b+d*g.d,i.tx=e*g.a+f*g.c+g.tx,i.ty=e*g.b+f*g.d+g.ty):(a=this.scale.x,d=this.scale.y,e=this.position.x-this.pivot.x*a,f=this.position.y-this.pivot.y*d,i.a=a*g.a,i.b=a*g.b,i.c=d*g.c,i.d=d*g.d,i.tx=e*g.a+f*g.c+g.tx,i.ty=e*g.b+f*g.d+g.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},d.prototype.displayObjectUpdateTransform=d.prototype.updateTransform,d.prototype.getBounds=function(a){return e.Rectangle.EMPTY},d.prototype.getLocalBounds=function(){return this.getBounds(e.Matrix.IDENTITY)},d.prototype.toGlobal=function(a){return this.displayObjectUpdateTransform(),this.worldTransform.apply(a)},d.prototype.toLocal=function(a,b){return b&&(a=b.toGlobal(a)),this.displayObjectUpdateTransform(),this.worldTransform.applyInverse(a)},d.prototype.renderWebGL=function(a){},d.prototype.renderCanvas=function(a){},d.prototype.generateTexture=function(a,b,c){var d=this.getLocalBounds(),e=new f(a,0|d.width,0|d.height,b,c);return i.tx=-d.x,i.ty=-d.y,e.render(this,i),e},d.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../const":19,"../math":29,"../textures/RenderTexture":67,eventemitter3:10}],22:[function(a,b,c){function d(){e.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=k.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new j.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}var e=a("../display/Container"),f=a("../textures/Texture"),g=a("../renderers/canvas/utils/CanvasBuffer"),h=a("../renderers/canvas/utils/CanvasGraphics"),i=a("./GraphicsData"),j=a("../math"),k=a("../const"),l=new j.Point;d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,Object.defineProperties(d.prototype,{}),d.prototype.clone=function(){var a=new d;a.renderable=this.renderable,a.fillAlpha=this.fillAlpha,a.lineWidth=this.lineWidth,a.lineColor=this.lineColor,a.tint=this.tint,a.blendMode=this.blendMode,a.isMask=this.isMask,a.boundsPadding=this.boundsPadding,a.dirty=this.dirty,a.glDirty=this.glDirty,a.cachedSpriteDirty=this.cachedSpriteDirty;for(var b=0;b=l;++l)k=l/g,e=i+(a-i)*k,f=j+(b-j)*k,h.push(e+(a+(c-a)*k-e)*k,f+(b+(d-b)*k-f)*k);return this.dirty=this.boundsDirty=!0,this},d.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var g,h,i,j,k,l=20,m=this.currentPath.shape.points,n=m[m.length-2],o=m[m.length-1],p=0,q=1;l>=q;++q)p=q/l,g=1-p,h=g*g,i=h*g,j=p*p,k=j*p,m.push(i*n+3*h*p*a+3*g*j*c+k*e,i*o+3*h*p*b+3*g*j*d+k*f);return this.dirty=this.boundsDirty=!0,this},d.prototype.arcTo=function(a,b,c,d,e){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(a,b):this.moveTo(a,b);var f=this.currentPath.shape.points,g=f[f.length-2],h=f[f.length-1],i=h-b,j=g-a,k=d-b,l=c-a,m=Math.abs(i*l-j*k);if(1e-8>m||0===e)(f[f.length-2]!==a||f[f.length-1]!==b)&&f.push(a,b);else{var n=i*i+j*j,o=k*k+l*l,p=i*k+j*l,q=e*Math.sqrt(n)/m,r=e*Math.sqrt(o)/m,s=q*p/n,t=r*p/o,u=q*l+r*j,v=q*k+r*i,w=j*(r+s),x=i*(r+s),y=l*(q+t),z=k*(q+t),A=Math.atan2(x-v,w-u),B=Math.atan2(z-v,y-u);this.arc(u+a,v+b,e,A,B,j*k>l*i)}return this.dirty=this.boundsDirty=!0,this},d.prototype.arc=function(a,b,c,d,e,f){if(f=f||!1,d===e)return this;!f&&d>=e?e+=2*Math.PI:f&&e>=d&&(d+=2*Math.PI);var g=f?-1*(d-e):e-d,h=40*Math.ceil(Math.abs(g)/(2*Math.PI));if(0===g)return this;var i=a+Math.cos(d)*c,j=b+Math.sin(d)*c;this.currentPath?f&&this.filling?this.currentPath.shape.points.push(a,b):this.currentPath.shape.points.push(i,j):f&&this.filling?this.moveTo(a,b):this.moveTo(i,j);for(var k=this.currentPath.shape.points,l=g/(2*h),m=2*l,n=Math.cos(l),o=Math.sin(l),p=h-1,q=p%1/p,r=0;p>=r;r++){var s=r+q*r,t=l+d+m*s,u=Math.cos(t),v=-Math.sin(t);k.push((n*u+o*v)*c+a,(n*-v+o*u)*c+b)}return this.dirty=this.boundsDirty=!0,this},d.prototype.beginFill=function(a,b){return this.filling=!0,this.fillColor=a||0,this.fillAlpha=void 0===b?1:b,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},d.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},d.prototype.drawRect=function(a,b,c,d){return this.drawShape(new j.Rectangle(a,b,c,d)),this},d.prototype.drawRoundedRect=function(a,b,c,d,e){return this.drawShape(new j.RoundedRectangle(a,b,c,d,e)),this},d.prototype.drawCircle=function(a,b,c){return this.drawShape(new j.Circle(a,b,c)),this},d.prototype.drawEllipse=function(a,b,c,d){return this.drawShape(new j.Ellipse(a,b,c,d)),this},d.prototype.drawPolygon=function(a){var b=a;if(!Array.isArray(b)){b=new Array(arguments.length);for(var c=0;cq?q:y, -y=y>s?s:y,y=y>u?u:y,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x,this._bounds.x=y,this._bounds.width=w-y,this._bounds.y=z,this._bounds.height=x-z,this._currentBounds=this._bounds}return this._currentBounds},d.prototype.containsPoint=function(a){this.worldTransform.applyInverse(a,l);for(var b=this.graphicsData,c=0;cg?g:a,b=g+i>b?g+i:b,c=c>h?h:c,d=h+j>d?h+j:d;else if(n===k.SHAPES.CIRC)g=e.x,h=e.y,i=e.radius+o/2,j=e.radius+o/2,a=a>g-i?g-i:a,b=g+i>b?g+i:b,c=c>h-j?h-j:c,d=h+j>d?h+j:d;else if(n===k.SHAPES.ELIP)g=e.x,h=e.y,i=e.width+o/2,j=e.height+o/2,a=a>g-i?g-i:a,b=g+i>b?g+i:b,c=c>h-j?h-j:c,d=h+j>d?h+j:d;else{f=e.points;for(var p=0;pg-o?g-o:a,b=g+o>b?g+o:b,c=c>h-o?h-o:c,d=h+o>d?h+o:d}}else a=0,b=0,c=0,d=0;var q=this.boundsPadding;this._localBounds.x=a-q,this._localBounds.width=b-a+2*q,this._localBounds.y=c-q,this._localBounds.height=d-c+2*q},d.prototype.drawShape=function(a){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var b=new i(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,a);return this.graphicsData.push(b),b.type===k.SHAPES.POLY&&(b.shape.closed=b.shape.closed||this.filling,this.currentPath=b),this.dirty=this.boundsDirty=!0,b},d.prototype.destroy=function(){e.prototype.destroy.apply(this,arguments);for(var a=0;a=6)if(h.points.length<2*this.maximumSimplePolySize){f=this.switchMode(c,0);var i=this.buildPoly(h,f);i||(f=this.switchMode(c,1),this.buildComplexPoly(h,f))}else f=this.switchMode(c,1),this.buildComplexPoly(h,f);h.lineWidth>0&&(f=this.switchMode(c,0),this.buildLine(h,f))}else f=this.switchMode(c,0),h.type===g.SHAPES.RECT?this.buildRectangle(h,f):h.type===g.SHAPES.CIRC||h.type===g.SHAPES.ELIP?this.buildCircle(h,f):h.type===g.SHAPES.RREC&&this.buildRoundedRectangle(h,f);c.lastIndex++}for(d=0;d32e4||c.mode!==b||1===b)&&(c=this.graphicsDataPool.pop()||new j(a.gl),c.mode=b,a.data.push(c))):(c=this.graphicsDataPool.pop()||new j(a.gl),c.mode=b,a.data.push(c)),c.dirty=!0,c},d.prototype.buildRectangle=function(a,b){var c=a.shape,d=c.x,f=c.y,g=c.width,h=c.height;if(a.fill){var i=e.hex2rgb(a.fillColor),j=a.fillAlpha,k=i[0]*j,l=i[1]*j,m=i[2]*j,n=b.points,o=b.indices,p=n.length/6;n.push(d,f),n.push(k,l,m,j),n.push(d+g,f),n.push(k,l,m,j),n.push(d,f+h),n.push(k,l,m,j),n.push(d+g,f+h),n.push(k,l,m,j),o.push(p,p,p+1,p+2,p+3,p+3)}if(a.lineWidth){var q=a.points;a.points=[d,f,d+g,f,d+g,f+h,d,f+h,d,f],this.buildLine(a,b),a.points=q}},d.prototype.buildRoundedRectangle=function(a,b){var c=a.shape,d=c.x,f=c.y,g=c.width,h=c.height,i=c.radius,j=[];if(j.push(d,f+i),this.quadraticBezierCurve(d,f+h-i,d,f+h,d+i,f+h,j),this.quadraticBezierCurve(d+g-i,f+h,d+g,f+h,d+g,f+h-i,j),this.quadraticBezierCurve(d+g,f+i,d+g,f,d+g-i,f,j),this.quadraticBezierCurve(d+i,f,d,f,d,f+i+1e-10,j),a.fill){var l=e.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=b.points,r=b.indices,s=q.length/6,t=k(j,null,2),u=0;for(u=0;u=r;r++)q=r/o,i=h(a,c,q),j=h(b,d,q),k=h(c,e,q),l=h(d,f,q),m=h(i,k,q),n=h(j,l,q),p.push(m,n);return p},d.prototype.buildCircle=function(a,b){var c,d,f=a.shape,h=f.x,i=f.y;a.type===g.SHAPES.CIRC?(c=f.radius,d=f.radius):(c=f.width,d=f.height);var j=40,k=2*Math.PI/j,l=0;if(a.fill){var m=e.hex2rgb(a.fillColor),n=a.fillAlpha,o=m[0]*n,p=m[1]*n,q=m[2]*n,r=b.points,s=b.indices,t=r.length/6;for(s.push(t),l=0;j+1>l;l++)r.push(h,i,o,p,q,n),r.push(h+Math.sin(k*l)*c,i+Math.cos(k*l)*d,o,p,q,n),s.push(t++,t++);s.push(t-1)}if(a.lineWidth){var u=a.points;for(a.points=[],l=0;j+1>l;l++)a.points.push(h+Math.sin(k*l)*c,i+Math.cos(k*l)*d);this.buildLine(a,b),a.points=u}},d.prototype.buildLine=function(a,b){var c=0,d=a.points;if(0!==d.length){if(a.lineWidth%2)for(c=0;cc;c++)m=d[2*(c-1)],n=d[2*(c-1)+1],o=d[2*c],p=d[2*c+1],q=d[2*(c+1)],r=d[2*(c+1)+1],s=-(n-p),t=m-o,G=Math.sqrt(s*s+t*t),s/=G,t/=G,s*=M,t*=M,u=-(p-r),v=o-q,G=Math.sqrt(u*u+v*v),u/=G,v/=G,u*=M,v*=M,y=-t+n-(-t+p),z=-s+o-(-s+m),A=(-s+m)*(-t+p)-(-s+o)*(-t+n),B=-v+r-(-v+p),C=-u+o-(-u+q),D=(-u+q)*(-v+p)-(-u+o)*(-v+r),E=y*C-B*z,Math.abs(E)<.1?(E+=10.1,H.push(o-s,p-t,P,Q,R,O),H.push(o+s,p+t,P,Q,R,O)):(k=(z*D-C*A)/E,l=(B*A-y*D)/E,F=(k-o)*(k-o)+(l-p)+(l-p),F>19600?(w=s-u,x=t-v,G=Math.sqrt(w*w+x*x),w/=G,x/=G,w*=M,x*=M,H.push(o-w,p-x),H.push(P,Q,R,O),H.push(o+w,p+x),H.push(P,Q,R,O),H.push(o-w,p-x),H.push(P,Q,R,O),K++):(H.push(k,l),H.push(P,Q,R,O),H.push(o-(k-o),p-(l-p)),H.push(P,Q,R,O)));for(m=d[2*(J-2)],n=d[2*(J-2)+1],o=d[2*(J-1)],p=d[2*(J-1)+1],s=-(n-p),t=m-o,G=Math.sqrt(s*s+t*t),s/=G,t/=G,s*=M,t*=M,H.push(o-s,p-t),H.push(P,Q,R,O),H.push(o+s,p+t),H.push(P,Q,R,O),I.push(L),c=0;K>c;c++)I.push(L++);I.push(L-1)}},d.prototype.buildComplexPoly=function(a,b){var c=a.points.slice();if(!(c.length<6)){var d=b.indices;b.points=c,b.alpha=a.fillAlpha,b.color=e.hex2rgb(a.fillColor);for(var f,g,h=1/0,i=-(1/0),j=1/0,k=-(1/0),l=0;lf?f:h,i=f>i?f:i,j=j>g?g:j,k=g>k?g:k;c.push(h,j,i,j,i,k,h,k);var m=c.length/2;for(l=0;m>l;l++)d.push(l)}},d.prototype.buildPoly=function(a,b){var c=a.points;if(!(c.length<6)){var d=b.points,f=b.indices,g=c.length/2,h=e.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,l=h[1]*i,m=h[2]*i,n=k(c,null,2);if(!n)return!1;var o=d.length/6,p=0;for(p=0;pp;p++)d.push(c[2*p],c[2*p+1],j,l,m,i);return!0}}},{"../../const":19,"../../math":29,"../../renderers/webgl/WebGLRenderer":45,"../../renderers/webgl/utils/ObjectRenderer":59,"../../utils":73,"./WebGLGraphicsData":25,earcut:9}],25:[function(a,b,c){function d(a){this.gl=a,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}d.prototype.constructor=d,b.exports=d,d.prototype.reset=function(){this.points.length=0,this.indices.length=0},d.prototype.upload=function(){var a=this.gl;this.glPoints=new Float32Array(this.points),a.bindBuffer(a.ARRAY_BUFFER,this.buffer),a.bufferData(a.ARRAY_BUFFER,this.glPoints,a.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.glIndices,a.STATIC_DRAW),this.dirty=!1},d.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{}],26:[function(a,b,c){var d=b.exports=Object.assign(a("./const"),a("./math"),{utils:a("./utils"),ticker:a("./ticker"),DisplayObject:a("./display/DisplayObject"),Container:a("./display/Container"),Sprite:a("./sprites/Sprite"),ParticleContainer:a("./particles/ParticleContainer"),SpriteRenderer:a("./sprites/webgl/SpriteRenderer"),ParticleRenderer:a("./particles/webgl/ParticleRenderer"),Text:a("./text/Text"),Graphics:a("./graphics/Graphics"),GraphicsData:a("./graphics/GraphicsData"),GraphicsRenderer:a("./graphics/webgl/GraphicsRenderer"),Texture:a("./textures/Texture"),BaseTexture:a("./textures/BaseTexture"),RenderTexture:a("./textures/RenderTexture"),VideoBaseTexture:a("./textures/VideoBaseTexture"),TextureUvs:a("./textures/TextureUvs"),CanvasRenderer:a("./renderers/canvas/CanvasRenderer"),CanvasGraphics:a("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:a("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:a("./renderers/webgl/WebGLRenderer"),ShaderManager:a("./renderers/webgl/managers/ShaderManager"),Shader:a("./renderers/webgl/shaders/Shader"),ObjectRenderer:a("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:a("./renderers/webgl/utils/RenderTarget"),AbstractFilter:a("./renderers/webgl/filters/AbstractFilter"),FXAAFilter:a("./renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:a("./renderers/webgl/filters/SpriteMaskFilter"),autoDetectRenderer:function(a,b,c,e){return a=a||800,b=b||600,!e&&d.utils.isWebGLSupported()?new d.WebGLRenderer(a,b,c):new d.CanvasRenderer(a,b,c)}})},{"./const":19,"./display/Container":20,"./display/DisplayObject":21,"./graphics/Graphics":22,"./graphics/GraphicsData":23,"./graphics/webgl/GraphicsRenderer":24,"./math":29,"./particles/ParticleContainer":35,"./particles/webgl/ParticleRenderer":37,"./renderers/canvas/CanvasRenderer":40,"./renderers/canvas/utils/CanvasBuffer":41,"./renderers/canvas/utils/CanvasGraphics":42,"./renderers/webgl/WebGLRenderer":45,"./renderers/webgl/filters/AbstractFilter":46,"./renderers/webgl/filters/FXAAFilter":47,"./renderers/webgl/filters/SpriteMaskFilter":48,"./renderers/webgl/managers/ShaderManager":52,"./renderers/webgl/shaders/Shader":57,"./renderers/webgl/utils/ObjectRenderer":59,"./renderers/webgl/utils/RenderTarget":61,"./sprites/Sprite":63,"./sprites/webgl/SpriteRenderer":64,"./text/Text":65,"./textures/BaseTexture":66,"./textures/RenderTexture":67,"./textures/Texture":68,"./textures/TextureUvs":69,"./textures/VideoBaseTexture":70,"./ticker":72,"./utils":73}],27:[function(a,b,c){function d(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var e=a("./Point");d.prototype.constructor=d,b.exports=d,d.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},d.prototype.toArray=function(a,b){this.array||(this.array=new Float32Array(9));var c=b||this.array;return a?(c[0]=this.a,c[1]=this.b,c[2]=0,c[3]=this.c,c[4]=this.d,c[5]=0,c[6]=this.tx,c[7]=this.ty,c[8]=1):(c[0]=this.a,c[1]=this.c,c[2]=this.tx,c[3]=this.b,c[4]=this.d,c[5]=this.ty,c[6]=0,c[7]=0,c[8]=1),c},d.prototype.apply=function(a,b){b=b||new e;var c=a.x,d=a.y;return b.x=this.a*c+this.c*d+this.tx,b.y=this.b*c+this.d*d+this.ty,b},d.prototype.applyInverse=function(a,b){b=b||new e;var c=1/(this.a*this.d+this.c*-this.b),d=a.x,f=a.y;return b.x=this.d*c*d+-this.c*c*f+(this.ty*this.c-this.tx*this.d)*c,b.y=this.a*c*f+-this.b*c*d+(-this.ty*this.a+this.tx*this.b)*c,b},d.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},d.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},d.prototype.rotate=function(a){var b=Math.cos(a),c=Math.sin(a),d=this.a,e=this.c,f=this.tx;return this.a=d*b-this.b*c,this.b=d*c+this.b*b,this.c=e*b-this.d*c,this.d=e*c+this.d*b,this.tx=f*b-this.ty*c,this.ty=f*c+this.ty*b,this},d.prototype.append=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},d.prototype.prepend=function(a){var b=this.tx;if(1!==a.a||0!==a.b||0!==a.c||1!==a.d){var c=this.a,d=this.c;this.a=c*a.a+this.b*a.c,this.b=c*a.b+this.b*a.d,this.c=d*a.a+this.d*a.c,this.d=d*a.b+this.d*a.d}return this.tx=b*a.a+this.ty*a.c+a.tx,this.ty=b*a.b+this.ty*a.d+a.ty,this},d.prototype.invert=function(){var a=this.a,b=this.b,c=this.c,d=this.d,e=this.tx,f=a*d-b*c;return this.a=d/f,this.b=-b/f,this.c=-c/f,this.d=a/f,this.tx=(c*this.ty-d*e)/f,this.ty=-(a*this.ty-b*e)/f,this},d.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},d.prototype.clone=function(){var a=new d;return a.a=this.a,a.b=this.b,a.c=this.c,a.d=this.d,a.tx=this.tx,a.ty=this.ty,a},d.prototype.copy=function(a){return a.a=this.a,a.b=this.b,a.c=this.c,a.d=this.d,a.tx=this.tx,a.ty=this.ty,a},d.IDENTITY=new d,d.TEMP_MATRIX=new d},{"./Point":28}],28:[function(a,b,c){function d(a,b){this.x=a||0,this.y=b||0}d.prototype.constructor=d,b.exports=d,d.prototype.clone=function(){return new d(this.x,this.y)},d.prototype.copy=function(a){this.set(a.x,a.y)},d.prototype.equals=function(a){return a.x===this.x&&a.y===this.y},d.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)}},{}],29:[function(a,b,c){b.exports={Point:a("./Point"),Matrix:a("./Matrix"),Circle:a("./shapes/Circle"),Ellipse:a("./shapes/Ellipse"),Polygon:a("./shapes/Polygon"),Rectangle:a("./shapes/Rectangle"),RoundedRectangle:a("./shapes/RoundedRectangle")}},{"./Matrix":27,"./Point":28,"./shapes/Circle":30,"./shapes/Ellipse":31,"./shapes/Polygon":32,"./shapes/Rectangle":33,"./shapes/RoundedRectangle":34}],30:[function(a,b,c){function d(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0,this.type=f.SHAPES.CIRC}var e=a("./Rectangle"),f=a("../../const");d.prototype.constructor=d,b.exports=d,d.prototype.clone=function(){return new d(this.x,this.y,this.radius)},d.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},d.prototype.getBounds=function(){return new e(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":19,"./Rectangle":33}],31:[function(a,b,c){function d(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.type=f.SHAPES.ELIP}var e=a("./Rectangle"),f=a("../../const");d.prototype.constructor=d,b.exports=d,d.prototype.clone=function(){return new d(this.x,this.y,this.width,this.height)},d.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},d.prototype.getBounds=function(){return new e(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":19,"./Rectangle":33}],32:[function(a,b,c){function d(a){var b=a;if(!Array.isArray(b)){b=new Array(arguments.length);for(var c=0;cg;g++)d.push(b[g].x,b[g].y);b=d}this.closed=!0,this.points=b,this.type=f.SHAPES.POLY}var e=a("../Point"),f=a("../../const");d.prototype.constructor=d,b.exports=d,d.prototype.clone=function(){return new d(this.points.slice())},d.prototype.contains=function(a,b){for(var c=!1,d=this.points.length/2,e=0,f=d-1;d>e;f=e++){var g=this.points[2*e],h=this.points[2*e+1],i=this.points[2*f],j=this.points[2*f+1],k=h>b!=j>b&&(i-g)*(b-h)/(j-h)+g>a;k&&(c=!c)}return c}},{"../../const":19,"../Point":28}],33:[function(a,b,c){function d(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.type=e.SHAPES.RECT}var e=a("../../const");d.prototype.constructor=d,b.exports=d,d.EMPTY=new d(0,0,0,0),d.prototype.clone=function(){return new d(this.x,this.y,this.width,this.height)},d.prototype.contains=function(a,b){return this.width<=0||this.height<=0?!1:a>=this.x&&a=this.y&&b=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height?!0:!1}},{"../../const":19}],35:[function(a,b,c){function d(a,b){e.call(this),this._properties=[!1,!0,!1,!1,!1],this._size=a||15e3,this._buffers=null,this._updateStatic=!1,this.interactiveChildren=!1,this.blendMode=f.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(b)}var e=a("../display/Container"),f=a("../const");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.prototype.setProperties=function(a){a&&(this._properties[0]="scale"in a?!!a.scale:this._properties[0],this._properties[1]="position"in a?!!a.position:this._properties[1],this._properties[2]="rotation"in a?!!a.rotation:this._properties[2],this._properties[3]="uvs"in a?!!a.uvs:this._properties[3],this._properties[4]="alpha"in a?!!a.alpha:this._properties[4])},d.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},d.prototype.renderWebGL=function(a){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(a.setObjectRenderer(a.plugins.particle),a.plugins.particle.render(this))},d.prototype.addChildAt=function(a,b){if(a===this)return a;if(b>=0&&b<=this.children.length)return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this._updateStatic=!0,a;throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length)},d.prototype.removeChildAt=function(a){var b=this.getChildAt(a);return b.parent=null,this.children.splice(a,1),this._updateStatic=!0,b},d.prototype.renderCanvas=function(a){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var b=a.context,c=this.worldTransform,d=!0,e=0,f=0,g=0,h=0;b.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var i=0;ic;c+=6,d+=4)this.indices[c+0]=d+0,this.indices[c+1]=d+1,this.indices[c+2]=d+2,this.indices[c+3]=d+0,this.indices[c+4]=d+2,this.indices[c+5]=d+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new i.Matrix}var e=a("../../renderers/webgl/utils/ObjectRenderer"),f=a("../../renderers/webgl/WebGLRenderer"),g=a("./ParticleShader"),h=a("./ParticleBuffer"),i=a("../../math");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,f.registerPlugin("particle",d),d.prototype.onContextChange=function(){var a=this.renderer.gl;this.shader=new g(this.renderer.shaderManager),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,dynamic:!1,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,dynamic:!0,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,dynamic:!1,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,dynamic:!1,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,dynamic:!1,size:1,uploadFunction:this.uploadAlpha,offset:0}]},d.prototype.start=function(){var a=this.renderer.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.shader;this.renderer.shaderManager.setShader(b)},d.prototype.render=function(a){var b=a.children,c=b.length,d=a._size;if(0!==c){c>d&&(c=d),a._buffers||(a._buffers=this.generateBuffers(a)),this.renderer.blendModeManager.setBlendMode(a.blendMode);var e=this.renderer.gl,f=a.worldTransform.copy(this.tempMatrix);f.prepend(this.renderer.currentRenderTarget.projectionMatrix),e.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,f.toArray(!0)),e.uniform1f(this.shader.uniforms.uAlpha._location,a.worldAlpha);var g=a._updateStatic,h=b[0]._texture.baseTexture;if(h._glTextures[e.id])e.bindTexture(e.TEXTURE_2D,h._glTextures[e.id]);else{if(!this.renderer.updateTexture(h))return;this.properties[0].dynamic&&this.properties[3].dynamic||(g=!0)}for(var i=0,j=0;c>j;j+=this.size){var k=c-j;k>this.size&&(k=this.size);var l=a._buffers[i++];l.uploadDynamic(b,j,k),g&&l.uploadStatic(b,j,k),l.bind(this.shader),e.drawElements(e.TRIANGLES,6*k,e.UNSIGNED_SHORT,0),this.renderer.drawCount++}a._updateStatic=!1}},d.prototype.generateBuffers=function(a){var b,c=this.renderer.gl,d=[],e=a._size;for(b=0;bb;b+=this.size)d.push(new h(c,this.properties,this.size,this.shader));return d},d.prototype.uploadVertices=function(a,b,c,d,e,f){for(var g,h,i,j,k,l,m,n,o,p=0;c>p;p++)g=a[b+p],h=g._texture,j=g.scale.x,k=g.scale.y,h.trim?(i=h.trim,m=i.x-g.anchor.x*i.width,l=m+h.crop.width,o=i.y-g.anchor.y*i.height,n=o+h.crop.height):(l=h._frame.width*(1-g.anchor.x),m=h._frame.width*-g.anchor.x,n=h._frame.height*(1-g.anchor.y),o=h._frame.height*-g.anchor.y),d[f]=m*j,d[f+1]=o*k,d[f+e]=l*j,d[f+e+1]=o*k,d[f+2*e]=l*j,d[f+2*e+1]=n*k,d[f+3*e]=m*j,d[f+3*e+1]=n*k,f+=4*e},d.prototype.uploadPosition=function(a,b,c,d,e,f){for(var g=0;c>g;g++){var h=a[b+g].position;d[f]=h.x,d[f+1]=h.y,d[f+e]=h.x,d[f+e+1]=h.y,d[f+2*e]=h.x,d[f+2*e+1]=h.y,d[f+3*e]=h.x,d[f+3*e+1]=h.y,f+=4*e}},d.prototype.uploadRotation=function(a,b,c,d,e,f){for(var g=0;c>g;g++){var h=a[b+g].rotation;d[f]=h,d[f+e]=h,d[f+2*e]=h,d[f+3*e]=h,f+=4*e}},d.prototype.uploadUvs=function(a,b,c,d,e,f){for(var g=0;c>g;g++){var h=a[b+g]._texture._uvs;h?(d[f]=h.x0,d[f+1]=h.y0,d[f+e]=h.x1,d[f+e+1]=h.y1,d[f+2*e]=h.x2,d[f+2*e+1]=h.y2,d[f+3*e]=h.x3,d[f+3*e+1]=h.y3,f+=4*e):(d[f]=0,d[f+1]=0,d[f+e]=0,d[f+e+1]=0,d[f+2*e]=0,d[f+2*e+1]=0,d[f+3*e]=0,d[f+3*e+1]=0,f+=4*e)}},d.prototype.uploadAlpha=function(a,b,c,d,e,f){for(var g=0;c>g;g++){var h=a[b+g].alpha;d[f]=h,d[f+e]=h,d[f+2*e]=h,d[f+3*e]=h,f+=4*e}},d.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),e.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../math":29,"../../renderers/webgl/WebGLRenderer":45,"../../renderers/webgl/utils/ObjectRenderer":59,"./ParticleBuffer":36,"./ParticleShader":38}],38:[function(a,b,c){function d(a){e.call(this,a,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}var e=a("../../renderers/webgl/shaders/TextureShader");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d},{"../../renderers/webgl/shaders/TextureShader":58}],39:[function(a,b,c){function d(a,b,c,d){if(h.call(this),e.sayHello(a),d)for(var i in g.DEFAULT_RENDER_OPTIONS)"undefined"==typeof d[i]&&(d[i]=g.DEFAULT_RENDER_OPTIONS[i]);else d=g.DEFAULT_RENDER_OPTIONS;this.type=g.RENDERER_TYPE.UNKNOWN,this.width=b||800,this.height=c||600,this.view=d.view||document.createElement("canvas"),this.resolution=d.resolution,this.transparent=d.transparent,this.autoResize=d.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=d.preserveDrawingBuffer,this.clearBeforeRender=d.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=d.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new f.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var e=a("../utils"),f=a("../math"),g=a("../const"),h=a("eventemitter3");d.prototype=Object.create(h.prototype),d.prototype.constructor=d,b.exports=d,Object.defineProperties(d.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(a){this._backgroundColor=a,this._backgroundColorString=e.hex2string(a),e.hex2rgb(a,this._backgroundColorRgb)}}}),d.prototype.resize=function(a,b){this.width=a*this.resolution,this.height=b*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px", +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.PIXI=a()}}(function(){var a;return function b(a,c,d){function e(g,h){if(!c[g]){if(!a[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};a[g][0].call(k.exports,function(b){var c=a[g][1][b];return e(c?c:b)},k,k.exports,b,a,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=0;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c--;c)a.unshift("..");return a}function d(a,b){if(a.filter)return a.filter(b);for(var c=[],d=0;d=-1&&!e;f--){var g=f>=0?arguments[f]:a.cwd();if("string"!=typeof g)throw new TypeError("Arguments to path.resolve must be strings");g&&(c=g+"/"+c,e="/"===g.charAt(0))}return c=b(d(c.split("/"),function(a){return!!a}),!e).join("/"),(e?"/":"")+c||"."},c.normalize=function(a){var e=c.isAbsolute(a),f="/"===g(a,-1);return a=b(d(a.split("/"),function(a){return!!a}),!e).join("/"),a||e||(a="."),a&&f&&(a+="/"),(e?"/":"")+a},c.isAbsolute=function(a){return"/"===a.charAt(0)},c.join=function(){var a=Array.prototype.slice.call(arguments,0);return c.normalize(d(a,function(a,b){if("string"!=typeof a)throw new TypeError("Arguments to path.join must be strings");return a}).join("/"))},c.relative=function(a,b){function d(a){for(var b=0;b=0&&""===a[c];c--);return b>c?[]:a.slice(b,c-b+1)}a=c.resolve(a).substr(1),b=c.resolve(b).substr(1);for(var e=d(a.split("/")),f=d(b.split("/")),g=Math.min(e.length,f.length),h=g,i=0;g>i;i++)if(e[i]!==f[i]){h=i;break}for(var j=[],i=h;ib&&(b=a.length+b),a.substr(b,c)}}).call(this,a("_process"))},{_process:2}],2:[function(a,b,c){function d(){if(!h){h=!0;for(var a,b=g.length;b;){a=g,g=[];for(var c=-1;++ce;)b=a.charCodeAt(e++),b>=55296&&56319>=b&&f>e?(c=a.charCodeAt(e++),56320==(64512&c)?d.push(((1023&b)<<10)+(1023&c)+65536):(d.push(b),e--)):d.push(b);return d}function j(a){return g(a,function(a){var b="";return a>65535&&(a-=65536,b+=L(a>>>10&1023|55296),a=56320|1023&a),b+=L(a)}).join("")}function k(a){return 10>a-48?a-22:26>a-65?a-65:26>a-97?a-97:x}function l(a,b){return a+22+75*(26>a)-((0!=b)<<5)}function m(a,b,c){var d=0;for(a=c?K(a/B):a>>1,a+=K(a/b);a>J*z>>1;d+=x)a=K(a/J);return K(d+(J+1)*a/(a+A))}function n(a){var b,c,d,e,g,h,i,l,n,o,p=[],q=a.length,r=0,s=D,t=C;for(c=a.lastIndexOf(E),0>c&&(c=0),d=0;c>d;++d)a.charCodeAt(d)>=128&&f("not-basic"),p.push(a.charCodeAt(d));for(e=c>0?c+1:0;q>e;){for(g=r,h=1,i=x;e>=q&&f("invalid-input"),l=k(a.charCodeAt(e++)),(l>=x||l>K((w-r)/h))&&f("overflow"),r+=l*h,n=t>=i?y:i>=t+z?z:i-t,!(n>l);i+=x)o=x-n,h>K(w/o)&&f("overflow"),h*=o;b=p.length+1,t=m(r-g,b,0==g),K(r/b)>w-s&&f("overflow"),s+=K(r/b),r%=b,p.splice(r++,0,s)}return j(p)}function o(a){var b,c,d,e,g,h,j,k,n,o,p,q,r,s,t,u=[];for(a=i(a),q=a.length,b=D,c=0,g=C,h=0;q>h;++h)p=a[h],128>p&&u.push(L(p));for(d=e=u.length,e&&u.push(E);q>d;){for(j=w,h=0;q>h;++h)p=a[h],p>=b&&j>p&&(j=p);for(r=d+1,j-b>K((w-c)/r)&&f("overflow"),c+=(j-b)*r,b=j,h=0;q>h;++h)if(p=a[h],b>p&&++c>w&&f("overflow"),p==b){for(k=c,n=x;o=g>=n?y:n>=g+z?z:n-g,!(o>k);n+=x)t=k-o,s=x-o,u.push(L(l(o+t%s,0))),k=K(t/s);u.push(L(l(k,0))),g=m(c,r,d==e),c=0,++d}++c,++b}return u.join("")}function p(a){return h(a,function(a){return F.test(a)?n(a.slice(4).toLowerCase()):a})}function q(a){return h(a,function(a){return G.test(a)?"xn--"+o(a):a})}var r="object"==typeof d&&d,s="object"==typeof c&&c&&c.exports==r&&c,t="object"==typeof b&&b;(t.global===t||t.window===t)&&(e=t);var u,v,w=2147483647,x=36,y=1,z=26,A=38,B=700,C=72,D=128,E="-",F=/^xn--/,G=/[^ -~]/,H=/\x2E|\u3002|\uFF0E|\uFF61/g,I={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},J=x-y,K=Math.floor,L=String.fromCharCode;if(u={version:"1.2.4",ucs2:{decode:i,encode:j},decode:n,encode:o,toASCII:q,toUnicode:p},"function"==typeof a&&"object"==typeof a.amd&&a.amd)a("punycode",function(){return u});else if(r&&!r.nodeType)if(s)s.exports=u;else for(v in u)u.hasOwnProperty(v)&&(r[v]=u[v]);else e.punycode=u}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(a,b,c){"use strict";function d(a,b){return Object.prototype.hasOwnProperty.call(a,b)}b.exports=function(a,b,c,f){b=b||"&",c=c||"=";var g={};if("string"!=typeof a||0===a.length)return g;var h=/\+/g;a=a.split(b);var i=1e3;f&&"number"==typeof f.maxKeys&&(i=f.maxKeys);var j=a.length;i>0&&j>i&&(j=i);for(var k=0;j>k;++k){var l,m,n,o,p=a[k].replace(h,"%20"),q=p.indexOf(c);q>=0?(l=p.substr(0,q),m=p.substr(q+1)):(l=p,m=""),n=decodeURIComponent(l),o=decodeURIComponent(m),d(g,n)?e(g[n])?g[n].push(o):g[n]=[g[n],o]:g[n]=o}return g};var e=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)}},{}],5:[function(a,b,c){"use strict";function d(a,b){if(a.map)return a.map(b);for(var c=[],d=0;d",'"',"`"," ","\r","\n"," "],q=["{","}","|","\\","^","`"].concat(p),r=["'"].concat(q),s=["%","/","?",";","#"].concat(r),t=["/","?","#"],u=255,v=/^[a-z0-9A-Z_-]{0,63}$/,w=/^([a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},z={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},A=a("querystring");d.prototype.parse=function(a,b,c){if(!i(a))throw new TypeError("Parameter 'url' must be a string, not "+typeof a);var d=a;d=d.trim();var e=n.exec(d);if(e){e=e[0];var f=e.toLowerCase();this.protocol=f,d=d.substr(e.length)}if(c||e||d.match(/^\/\/[^@\/]+@[^@\/]+/)){var g="//"===d.substr(0,2);!g||e&&y[e]||(d=d.substr(2),this.slashes=!0)}if(!y[e]&&(g||e&&!z[e])){for(var h=-1,j=0;jk)&&(h=k)}var l,o;o=-1===h?d.lastIndexOf("@"):d.lastIndexOf("@",h),-1!==o&&(l=d.slice(0,o),d=d.slice(o+1),this.auth=decodeURIComponent(l)),h=-1;for(var j=0;jk)&&(h=k)}-1===h&&(h=d.length),this.host=d.slice(0,h),d=d.slice(h),this.parseHost(),this.hostname=this.hostname||"";var p="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!p)for(var q=this.hostname.split(/\./),j=0,B=q.length;B>j;j++){var C=q[j];if(C&&!C.match(v)){for(var D="",E=0,F=C.length;F>E;E++)D+=C.charCodeAt(E)>127?"x":C[E];if(!D.match(v)){var G=q.slice(0,j),H=q.slice(j+1),I=C.match(w);I&&(G.push(I[1]),H.unshift(I[2])),H.length&&(d="/"+H.join(".")+d),this.hostname=G.join(".");break}}}if(this.hostname=this.hostname.length>u?"":this.hostname.toLowerCase(),!p){for(var J=this.hostname.split("."),K=[],j=0;jj;j++){var O=r[j],P=encodeURIComponent(O);P===O&&(P=escape(O)),d=d.split(O).join(P)}var Q=d.indexOf("#");-1!==Q&&(this.hash=d.substr(Q),d=d.slice(0,Q));var R=d.indexOf("?");if(-1!==R?(this.search=d.substr(R),this.query=d.substr(R+1),b&&(this.query=A.parse(this.query)),d=d.slice(0,R)):b&&(this.search="",this.query={}),d&&(this.pathname=d),z[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var M=this.pathname||"",L=this.search||"";this.path=M+L}return this.href=this.format(),this},d.prototype.format=function(){var a=this.auth||"";a&&(a=encodeURIComponent(a),a=a.replace(/%3A/i,":"),a+="@");var b=this.protocol||"",c=this.pathname||"",d=this.hash||"",e=!1,f="";this.host?e=a+this.host:this.hostname&&(e=a+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(e+=":"+this.port)),this.query&&j(this.query)&&Object.keys(this.query).length&&(f=A.stringify(this.query));var g=this.search||f&&"?"+f||"";return b&&":"!==b.substr(-1)&&(b+=":"),this.slashes||(!b||z[b])&&e!==!1?(e="//"+(e||""),c&&"/"!==c.charAt(0)&&(c="/"+c)):e||(e=""),d&&"#"!==d.charAt(0)&&(d="#"+d),g&&"?"!==g.charAt(0)&&(g="?"+g),c=c.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),g=g.replace("#","%23"),b+e+c+g+d},d.prototype.resolve=function(a){return this.resolveObject(e(a,!1,!0)).format()},d.prototype.resolveObject=function(a){if(i(a)){var b=new d;b.parse(a,!1,!0),a=b}var c=new d;if(Object.keys(this).forEach(function(a){c[a]=this[a]},this),c.hash=a.hash,""===a.href)return c.href=c.format(),c;if(a.slashes&&!a.protocol)return Object.keys(a).forEach(function(b){"protocol"!==b&&(c[b]=a[b])}),z[c.protocol]&&c.hostname&&!c.pathname&&(c.path=c.pathname="/"),c.href=c.format(),c;if(a.protocol&&a.protocol!==c.protocol){if(!z[a.protocol])return Object.keys(a).forEach(function(b){c[b]=a[b]}),c.href=c.format(),c;if(c.protocol=a.protocol,a.host||y[a.protocol])c.pathname=a.pathname;else{for(var e=(a.pathname||"").split("/");e.length&&!(a.host=e.shift()););a.host||(a.host=""),a.hostname||(a.hostname=""),""!==e[0]&&e.unshift(""),e.length<2&&e.unshift(""),c.pathname=e.join("/")}if(c.search=a.search,c.query=a.query,c.host=a.host||"",c.auth=a.auth,c.hostname=a.hostname||a.host,c.port=a.port,c.pathname||c.search){var f=c.pathname||"",g=c.search||"";c.path=f+g}return c.slashes=c.slashes||a.slashes,c.href=c.format(),c}var h=c.pathname&&"/"===c.pathname.charAt(0),j=a.host||a.pathname&&"/"===a.pathname.charAt(0),m=j||h||c.host&&a.pathname,n=m,o=c.pathname&&c.pathname.split("/")||[],e=a.pathname&&a.pathname.split("/")||[],p=c.protocol&&!z[c.protocol];if(p&&(c.hostname="",c.port=null,c.host&&(""===o[0]?o[0]=c.host:o.unshift(c.host)),c.host="",a.protocol&&(a.hostname=null,a.port=null,a.host&&(""===e[0]?e[0]=a.host:e.unshift(a.host)),a.host=null),m=m&&(""===e[0]||""===o[0])),j)c.host=a.host||""===a.host?a.host:c.host,c.hostname=a.hostname||""===a.hostname?a.hostname:c.hostname,c.search=a.search,c.query=a.query,o=e;else if(e.length)o||(o=[]),o.pop(),o=o.concat(e),c.search=a.search,c.query=a.query;else if(!l(a.search)){if(p){c.hostname=c.host=o.shift();var q=c.host&&c.host.indexOf("@")>0?c.host.split("@"):!1;q&&(c.auth=q.shift(),c.host=c.hostname=q.shift())}return c.search=a.search,c.query=a.query,k(c.pathname)&&k(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.href=c.format(),c}if(!o.length)return c.pathname=null,c.path=c.search?"/"+c.search:null,c.href=c.format(),c;for(var r=o.slice(-1)[0],s=(c.host||a.host)&&("."===r||".."===r)||""===r,t=0,u=o.length;u>=0;u--)r=o[u],"."==r?o.splice(u,1):".."===r?(o.splice(u,1),t++):t&&(o.splice(u,1),t--);if(!m&&!n)for(;t--;t)o.unshift("..");!m||""===o[0]||o[0]&&"/"===o[0].charAt(0)||o.unshift(""),s&&"/"!==o.join("/").substr(-1)&&o.push("");var v=""===o[0]||o[0]&&"/"===o[0].charAt(0);if(p){c.hostname=c.host=v?"":o.length?o.shift():"";var q=c.host&&c.host.indexOf("@")>0?c.host.split("@"):!1;q&&(c.auth=q.shift(),c.host=c.hostname=q.shift())}return m=m||c.host&&o.length,m&&!v&&o.unshift(""),o.length?c.pathname=o.join("/"):(c.pathname=null,c.path=null),k(c.pathname)&&k(c.search)||(c.path=(c.pathname?c.pathname:"")+(c.search?c.search:"")),c.auth=a.auth||c.auth,c.slashes=c.slashes||a.slashes,c.href=c.format(),c},d.prototype.parseHost=function(){var a=this.host,b=o.exec(a);b&&(b=b[0],":"!==b&&(this.port=b.substr(1)),a=a.substr(0,a.length-b.length)),a&&(this.hostname=a)}},{punycode:3,querystring:6}],8:[function(b,c,d){(function(b){!function(){function d(a){var b=!1;return function(){if(b)throw new Error("Callback was already called.");b=!0,a.apply(e,arguments)}}var e,f,g={};e=this,null!=e&&(f=e.async),g.noConflict=function(){return e.async=f,g};var h=Object.prototype.toString,i=Array.isArray||function(a){return"[object Array]"===h.call(a)},j=function(a,b){for(var c=0;c=a.length&&c())}if(c=c||function(){},!a.length)return c();var f=0;j(a,function(a){b(a,d(e))})},g.forEach=g.each,g.eachSeries=function(a,b,c){if(c=c||function(){},!a.length)return c();var d=0,e=function(){b(a[d],function(b){b?(c(b),c=function(){}):(d+=1,d>=a.length?c():e())})};e()},g.forEachSeries=g.eachSeries,g.eachLimit=function(a,b,c,d){var e=n(b);e.apply(null,[a,c,d])},g.forEachLimit=g.eachLimit;var n=function(a){return function(b,c,d){if(d=d||function(){},!b.length||0>=a)return d();var e=0,f=0,g=0;!function h(){if(e>=b.length)return d();for(;a>g&&f=b.length?d():h())})}()}},o=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[g.each].concat(b))}},p=function(a,b){return function(){var c=Array.prototype.slice.call(arguments);return b.apply(null,[n(a)].concat(c))}},q=function(a){return function(){var b=Array.prototype.slice.call(arguments);return a.apply(null,[g.eachSeries].concat(b))}},r=function(a,b,c,d){if(b=k(b,function(a,b){return{index:b,value:a}}),d){var e=[];a(b,function(a,b){c(a.value,function(c,d){e[a.index]=d,b(c)})},function(a){d(a,e)})}else a(b,function(a,b){c(a.value,function(a){b(a)})})};g.map=o(r),g.mapSeries=q(r),g.mapLimit=function(a,b,c,d){return s(b)(a,c,d)};var s=function(a){return p(a,r)};g.reduce=function(a,b,c,d){g.eachSeries(a,function(a,d){c(b,a,function(a,c){b=c,d(a)})},function(a){d(a,b)})},g.inject=g.reduce,g.foldl=g.reduce,g.reduceRight=function(a,b,c,d){var e=k(a,function(a){return a}).reverse();g.reduce(e,b,c,d)},g.foldr=g.reduceRight;var t=function(a,b,c,d){var e=[];b=k(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c&&e.push(a),b()})},function(a){d(k(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};g.filter=o(t),g.filterSeries=q(t),g.select=g.filter,g.selectSeries=g.filterSeries;var u=function(a,b,c,d){var e=[];b=k(b,function(a,b){return{index:b,value:a}}),a(b,function(a,b){c(a.value,function(c){c||e.push(a),b()})},function(a){d(k(e.sort(function(a,b){return a.index-b.index}),function(a){return a.value}))})};g.reject=o(u),g.rejectSeries=q(u);var v=function(a,b,c,d){a(b,function(a,b){c(a,function(c){c?(d(a),d=function(){}):b()})},function(a){d()})};g.detect=o(v),g.detectSeries=q(v),g.some=function(a,b,c){g.each(a,function(a,d){b(a,function(a){a&&(c(!0),c=function(){}),d()})},function(a){c(!1)})},g.any=g.some,g.every=function(a,b,c){g.each(a,function(a,d){b(a,function(a){a||(c(!1),c=function(){}),d()})},function(a){c(!0)})},g.all=g.every,g.sortBy=function(a,b,c){g.map(a,function(a,c){b(a,function(b,d){b?c(b):c(null,{value:a,criteria:d})})},function(a,b){if(a)return c(a);var d=function(a,b){var c=a.criteria,d=b.criteria;return d>c?-1:c>d?1:0};c(null,k(b.sort(d),function(a){return a.value}))})},g.auto=function(a,b){b=b||function(){};var c=m(a),d=c.length;if(!d)return b();var e={},f=[],h=function(a){f.unshift(a)},k=function(a){for(var b=0;bd;){var f=d+(e-d+1>>>1);c(b,a[f])>=0?d=f:e=f-1}return d}function e(a,b,e,f){return a.started||(a.started=!0),i(b)||(b=[b]),0==b.length?g.setImmediate(function(){a.drain&&a.drain()}):void j(b,function(b){var h={data:b,priority:e,callback:"function"==typeof f?f:null};a.tasks.splice(d(a.tasks,h,c)+1,0,h),a.saturated&&a.tasks.length===a.concurrency&&a.saturated(),g.setImmediate(a.process)})}var f=g.queue(a,b);return f.push=function(a,b,c){e(f,a,b,c)},delete f.unshift,f},g.cargo=function(a,b){var c=!1,d=[],e={tasks:d,payload:b,saturated:null,empty:null,drain:null,drained:!0,push:function(a,c){i(a)||(a=[a]),j(a,function(a){d.push({data:a,callback:"function"==typeof c?c:null}),e.drained=!1,e.saturated&&d.length===b&&e.saturated()}),g.setImmediate(e.process)},process:function f(){if(!c){if(0===d.length)return e.drain&&!e.drained&&e.drain(),void(e.drained=!0);var g="number"==typeof b?d.splice(0,b):d.splice(0,d.length),h=k(g,function(a){return a.data});e.empty&&e.empty(),c=!0,a(h,function(){c=!1;var a=arguments;j(g,function(b){b.callback&&b.callback.apply(null,a)}),f()})}},length:function(){return d.length},running:function(){return c}};return e};var y=function(a){return function(b){var c=Array.prototype.slice.call(arguments,1);b.apply(null,c.concat([function(b){var c=Array.prototype.slice.call(arguments,1);"undefined"!=typeof console&&(b?console.error:console[a]&&j(c,function(a){}))}]))}};g.log=y("log"),g.dir=y("dir"),g.memoize=function(a,b){var c={},d={};b=b||function(a){return a};var e=function(){var e=Array.prototype.slice.call(arguments),f=e.pop(),h=b.apply(null,e);h in c?g.nextTick(function(){f.apply(null,c[h])}):h in d?d[h].push(f):(d[h]=[f],a.apply(null,e.concat([function(){c[h]=arguments;var a=d[h];delete d[h];for(var b=0,e=a.length;e>b;b++)a[b].apply(null,arguments)}])))};return e.memo=c,e.unmemoized=a,e},g.unmemoize=function(a){return function(){return(a.unmemoized||a).apply(null,arguments)}},g.times=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return g.map(d,b,c)},g.timesSeries=function(a,b,c){for(var d=[],e=0;a>e;e++)d.push(e);return g.mapSeries(d,b,c)},g.seq=function(){var a=arguments;return function(){var b=this,c=Array.prototype.slice.call(arguments),d=c.pop();g.reduce(a,c,function(a,c,d){c.apply(b,a.concat([function(){var a=arguments[0],b=Array.prototype.slice.call(arguments,1);d(a,b)}]))},function(a,c){d.apply(b,[a].concat(c))})}},g.compose=function(){return g.seq.apply(null,Array.prototype.reverse.call(arguments))};var z=function(a,b){var c=function(){var c=this,d=Array.prototype.slice.call(arguments),e=d.pop();return a(b,function(a,b){a.apply(c,d.concat([b]))},e)};if(arguments.length>2){var d=Array.prototype.slice.call(arguments,2);return c.apply(this,d)}return c};g.applyEach=o(z),g.applyEachSeries=q(z),g.forever=function(a,b){function c(d){if(d){if(b)return b(d);throw d}a(c)}c()},"undefined"!=typeof c&&c.exports?c.exports=g:"undefined"!=typeof a&&a.amd?a([],function(){return g}):e.async=g}()}).call(this,b("_process"))},{_process:2}],9:[function(a,b,c){"use strict";function d(a,b,c){c=c||2;var d=b&&b.length,h=d?b[0]*c:a.length,i=f(a,e(a,0,h,c,!0)),j=[];if(!i)return j;var l,m,n,o,p,q,r;if(d&&(i=k(a,b,i,c)),a.length>80*c){l=n=a[0],m=o=a[1];for(var s=c;h>s;s+=c)p=a[s],q=a[s+1],l>p&&(l=p),m>q&&(m=q),p>n&&(n=p),q>o&&(o=q);r=Math.max(n-l,o-m)}return g(a,i,j,c,l,m,r),j}function e(a,b,c,d,e){var f,g,h,i=0;for(f=b,g=c-d;c>f;f+=d)i+=(a[g]-a[f])*(a[f+1]+a[g+1]),g=f;if(e===i>0)for(f=b;c>f;f+=d)h=z(f,h);else for(f=c-d;f>=b;f-=d)h=z(f,h);return h}function f(a,b,c){c||(c=b);var d,e=b;do if(d=!1,e.steiner||!t(a,e.i,e.next.i)&&0!==s(a,e.prev.i,e.i,e.next.i))e=e.next;else{if(e.prev.next=e.next,e.next.prev=e.prev,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ),e=c=e.prev,e===e.next)return null;d=!0}while(d||e!==c);return c}function g(a,b,c,d,e,k,l,m){if(b){m||void 0===e||n(a,b,e,k,l);for(var o,p,q=b;b.prev!==b.next;)if(o=b.prev,p=b.next,h(a,b,e,k,l))c.push(o.i/d),c.push(b.i/d),c.push(p.i/d),p.prev=o,o.next=p,b.prevZ&&(b.prevZ.nextZ=b.nextZ),b.nextZ&&(b.nextZ.prevZ=b.prevZ),b=p.next,q=p.next;else if(b=p,b===q){m?1===m?(b=i(a,b,c,d),g(a,b,c,d,e,k,l,2)):2===m&&j(a,b,c,d,e,k,l):g(a,f(a,b),c,d,e,k,l,1);break}}}function h(a,b,c,d,e){var f=b.prev.i,g=b.i,h=b.next.i,i=a[f],j=a[f+1],k=a[g],l=a[g+1],m=a[h],n=a[h+1],o=i*l-j*k,q=i*n-j*m,r=m*l-n*k,s=o-q-r;if(0>=s)return!1;var t,u,v,w,x,y,z,A=n-j,B=i-m,C=j-l,D=k-i;if(void 0!==c){var E=k>i?m>i?i:m:m>k?k:m,F=l>j?n>j?j:n:n>l?l:n,G=i>k?i>m?i:m:k>m?k:m,H=j>l?j>n?j:n:l>n?l:n,I=p(E,F,c,d,e),J=p(G,H,c,d,e);for(z=b.nextZ;z&&z.z<=J;)if(t=z.i,z=z.nextZ,t!==f&&t!==h&&(u=a[t],v=a[t+1],w=A*u+B*v-q,w>=0&&(x=C*u+D*v+o,x>=0&&(y=s-w-x,y>=0&&(w&&x||w&&y||x&&y)))))return!1;for(z=b.prevZ;z&&z.z>=I;)if(t=z.i,z=z.prevZ,t!==f&&t!==h&&(u=a[t],v=a[t+1],w=A*u+B*v-q,w>=0&&(x=C*u+D*v+o,x>=0&&(y=s-w-x,y>=0&&(w&&x||w&&y||x&&y)))))return!1}else for(z=b.next.next;z!==b.prev;)if(t=z.i,z=z.next,u=a[t],v=a[t+1],w=A*u+B*v-q,w>=0&&(x=C*u+D*v+o,x>=0&&(y=s-w-x,y>=0&&(w&&x||w&&y||x&&y))))return!1;return!0}function i(a,b,c,d){var e=b;do{var f=e.prev,g=e.next.next;if(f.i!==g.i&&u(a,f.i,e.i,e.next.i,g.i)&&w(a,f,g)&&w(a,g,f)){c.push(f.i/d),c.push(e.i/d),c.push(g.i/d),f.next=g,g.prev=f;var h=e.prevZ,i=e.nextZ&&e.nextZ.nextZ;h&&(h.nextZ=i),i&&(i.prevZ=h),e=b=g}e=e.next}while(e!==b);return e}function j(a,b,c,d,e,h,i){var j=b;do{for(var k=j.next.next;k!==j.prev;){if(j.i!==k.i&&r(a,j,k)){var l=y(j,k);return j=f(a,j,j.next),l=f(a,l,l.next),g(a,j,c,d,e,h,i),void g(a,l,c,d,e,h,i)}k=k.next}j=j.next}while(j!==b)}function k(a,b,c,d){var g,h,i,j,k,m=[];for(g=0,h=b.length;h>g;g++)i=b[g]*d,j=h-1>g?b[g+1]*d:a.length,k=e(a,i,j,d,!1),k===k.next&&(k.steiner=!0),k=f(a,k),k&&m.push(q(a,k));for(m.sort(function(b,c){return a[b.i]-a[c.i]}),g=0;g=a[f+1]){var l=a[e]+(j-a[e+1])*(a[f]-a[e])/(a[f+1]-a[e+1]);i>=l&&l>k&&(k=l,d=a[e]=B?-1:1,D=d,E=1/0;for(g=d.next;g!==D;)m=a[g.i],n=a[g.i+1],o=i-m,o>=0&&m>=s&&(p=(x*m+y*n-v)*C,p>=0&&(q=(z*m+A*n+u)*C,q>=0&&B*C-p-q>=0&&(r=Math.abs(j-n)/o,E>r&&w(a,g,b)&&(d=g,E=r)))),g=g.next;return d}function n(a,b,c,d,e){var f=b;do null===f.z&&(f.z=p(a[f.i],a[f.i+1],c,d,e)),f.prevZ=f.prev,f.nextZ=f.next,f=f.next;while(f!==b);f.prevZ.nextZ=null,f.prevZ=null,o(f)}function o(a){var b,c,d,e,f,g,h,i,j=1;do{for(c=a,a=null,f=null,g=0;c;){for(g++,d=c,h=0,b=0;j>b&&(h++,d=d.nextZ,d);b++);for(i=j;h>0||i>0&&d;)0===h?(e=d,d=d.nextZ,i--):0!==i&&d?c.z<=d.z?(e=c,c=c.nextZ,h--):(e=d,d=d.nextZ,i--):(e=c,c=c.nextZ,h--),f?f.nextZ=e:a=e,e.prevZ=f,f=e;c=d}f.nextZ=null,j*=2}while(g>1);return a}function p(a,b,c,d,e){return a=1e3*(a-c)/e,a=16711935&(a|a<<8),a=252645135&(a|a<<4),a=858993459&(a|a<<2),a=1431655765&(a|a<<1),b=1e3*(b-d)/e,b=16711935&(b|b<<8),b=252645135&(b|b<<4),b=858993459&(b|b<<2),b=1431655765&(b|b<<1),a|b<<1}function q(a,b){var c=b,d=b;do a[c.i]0?1:0>e?-1:0}function t(a,b,c){return a[b]===a[c]&&a[b+1]===a[c+1]}function u(a,b,c,d,e){return s(a,b,c,d)!==s(a,b,c,e)&&s(a,d,e,b)!==s(a,d,e,c)}function v(a,b,c,d){var e=b;do{var f=e.i,g=e.next.i;if(f!==c&&g!==c&&f!==d&&g!==d&&u(a,f,g,c,d))return!0;e=e.next}while(e!==b);return!1}function w(a,b,c){return-1===s(a,b.prev.i,b.i,b.next.i)?-1!==s(a,b.i,c.i,b.next.i)&&-1!==s(a,b.i,b.prev.i,c.i):-1===s(a,b.i,c.i,b.prev.i)||-1===s(a,b.i,b.next.i,c.i)}function x(a,b,c,d){var e=b,f=!1,g=(a[c]+a[d])/2,h=(a[c+1]+a[d+1])/2;do{var i=e.i,j=e.next.i;a[i+1]>h!=a[j+1]>h&&g<(a[j]-a[i])*(h-a[i+1])/(a[j+1]-a[i+1])+a[i]&&(f=!f),e=e.next}while(e!==b);return f}function y(a,b){var c=new A(a.i),d=new A(b.i),e=a.next,f=b.prev;return a.next=b,b.prev=a,c.next=e,e.prev=c,d.next=c,c.prev=d,f.next=d,d.prev=f,d}function z(a,b){var c=new A(a);return b?(c.next=b.next,c.prev=b,b.next.prev=c,b.next=c):(c.prev=c,c.next=c),c}function A(a){this.i=a,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}b.exports=d},{}],10:[function(a,b,c){"use strict";function d(a,b,c){this.fn=a,this.context=b,this.once=c||!1}function e(){}var f="function"!=typeof Object.create?"~":!1;e.prototype._events=void 0,e.prototype.listeners=function(a,b){var c=f?f+a:a,d=this._events&&this._events[c];if(b)return!!d;if(!d)return[];if(d.fn)return[d.fn];for(var e=0,g=d.length,h=new Array(g);g>e;e++)h[e]=d[e].fn; + +return h},e.prototype.emit=function(a,b,c,d,e,g){var h=f?f+a:a;if(!this._events||!this._events[h])return!1;var i,j,k=this._events[h],l=arguments.length;if("function"==typeof k.fn){switch(k.once&&this.removeListener(a,k.fn,void 0,!0),l){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,b),!0;case 3:return k.fn.call(k.context,b,c),!0;case 4:return k.fn.call(k.context,b,c,d),!0;case 5:return k.fn.call(k.context,b,c,d,e),!0;case 6:return k.fn.call(k.context,b,c,d,e,g),!0}for(j=1,i=new Array(l-1);l>j;j++)i[j-1]=arguments[j];k.fn.apply(k.context,i)}else{var m,n=k.length;for(j=0;n>j;j++)switch(k[j].once&&this.removeListener(a,k[j].fn,void 0,!0),l){case 1:k[j].fn.call(k[j].context);break;case 2:k[j].fn.call(k[j].context,b);break;case 3:k[j].fn.call(k[j].context,b,c);break;default:if(!i)for(m=1,i=new Array(l-1);l>m;m++)i[m-1]=arguments[m];k[j].fn.apply(k[j].context,i)}}return!0},e.prototype.on=function(a,b,c){var e=new d(b,c||this),g=f?f+a:a;return this._events||(this._events=f?{}:Object.create(null)),this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],e]:this._events[g].push(e):this._events[g]=e,this},e.prototype.once=function(a,b,c){var e=new d(b,c||this,!0),g=f?f+a:a;return this._events||(this._events=f?{}:Object.create(null)),this._events[g]?this._events[g].fn?this._events[g]=[this._events[g],e]:this._events[g].push(e):this._events[g]=e,this},e.prototype.removeListener=function(a,b,c,d){var e=f?f+a:a;if(!this._events||!this._events[e])return this;var g=this._events[e],h=[];if(b)if(g.fn)(g.fn!==b||d&&!g.once||c&&g.context!==c)&&h.push(g);else for(var i=0,j=g.length;j>i;i++)(g[i].fn!==b||d&&!g[i].once||c&&g[i].context!==c)&&h.push(g[i]);return h.length?this._events[e]=1===h.length?h[0]:h:delete this._events[e],this},e.prototype.removeAllListeners=function(a){return this._events?(a?delete this._events[f?f+a:a]:this._events=f?{}:Object.create(null),this):this},e.prototype.off=e.prototype.removeListener,e.prototype.addListener=e.prototype.on,e.prototype.setMaxListeners=function(){return this},e.prefixed=f,"undefined"!=typeof b&&(b.exports=e)},{}],11:[function(a,b,c){"use strict";function d(a){if(null==a)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(a)}b.exports=Object.assign||function(a,b){for(var c,e,f=d(a),g=1;g0)if(this.xhrType===d.XHR_RESPONSE_TYPE.TEXT)this.data=a.responseText;else if(this.xhrType===d.XHR_RESPONSE_TYPE.JSON)try{this.data=JSON.parse(a.responseText),this.isJson=!0}catch(c){this.error=new Error("Error trying to parse loaded json:",c)}else if(this.xhrType===d.XHR_RESPONSE_TYPE.DOCUMENT)try{if(window.DOMParser){var e=new DOMParser;this.data=e.parseFromString(a.responseText,"text/xml")}else{var f=document.createElement("div");f.innerHTML=a.responseText,this.data=f}this.isXml=!0}catch(c){this.error=new Error("Error trying to parse loaded xml:",c)}else this.data=a.response||a.responseText;else this.error=new Error("["+a.status+"]"+a.statusText+":"+a.responseURL);this.complete()},d.prototype._determineCrossOrigin=function(a,b){if(0===a.indexOf("data:"))return"";b=b||window.location,j||(j=document.createElement("a")),j.href=a,a=h.parse(j.href);var c=!a.port&&""===b.port||a.port===b.port;return a.hostname===b.hostname&&c&&a.protocol===b.protocol?"":"anonymous"},d.prototype._determineXhrType=function(){return d._xhrTypeMap[this._getExtension()]||d.XHR_RESPONSE_TYPE.TEXT},d.prototype._determineLoadType=function(){return d._loadTypeMap[this._getExtension()]||d.LOAD_TYPE.XHR},d.prototype._getExtension=function(){var a,b=this.url;if(this.isDataUrl){var c=b.indexOf("/");a=b.substring(c+1,b.indexOf(";",c))}else{var d=b.indexOf("?");-1!==d&&(b=b.substring(0,d)),a=b.substring(b.lastIndexOf(".")+1)}return a},d.prototype._getMimeFromXhrType=function(a){switch(a){case d.XHR_RESPONSE_TYPE.BUFFER:return"application/octet-binary";case d.XHR_RESPONSE_TYPE.BLOB:return"application/blob";case d.XHR_RESPONSE_TYPE.DOCUMENT:return"application/xml";case d.XHR_RESPONSE_TYPE.JSON:return"application/json";case d.XHR_RESPONSE_TYPE.DEFAULT:case d.XHR_RESPONSE_TYPE.TEXT:default:return"text/plain"}},d.LOAD_TYPE={XHR:1,IMAGE:2,AUDIO:3,VIDEO:4},d.XHR_READY_STATE={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},d.XHR_RESPONSE_TYPE={DEFAULT:"text",BUFFER:"arraybuffer",BLOB:"blob",DOCUMENT:"document",JSON:"json",TEXT:"text"},d._loadTypeMap={gif:d.LOAD_TYPE.IMAGE,png:d.LOAD_TYPE.IMAGE,bmp:d.LOAD_TYPE.IMAGE,jpg:d.LOAD_TYPE.IMAGE,jpeg:d.LOAD_TYPE.IMAGE,tif:d.LOAD_TYPE.IMAGE,tiff:d.LOAD_TYPE.IMAGE,webp:d.LOAD_TYPE.IMAGE,tga:d.LOAD_TYPE.IMAGE},d._xhrTypeMap={xhtml:d.XHR_RESPONSE_TYPE.DOCUMENT,html:d.XHR_RESPONSE_TYPE.DOCUMENT,htm:d.XHR_RESPONSE_TYPE.DOCUMENT,xml:d.XHR_RESPONSE_TYPE.DOCUMENT,tmx:d.XHR_RESPONSE_TYPE.DOCUMENT,tsx:d.XHR_RESPONSE_TYPE.DOCUMENT,svg:d.XHR_RESPONSE_TYPE.DOCUMENT,gif:d.XHR_RESPONSE_TYPE.BLOB,png:d.XHR_RESPONSE_TYPE.BLOB,bmp:d.XHR_RESPONSE_TYPE.BLOB,jpg:d.XHR_RESPONSE_TYPE.BLOB,jpeg:d.XHR_RESPONSE_TYPE.BLOB,tif:d.XHR_RESPONSE_TYPE.BLOB,tiff:d.XHR_RESPONSE_TYPE.BLOB,webp:d.XHR_RESPONSE_TYPE.BLOB,tga:d.XHR_RESPONSE_TYPE.BLOB,json:d.XHR_RESPONSE_TYPE.JSON,text:d.XHR_RESPONSE_TYPE.TEXT,txt:d.XHR_RESPONSE_TYPE.TEXT},d.setExtensionLoadType=function(a,b){f(d._loadTypeMap,a,b)},d.setExtensionXhrType=function(a,b){f(d._xhrTypeMap,a,b)}},{eventemitter3:10,url:7}],14:[function(a,b,c){b.exports={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encodeBinary:function(a){for(var b,c="",d=new Array(4),e=0,f=0,g=0;e>2,d[1]=(3&b[0])<<4|b[1]>>4,d[2]=(15&b[1])<<2|b[2]>>6,d[3]=63&b[2],g=e-(a.length-1)){case 2:d[3]=64,d[2]=64;break;case 1:d[3]=64}for(f=0;f=0&&b<=this.children.length)return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),a.emit("added",this),a;throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length)},d.prototype.swapChildren=function(a,b){if(a!==b){var c=this.getChildIndex(a),d=this.getChildIndex(b);if(0>c||0>d)throw new Error("swapChildren: Both the supplied DisplayObjects must be children of the caller.");this.children[c]=b,this.children[d]=a}},d.prototype.getChildIndex=function(a){var b=this.children.indexOf(a);if(-1===b)throw new Error("The supplied DisplayObject must be a child of the caller");return b},d.prototype.setChildIndex=function(a,b){if(0>b||b>=this.children.length)throw new Error("The supplied index is out of bounds");var c=this.getChildIndex(a);this.children.splice(c,1),this.children.splice(b,0,a)},d.prototype.getChildAt=function(a){if(0>a||a>=this.children.length)throw new Error("getChildAt: Supplied index "+a+" does not exist in the child list, or the supplied DisplayObject is not a child of the caller");return this.children[a]},d.prototype.removeChild=function(a){var b=this.children.indexOf(a);if(-1!==b)return this.removeChildAt(b)},d.prototype.removeChildAt=function(a){var b=this.getChildAt(a);return b.parent=null,this.children.splice(a,1),b.emit("removed",this),b},d.prototype.removeChildren=function(a,b){var c=a||0,d="number"==typeof b?b:this.children.length,e=d-c;if(e>0&&d>=e){for(var f=this.children.splice(c,e),g=0;ga;++a)this.children[a].updateTransform()}},d.prototype.containerUpdateTransform=d.prototype.updateTransform,d.prototype.getBounds=function(){if(!this._currentBounds){if(0===this.children.length)return e.Rectangle.EMPTY;for(var a,b,c,d=1/0,f=1/0,g=-(1/0),h=-(1/0),i=!1,j=0,k=this.children.length;k>j;++j){var l=this.children[j];l.visible&&(i=!0,a=this.children[j].getBounds(),d=db?g:b,h=h>c?h:c)}if(!i)return e.Rectangle.EMPTY;var m=this._bounds;m.x=d,m.y=f,m.width=g-d,m.height=h-f,this._currentBounds=m}return this._currentBounds},d.prototype.containerGetBounds=d.prototype.getBounds,d.prototype.getLocalBounds=function(){var a=this.worldTransform;this.worldTransform=e.Matrix.IDENTITY;for(var b=0,c=this.children.length;c>b;++b)this.children[b].updateTransform();return this.worldTransform=a,this._currentBounds=null,this.getBounds(e.Matrix.IDENTITY)},d.prototype.renderWebGL=function(a){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var b,c;if(this._mask||this._filters){for(a.currentRenderer.flush(),this._filters&&a.filterManager.pushFilter(this,this._filters),this._mask&&a.maskManager.pushMask(this,this._mask),a.currentRenderer.start(),this._renderWebGL(a),b=0,c=this.children.length;c>b;b++)this.children[b].renderWebGL(a);a.currentRenderer.flush(),this._mask&&a.maskManager.popMask(this,this._mask),this._filters&&a.filterManager.popFilter(),a.currentRenderer.start()}else for(this._renderWebGL(a),b=0,c=this.children.length;c>b;++b)this.children[b].renderWebGL(a)}},d.prototype._renderWebGL=function(a){},d.prototype._renderCanvas=function(a){},d.prototype.renderCanvas=function(a){if(this.visible&&!(this.alpha<=0)&&this.renderable){this._mask&&a.maskManager.pushMask(this._mask,a),this._renderCanvas(a);for(var b=0,c=this.children.length;c>b;++b)this.children[b].renderCanvas(a);this._mask&&a.maskManager.popMask(a)}},d.prototype.destroy=function(a){if(f.prototype.destroy.call(this),a)for(var b=0,c=this.children.length;c>b;++b)this.children[b].destroy(a);this.removeChildren(),this.children=null}},{"../math":29,"../textures/RenderTexture":67,"./DisplayObject":21}],21:[function(a,b,c){function d(){g.call(this),this.position=new e.Point,this.scale=new e.Point(1,1),this.pivot=new e.Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.renderable=!0,this.parent=null,this.worldAlpha=1,this.worldTransform=new e.Matrix,this.filterArea=null,this._sr=0,this._cr=1,this._bounds=new e.Rectangle(0,0,1,1),this._currentBounds=null,this._mask=null,this._cacheAsBitmap=!1,this._cachedObject=null}var e=a("../math"),f=a("../textures/RenderTexture"),g=a("eventemitter3"),h=a("../const"),i=new e.Matrix;d.prototype=Object.create(g.prototype),d.prototype.constructor=d,b.exports=d,Object.defineProperties(d.prototype,{x:{get:function(){return this.position.x},set:function(a){this.position.x=a}},y:{get:function(){return this.position.y},set:function(a){this.position.y=a}},worldVisible:{get:function(){var a=this;do{if(!a.visible)return!1;a=a.parent}while(a);return!0}},mask:{get:function(){return this._mask},set:function(a){this._mask&&(this._mask.renderable=!0),this._mask=a,this._mask&&(this._mask.renderable=!1)}},filters:{get:function(){return this._filters&&this._filters.slice()},set:function(a){this._filters=a&&a.slice()}}}),d.prototype.updateTransform=function(){var a,b,c,d,e,f,g=this.parent.worldTransform,i=this.worldTransform;this.rotation%h.PI_2?(this.rotation!==this.rotationCache&&(this.rotationCache=this.rotation,this._sr=Math.sin(this.rotation),this._cr=Math.cos(this.rotation)),a=this._cr*this.scale.x,b=this._sr*this.scale.x,c=-this._sr*this.scale.y,d=this._cr*this.scale.y,e=this.position.x,f=this.position.y,(this.pivot.x||this.pivot.y)&&(e-=this.pivot.x*a+this.pivot.y*c,f-=this.pivot.x*b+this.pivot.y*d),i.a=a*g.a+b*g.c,i.b=a*g.b+b*g.d,i.c=c*g.a+d*g.c,i.d=c*g.b+d*g.d,i.tx=e*g.a+f*g.c+g.tx,i.ty=e*g.b+f*g.d+g.ty):(a=this.scale.x,d=this.scale.y,e=this.position.x-this.pivot.x*a,f=this.position.y-this.pivot.y*d,i.a=a*g.a,i.b=a*g.b,i.c=d*g.c,i.d=d*g.d,i.tx=e*g.a+f*g.c+g.tx,i.ty=e*g.b+f*g.d+g.ty),this.worldAlpha=this.alpha*this.parent.worldAlpha,this._currentBounds=null},d.prototype.displayObjectUpdateTransform=d.prototype.updateTransform,d.prototype.getBounds=function(a){return e.Rectangle.EMPTY},d.prototype.getLocalBounds=function(){return this.getBounds(e.Matrix.IDENTITY)},d.prototype.toGlobal=function(a){return this.displayObjectUpdateTransform(),this.worldTransform.apply(a)},d.prototype.toLocal=function(a,b){return b&&(a=b.toGlobal(a)),this.displayObjectUpdateTransform(),this.worldTransform.applyInverse(a)},d.prototype.renderWebGL=function(a){},d.prototype.renderCanvas=function(a){},d.prototype.generateTexture=function(a,b,c){var d=this.getLocalBounds(),e=new f(a,0|d.width,0|d.height,b,c);return i.tx=-d.x,i.ty=-d.y,e.render(this,i),e},d.prototype.destroy=function(){this.position=null,this.scale=null,this.pivot=null,this.parent=null,this._bounds=null,this._currentBounds=null,this._mask=null,this.worldTransform=null,this.filterArea=null}},{"../const":19,"../math":29,"../textures/RenderTexture":67,eventemitter3:10}],22:[function(a,b,c){function d(){e.call(this),this.fillAlpha=1,this.lineWidth=0,this.lineColor=0,this.graphicsData=[],this.tint=16777215,this._prevTint=16777215,this.blendMode=k.BLEND_MODES.NORMAL,this.currentPath=null,this._webGL={},this.isMask=!1,this.boundsPadding=0,this._localBounds=new j.Rectangle(0,0,1,1),this.dirty=!0,this.glDirty=!1,this.boundsDirty=!0,this.cachedSpriteDirty=!1}var e=a("../display/Container"),f=a("../textures/Texture"),g=a("../renderers/canvas/utils/CanvasBuffer"),h=a("../renderers/canvas/utils/CanvasGraphics"),i=a("./GraphicsData"),j=a("../math"),k=a("../const"),l=new j.Point;d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,Object.defineProperties(d.prototype,{}),d.prototype.clone=function(){var a=new d;a.renderable=this.renderable,a.fillAlpha=this.fillAlpha,a.lineWidth=this.lineWidth,a.lineColor=this.lineColor,a.tint=this.tint,a.blendMode=this.blendMode,a.isMask=this.isMask,a.boundsPadding=this.boundsPadding,a.dirty=this.dirty,a.glDirty=this.glDirty,a.cachedSpriteDirty=this.cachedSpriteDirty;for(var b=0;b=l;++l)k=l/g,e=i+(a-i)*k,f=j+(b-j)*k,h.push(e+(a+(c-a)*k-e)*k,f+(b+(d-b)*k-f)*k);return this.dirty=this.boundsDirty=!0,this},d.prototype.bezierCurveTo=function(a,b,c,d,e,f){this.currentPath?0===this.currentPath.shape.points.length&&(this.currentPath.shape.points=[0,0]):this.moveTo(0,0);for(var g,h,i,j,k,l=20,m=this.currentPath.shape.points,n=m[m.length-2],o=m[m.length-1],p=0,q=1;l>=q;++q)p=q/l,g=1-p,h=g*g,i=h*g,j=p*p,k=j*p,m.push(i*n+3*h*p*a+3*g*j*c+k*e,i*o+3*h*p*b+3*g*j*d+k*f);return this.dirty=this.boundsDirty=!0,this},d.prototype.arcTo=function(a,b,c,d,e){this.currentPath?0===this.currentPath.shape.points.length&&this.currentPath.shape.points.push(a,b):this.moveTo(a,b);var f=this.currentPath.shape.points,g=f[f.length-2],h=f[f.length-1],i=h-b,j=g-a,k=d-b,l=c-a,m=Math.abs(i*l-j*k);if(1e-8>m||0===e)(f[f.length-2]!==a||f[f.length-1]!==b)&&f.push(a,b);else{var n=i*i+j*j,o=k*k+l*l,p=i*k+j*l,q=e*Math.sqrt(n)/m,r=e*Math.sqrt(o)/m,s=q*p/n,t=r*p/o,u=q*l+r*j,v=q*k+r*i,w=j*(r+s),x=i*(r+s),y=l*(q+t),z=k*(q+t),A=Math.atan2(x-v,w-u),B=Math.atan2(z-v,y-u);this.arc(u+a,v+b,e,A,B,j*k>l*i)}return this.dirty=this.boundsDirty=!0,this},d.prototype.arc=function(a,b,c,d,e,f){if(f=f||!1,d===e)return this;!f&&d>=e?e+=2*Math.PI:f&&e>=d&&(d+=2*Math.PI);var g=f?-1*(d-e):e-d,h=40*Math.ceil(Math.abs(g)/(2*Math.PI));if(0===g)return this;var i=a+Math.cos(d)*c,j=b+Math.sin(d)*c;this.currentPath?f&&this.filling?this.currentPath.shape.points.push(a,b):this.currentPath.shape.points.push(i,j):f&&this.filling?this.moveTo(a,b):this.moveTo(i,j);for(var k=this.currentPath.shape.points,l=g/(2*h),m=2*l,n=Math.cos(l),o=Math.sin(l),p=h-1,q=p%1/p,r=0;p>=r;r++){var s=r+q*r,t=l+d+m*s,u=Math.cos(t),v=-Math.sin(t);k.push((n*u+o*v)*c+a,(n*-v+o*u)*c+b)}return this.dirty=this.boundsDirty=!0,this},d.prototype.beginFill=function(a,b){return this.filling=!0,this.fillColor=a||0,this.fillAlpha=void 0===b?1:b,this.currentPath&&this.currentPath.shape.points.length<=2&&(this.currentPath.fill=this.filling,this.currentPath.fillColor=this.fillColor,this.currentPath.fillAlpha=this.fillAlpha),this},d.prototype.endFill=function(){return this.filling=!1,this.fillColor=null,this.fillAlpha=1,this},d.prototype.drawRect=function(a,b,c,d){return this.drawShape(new j.Rectangle(a,b,c,d)),this},d.prototype.drawRoundedRect=function(a,b,c,d,e){return this.drawShape(new j.RoundedRectangle(a,b,c,d,e)),this},d.prototype.drawCircle=function(a,b,c){return this.drawShape(new j.Circle(a,b,c)),this},d.prototype.drawEllipse=function(a,b,c,d){return this.drawShape(new j.Ellipse(a,b,c,d)),this},d.prototype.drawPolygon=function(a){var b=a;if(!Array.isArray(b)){b=new Array(arguments.length);for(var c=0;cq?q:y,y=y>s?s:y,y=y>u?u:y,z=z>r?r:z,z=z>t?t:z,z=z>v?v:z,w=q>w?q:w,w=s>w?s:w,w=u>w?u:w,x=r>x?r:x,x=t>x?t:x,x=v>x?v:x,this._bounds.x=y,this._bounds.width=w-y,this._bounds.y=z,this._bounds.height=x-z,this._currentBounds=this._bounds}return this._currentBounds},d.prototype.containsPoint=function(a){this.worldTransform.applyInverse(a,l);for(var b=this.graphicsData,c=0;cg?g:a,b=g+i>b?g+i:b,c=c>h?h:c,d=h+j>d?h+j:d;else if(n===k.SHAPES.CIRC)g=e.x,h=e.y,i=e.radius+o/2,j=e.radius+o/2,a=a>g-i?g-i:a,b=g+i>b?g+i:b,c=c>h-j?h-j:c,d=h+j>d?h+j:d;else if(n===k.SHAPES.ELIP)g=e.x,h=e.y,i=e.width+o/2,j=e.height+o/2,a=a>g-i?g-i:a,b=g+i>b?g+i:b,c=c>h-j?h-j:c,d=h+j>d?h+j:d;else{f=e.points;for(var p=0;pg-o?g-o:a,b=g+o>b?g+o:b,c=c>h-o?h-o:c,d=h+o>d?h+o:d}}else a=0,b=0,c=0,d=0;var q=this.boundsPadding;this._localBounds.x=a-q,this._localBounds.width=b-a+2*q,this._localBounds.y=c-q,this._localBounds.height=d-c+2*q},d.prototype.drawShape=function(a){this.currentPath&&this.currentPath.shape.points.length<=2&&this.graphicsData.pop(),this.currentPath=null;var b=new i(this.lineWidth,this.lineColor,this.lineAlpha,this.fillColor,this.fillAlpha,this.filling,a);return this.graphicsData.push(b),b.type===k.SHAPES.POLY&&(b.shape.closed=b.shape.closed||this.filling,this.currentPath=b),this.dirty=this.boundsDirty=!0,b},d.prototype.destroy=function(){e.prototype.destroy.apply(this,arguments);for(var a=0;a=6)if(h.points.length<2*this.maximumSimplePolySize){f=this.switchMode(c,0);var i=this.buildPoly(h,f);i||(f=this.switchMode(c,1),this.buildComplexPoly(h,f))}else f=this.switchMode(c,1),this.buildComplexPoly(h,f);h.lineWidth>0&&(f=this.switchMode(c,0),this.buildLine(h,f))}else f=this.switchMode(c,0),h.type===g.SHAPES.RECT?this.buildRectangle(h,f):h.type===g.SHAPES.CIRC||h.type===g.SHAPES.ELIP?this.buildCircle(h,f):h.type===g.SHAPES.RREC&&this.buildRoundedRectangle(h,f);c.lastIndex++}for(d=0;d32e4||c.mode!==b||1===b)&&(c=this.graphicsDataPool.pop()||new j(a.gl),c.mode=b,a.data.push(c))):(c=this.graphicsDataPool.pop()||new j(a.gl),c.mode=b,a.data.push(c)),c.dirty=!0,c},d.prototype.buildRectangle=function(a,b){var c=a.shape,d=c.x,f=c.y,g=c.width,h=c.height;if(a.fill){var i=e.hex2rgb(a.fillColor),j=a.fillAlpha,k=i[0]*j,l=i[1]*j,m=i[2]*j,n=b.points,o=b.indices,p=n.length/6;n.push(d,f),n.push(k,l,m,j),n.push(d+g,f),n.push(k,l,m,j),n.push(d,f+h),n.push(k,l,m,j),n.push(d+g,f+h),n.push(k,l,m,j),o.push(p,p,p+1,p+2,p+3,p+3)}if(a.lineWidth){var q=a.points;a.points=[d,f,d+g,f,d+g,f+h,d,f+h,d,f],this.buildLine(a,b),a.points=q}},d.prototype.buildRoundedRectangle=function(a,b){var c=a.shape,d=c.x,f=c.y,g=c.width,h=c.height,i=c.radius,j=[];if(j.push(d,f+i),this.quadraticBezierCurve(d,f+h-i,d,f+h,d+i,f+h,j),this.quadraticBezierCurve(d+g-i,f+h,d+g,f+h,d+g,f+h-i,j),this.quadraticBezierCurve(d+g,f+i,d+g,f,d+g-i,f,j),this.quadraticBezierCurve(d+i,f,d,f,d,f+i+1e-10,j),a.fill){var l=e.hex2rgb(a.fillColor),m=a.fillAlpha,n=l[0]*m,o=l[1]*m,p=l[2]*m,q=b.points,r=b.indices,s=q.length/6,t=k(j,null,2),u=0;for(u=0;u=r;r++)q=r/o,i=h(a,c,q),j=h(b,d,q),k=h(c,e,q),l=h(d,f,q),m=h(i,k,q),n=h(j,l,q),p.push(m,n);return p},d.prototype.buildCircle=function(a,b){var c,d,f=a.shape,h=f.x,i=f.y;a.type===g.SHAPES.CIRC?(c=f.radius,d=f.radius):(c=f.width,d=f.height);var j=40,k=2*Math.PI/j,l=0;if(a.fill){var m=e.hex2rgb(a.fillColor),n=a.fillAlpha,o=m[0]*n,p=m[1]*n,q=m[2]*n,r=b.points,s=b.indices,t=r.length/6;for(s.push(t),l=0;j+1>l;l++)r.push(h,i,o,p,q,n),r.push(h+Math.sin(k*l)*c,i+Math.cos(k*l)*d,o,p,q,n),s.push(t++,t++);s.push(t-1)}if(a.lineWidth){var u=a.points;for(a.points=[],l=0;j+1>l;l++)a.points.push(h+Math.sin(k*l)*c,i+Math.cos(k*l)*d);this.buildLine(a,b),a.points=u}},d.prototype.buildLine=function(a,b){var c=0,d=a.points;if(0!==d.length){if(a.lineWidth%2)for(c=0;cc;c++)m=d[2*(c-1)],n=d[2*(c-1)+1],o=d[2*c],p=d[2*c+1],q=d[2*(c+1)],r=d[2*(c+1)+1],s=-(n-p),t=m-o,G=Math.sqrt(s*s+t*t),s/=G,t/=G,s*=M,t*=M,u=-(p-r),v=o-q,G=Math.sqrt(u*u+v*v),u/=G,v/=G,u*=M,v*=M,y=-t+n-(-t+p),z=-s+o-(-s+m),A=(-s+m)*(-t+p)-(-s+o)*(-t+n),B=-v+r-(-v+p),C=-u+o-(-u+q),D=(-u+q)*(-v+p)-(-u+o)*(-v+r),E=y*C-B*z,Math.abs(E)<.1?(E+=10.1,H.push(o-s,p-t,P,Q,R,O),H.push(o+s,p+t,P,Q,R,O)):(k=(z*D-C*A)/E,l=(B*A-y*D)/E,F=(k-o)*(k-o)+(l-p)+(l-p),F>19600?(w=s-u,x=t-v,G=Math.sqrt(w*w+x*x),w/=G,x/=G,w*=M,x*=M,H.push(o-w,p-x),H.push(P,Q,R,O),H.push(o+w,p+x),H.push(P,Q,R,O),H.push(o-w,p-x),H.push(P,Q,R,O),K++):(H.push(k,l),H.push(P,Q,R,O),H.push(o-(k-o),p-(l-p)),H.push(P,Q,R,O)));for(m=d[2*(J-2)],n=d[2*(J-2)+1],o=d[2*(J-1)],p=d[2*(J-1)+1],s=-(n-p),t=m-o,G=Math.sqrt(s*s+t*t),s/=G,t/=G,s*=M,t*=M,H.push(o-s,p-t),H.push(P,Q,R,O),H.push(o+s,p+t),H.push(P,Q,R,O),I.push(L),c=0;K>c;c++)I.push(L++);I.push(L-1)}},d.prototype.buildComplexPoly=function(a,b){var c=a.points.slice();if(!(c.length<6)){var d=b.indices;b.points=c,b.alpha=a.fillAlpha,b.color=e.hex2rgb(a.fillColor);for(var f,g,h=1/0,i=-(1/0),j=1/0,k=-(1/0),l=0;lf?f:h,i=f>i?f:i,j=j>g?g:j,k=g>k?g:k;c.push(h,j,i,j,i,k,h,k);var m=c.length/2;for(l=0;m>l;l++)d.push(l)}},d.prototype.buildPoly=function(a,b){var c=a.points;if(!(c.length<6)){var d=b.points,f=b.indices,g=c.length/2,h=e.hex2rgb(a.fillColor),i=a.fillAlpha,j=h[0]*i,l=h[1]*i,m=h[2]*i,n=k(c,null,2);if(!n)return!1;var o=d.length/6,p=0;for(p=0;pp;p++)d.push(c[2*p],c[2*p+1],j,l,m,i);return!0}}},{"../../const":19,"../../math":29,"../../renderers/webgl/WebGLRenderer":45,"../../renderers/webgl/utils/ObjectRenderer":59,"../../utils":73,"./WebGLGraphicsData":25,earcut:9}],25:[function(a,b,c){function d(a){this.gl=a,this.color=[0,0,0],this.points=[],this.indices=[],this.buffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),this.mode=1,this.alpha=1,this.dirty=!0,this.glPoints=null,this.glIndices=null}d.prototype.constructor=d,b.exports=d,d.prototype.reset=function(){this.points.length=0,this.indices.length=0},d.prototype.upload=function(){var a=this.gl;this.glPoints=new Float32Array(this.points),a.bindBuffer(a.ARRAY_BUFFER,this.buffer),a.bufferData(a.ARRAY_BUFFER,this.glPoints,a.STATIC_DRAW),this.glIndices=new Uint16Array(this.indices),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.glIndices,a.STATIC_DRAW),this.dirty=!1},d.prototype.destroy=function(){this.color=null,this.points=null,this.indices=null,this.gl.deleteBuffer(this.buffer),this.gl.deleteBuffer(this.indexBuffer),this.gl=null,this.buffer=null,this.indexBuffer=null,this.glPoints=null,this.glIndices=null}},{}],26:[function(a,b,c){var d=b.exports=Object.assign(a("./const"),a("./math"),{utils:a("./utils"),ticker:a("./ticker"),DisplayObject:a("./display/DisplayObject"),Container:a("./display/Container"),Sprite:a("./sprites/Sprite"),ParticleContainer:a("./particles/ParticleContainer"),SpriteRenderer:a("./sprites/webgl/SpriteRenderer"),ParticleRenderer:a("./particles/webgl/ParticleRenderer"),Text:a("./text/Text"),Graphics:a("./graphics/Graphics"),GraphicsData:a("./graphics/GraphicsData"),GraphicsRenderer:a("./graphics/webgl/GraphicsRenderer"),Texture:a("./textures/Texture"),BaseTexture:a("./textures/BaseTexture"),RenderTexture:a("./textures/RenderTexture"),VideoBaseTexture:a("./textures/VideoBaseTexture"),TextureUvs:a("./textures/TextureUvs"),CanvasRenderer:a("./renderers/canvas/CanvasRenderer"),CanvasGraphics:a("./renderers/canvas/utils/CanvasGraphics"),CanvasBuffer:a("./renderers/canvas/utils/CanvasBuffer"),WebGLRenderer:a("./renderers/webgl/WebGLRenderer"),ShaderManager:a("./renderers/webgl/managers/ShaderManager"),Shader:a("./renderers/webgl/shaders/Shader"),ObjectRenderer:a("./renderers/webgl/utils/ObjectRenderer"),RenderTarget:a("./renderers/webgl/utils/RenderTarget"),AbstractFilter:a("./renderers/webgl/filters/AbstractFilter"),FXAAFilter:a("./renderers/webgl/filters/FXAAFilter"),SpriteMaskFilter:a("./renderers/webgl/filters/SpriteMaskFilter"),autoDetectRenderer:function(a,b,c,e){return a=a||800,b=b||600,!e&&d.utils.isWebGLSupported()?new d.WebGLRenderer(a,b,c):new d.CanvasRenderer(a,b,c)}})},{"./const":19,"./display/Container":20,"./display/DisplayObject":21,"./graphics/Graphics":22,"./graphics/GraphicsData":23,"./graphics/webgl/GraphicsRenderer":24,"./math":29,"./particles/ParticleContainer":35,"./particles/webgl/ParticleRenderer":37,"./renderers/canvas/CanvasRenderer":40,"./renderers/canvas/utils/CanvasBuffer":41,"./renderers/canvas/utils/CanvasGraphics":42,"./renderers/webgl/WebGLRenderer":45,"./renderers/webgl/filters/AbstractFilter":46,"./renderers/webgl/filters/FXAAFilter":47,"./renderers/webgl/filters/SpriteMaskFilter":48,"./renderers/webgl/managers/ShaderManager":52,"./renderers/webgl/shaders/Shader":57,"./renderers/webgl/utils/ObjectRenderer":59,"./renderers/webgl/utils/RenderTarget":61,"./sprites/Sprite":63,"./sprites/webgl/SpriteRenderer":64,"./text/Text":65,"./textures/BaseTexture":66,"./textures/RenderTexture":67,"./textures/Texture":68,"./textures/TextureUvs":69,"./textures/VideoBaseTexture":70,"./ticker":72,"./utils":73}],27:[function(a,b,c){function d(){this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0}var e=a("./Point");d.prototype.constructor=d,b.exports=d,d.prototype.fromArray=function(a){this.a=a[0],this.b=a[1],this.c=a[3],this.d=a[4],this.tx=a[2],this.ty=a[5]},d.prototype.toArray=function(a,b){this.array||(this.array=new Float32Array(9));var c=b||this.array;return a?(c[0]=this.a,c[1]=this.b,c[2]=0,c[3]=this.c,c[4]=this.d,c[5]=0,c[6]=this.tx,c[7]=this.ty,c[8]=1):(c[0]=this.a,c[1]=this.c,c[2]=this.tx,c[3]=this.b,c[4]=this.d,c[5]=this.ty,c[6]=0,c[7]=0,c[8]=1),c},d.prototype.apply=function(a,b){b=b||new e;var c=a.x,d=a.y;return b.x=this.a*c+this.c*d+this.tx,b.y=this.b*c+this.d*d+this.ty,b},d.prototype.applyInverse=function(a,b){b=b||new e;var c=1/(this.a*this.d+this.c*-this.b),d=a.x,f=a.y;return b.x=this.d*c*d+-this.c*c*f+(this.ty*this.c-this.tx*this.d)*c,b.y=this.a*c*f+-this.b*c*d+(-this.ty*this.a+this.tx*this.b)*c,b},d.prototype.translate=function(a,b){return this.tx+=a,this.ty+=b,this},d.prototype.scale=function(a,b){return this.a*=a,this.d*=b,this.c*=a,this.b*=b,this.tx*=a,this.ty*=b,this},d.prototype.rotate=function(a){var b=Math.cos(a),c=Math.sin(a),d=this.a,e=this.c,f=this.tx;return this.a=d*b-this.b*c,this.b=d*c+this.b*b,this.c=e*b-this.d*c,this.d=e*c+this.d*b,this.tx=f*b-this.ty*c,this.ty=f*c+this.ty*b,this},d.prototype.append=function(a){var b=this.a,c=this.b,d=this.c,e=this.d;return this.a=a.a*b+a.b*d,this.b=a.a*c+a.b*e,this.c=a.c*b+a.d*d,this.d=a.c*c+a.d*e,this.tx=a.tx*b+a.ty*d+this.tx,this.ty=a.tx*c+a.ty*e+this.ty,this},d.prototype.prepend=function(a){var b=this.tx;if(1!==a.a||0!==a.b||0!==a.c||1!==a.d){var c=this.a,d=this.c;this.a=c*a.a+this.b*a.c,this.b=c*a.b+this.b*a.d,this.c=d*a.a+this.d*a.c,this.d=d*a.b+this.d*a.d}return this.tx=b*a.a+this.ty*a.c+a.tx,this.ty=b*a.b+this.ty*a.d+a.ty,this},d.prototype.invert=function(){var a=this.a,b=this.b,c=this.c,d=this.d,e=this.tx,f=a*d-b*c;return this.a=d/f,this.b=-b/f,this.c=-c/f,this.d=a/f,this.tx=(c*this.ty-d*e)/f,this.ty=-(a*this.ty-b*e)/f,this},d.prototype.identity=function(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this},d.prototype.clone=function(){var a=new d;return a.a=this.a,a.b=this.b,a.c=this.c,a.d=this.d,a.tx=this.tx,a.ty=this.ty,a},d.prototype.copy=function(a){return a.a=this.a,a.b=this.b,a.c=this.c,a.d=this.d,a.tx=this.tx,a.ty=this.ty,a},d.IDENTITY=new d,d.TEMP_MATRIX=new d},{"./Point":28}],28:[function(a,b,c){function d(a,b){this.x=a||0,this.y=b||0}d.prototype.constructor=d,b.exports=d,d.prototype.clone=function(){return new d(this.x,this.y)},d.prototype.copy=function(a){this.set(a.x,a.y)},d.prototype.equals=function(a){return a.x===this.x&&a.y===this.y},d.prototype.set=function(a,b){this.x=a||0,this.y=b||(0!==b?this.x:0)}},{}],29:[function(a,b,c){b.exports={Point:a("./Point"),Matrix:a("./Matrix"),Circle:a("./shapes/Circle"),Ellipse:a("./shapes/Ellipse"),Polygon:a("./shapes/Polygon"),Rectangle:a("./shapes/Rectangle"),RoundedRectangle:a("./shapes/RoundedRectangle")}},{"./Matrix":27,"./Point":28,"./shapes/Circle":30,"./shapes/Ellipse":31,"./shapes/Polygon":32,"./shapes/Rectangle":33,"./shapes/RoundedRectangle":34}],30:[function(a,b,c){function d(a,b,c){this.x=a||0,this.y=b||0,this.radius=c||0,this.type=f.SHAPES.CIRC}var e=a("./Rectangle"),f=a("../../const");d.prototype.constructor=d,b.exports=d,d.prototype.clone=function(){return new d(this.x,this.y,this.radius)},d.prototype.contains=function(a,b){if(this.radius<=0)return!1;var c=this.x-a,d=this.y-b,e=this.radius*this.radius;return c*=c,d*=d,e>=c+d},d.prototype.getBounds=function(){return new e(this.x-this.radius,this.y-this.radius,2*this.radius,2*this.radius)}},{"../../const":19,"./Rectangle":33}],31:[function(a,b,c){function d(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.type=f.SHAPES.ELIP}var e=a("./Rectangle"),f=a("../../const");d.prototype.constructor=d,b.exports=d,d.prototype.clone=function(){return new d(this.x,this.y,this.width,this.height)},d.prototype.contains=function(a,b){if(this.width<=0||this.height<=0)return!1;var c=(a-this.x)/this.width,d=(b-this.y)/this.height;return c*=c,d*=d,1>=c+d},d.prototype.getBounds=function(){return new e(this.x-this.width,this.y-this.height,this.width,this.height)}},{"../../const":19,"./Rectangle":33}],32:[function(a,b,c){function d(a){var b=a;if(!Array.isArray(b)){b=new Array(arguments.length);for(var c=0;cg;g++)d.push(b[g].x,b[g].y);b=d}this.closed=!0,this.points=b,this.type=f.SHAPES.POLY}var e=a("../Point"),f=a("../../const");d.prototype.constructor=d,b.exports=d,d.prototype.clone=function(){return new d(this.points.slice())},d.prototype.contains=function(a,b){for(var c=!1,d=this.points.length/2,e=0,f=d-1;d>e;f=e++){var g=this.points[2*e],h=this.points[2*e+1],i=this.points[2*f],j=this.points[2*f+1],k=h>b!=j>b&&(i-g)*(b-h)/(j-h)+g>a;k&&(c=!c)}return c}},{"../../const":19,"../Point":28}],33:[function(a,b,c){function d(a,b,c,d){this.x=a||0,this.y=b||0,this.width=c||0,this.height=d||0,this.type=e.SHAPES.RECT}var e=a("../../const");d.prototype.constructor=d,b.exports=d,d.EMPTY=new d(0,0,0,0),d.prototype.clone=function(){return new d(this.x,this.y,this.width,this.height)},d.prototype.contains=function(a,b){return this.width<=0||this.height<=0?!1:a>=this.x&&a=this.y&&b=this.x&&a<=this.x+this.width&&b>=this.y&&b<=this.y+this.height?!0:!1}},{"../../const":19}],35:[function(a,b,c){function d(a,b){e.call(this),this._properties=[!1,!0,!1,!1,!1],this._size=a||15e3,this._buffers=null,this._updateStatic=!1,this.interactiveChildren=!1,this.blendMode=f.BLEND_MODES.NORMAL,this.roundPixels=!0,this.setProperties(b)}var e=a("../display/Container"),f=a("../const");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.prototype.setProperties=function(a){a&&(this._properties[0]="scale"in a?!!a.scale:this._properties[0],this._properties[1]="position"in a?!!a.position:this._properties[1],this._properties[2]="rotation"in a?!!a.rotation:this._properties[2],this._properties[3]="uvs"in a?!!a.uvs:this._properties[3],this._properties[4]="alpha"in a?!!a.alpha:this._properties[4])},d.prototype.updateTransform=function(){this.displayObjectUpdateTransform()},d.prototype.renderWebGL=function(a){this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable&&(a.setObjectRenderer(a.plugins.particle),a.plugins.particle.render(this))},d.prototype.addChildAt=function(a,b){if(a===this)return a;if(b>=0&&b<=this.children.length)return a.parent&&a.parent.removeChild(a),a.parent=this,this.children.splice(b,0,a),this._updateStatic=!0,a;throw new Error(a+"addChildAt: The index "+b+" supplied is out of bounds "+this.children.length)},d.prototype.removeChildAt=function(a){var b=this.getChildAt(a);return b.parent=null,this.children.splice(a,1),this._updateStatic=!0,b},d.prototype.renderCanvas=function(a){if(this.visible&&!(this.worldAlpha<=0)&&this.children.length&&this.renderable){var b=a.context,c=this.worldTransform,d=!0,e=0,f=0,g=0,h=0;b.globalAlpha=this.worldAlpha,this.displayObjectUpdateTransform();for(var i=0;ic;c+=6,d+=4)this.indices[c+0]=d+0,this.indices[c+1]=d+1,this.indices[c+2]=d+2,this.indices[c+3]=d+0,this.indices[c+4]=d+2,this.indices[c+5]=d+3;this.shader=null,this.indexBuffer=null,this.properties=null,this.tempMatrix=new i.Matrix}var e=a("../../renderers/webgl/utils/ObjectRenderer"),f=a("../../renderers/webgl/WebGLRenderer"),g=a("./ParticleShader"),h=a("./ParticleBuffer"),i=a("../../math");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,f.registerPlugin("particle",d),d.prototype.onContextChange=function(){var a=this.renderer.gl;this.shader=new g(this.renderer.shaderManager),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),this.properties=[{attribute:this.shader.attributes.aVertexPosition,dynamic:!1,size:2,uploadFunction:this.uploadVertices,offset:0},{attribute:this.shader.attributes.aPositionCoord,dynamic:!0,size:2,uploadFunction:this.uploadPosition,offset:0},{attribute:this.shader.attributes.aRotation,dynamic:!1,size:1,uploadFunction:this.uploadRotation,offset:0},{attribute:this.shader.attributes.aTextureCoord,dynamic:!1,size:2,uploadFunction:this.uploadUvs,offset:0},{attribute:this.shader.attributes.aColor,dynamic:!1,size:1,uploadFunction:this.uploadAlpha,offset:0}]},d.prototype.start=function(){var a=this.renderer.gl;a.activeTexture(a.TEXTURE0),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.shader;this.renderer.shaderManager.setShader(b)},d.prototype.render=function(a){var b=a.children,c=b.length,d=a._size;if(0!==c){c>d&&(c=d),a._buffers||(a._buffers=this.generateBuffers(a)),this.renderer.blendModeManager.setBlendMode(a.blendMode);var e=this.renderer.gl,f=a.worldTransform.copy(this.tempMatrix);f.prepend(this.renderer.currentRenderTarget.projectionMatrix),e.uniformMatrix3fv(this.shader.uniforms.projectionMatrix._location,!1,f.toArray(!0)),e.uniform1f(this.shader.uniforms.uAlpha._location,a.worldAlpha);var g=a._updateStatic,h=b[0]._texture.baseTexture;if(h._glTextures[e.id])e.bindTexture(e.TEXTURE_2D,h._glTextures[e.id]);else{if(!this.renderer.updateTexture(h))return;this.properties[0].dynamic&&this.properties[3].dynamic||(g=!0)}for(var i=0,j=0;c>j;j+=this.size){var k=c-j;k>this.size&&(k=this.size);var l=a._buffers[i++];l.uploadDynamic(b,j,k),g&&l.uploadStatic(b,j,k),l.bind(this.shader),e.drawElements(e.TRIANGLES,6*k,e.UNSIGNED_SHORT,0),this.renderer.drawCount++}a._updateStatic=!1}},d.prototype.generateBuffers=function(a){var b,c=this.renderer.gl,d=[],e=a._size;for(b=0;bb;b+=this.size)d.push(new h(c,this.properties,this.size,this.shader));return d},d.prototype.uploadVertices=function(a,b,c,d,e,f){for(var g,h,i,j,k,l,m,n,o,p=0;c>p;p++)g=a[b+p],h=g._texture,j=g.scale.x,k=g.scale.y,h.trim?(i=h.trim,m=i.x-g.anchor.x*i.width,l=m+h.crop.width,o=i.y-g.anchor.y*i.height,n=o+h.crop.height):(l=h._frame.width*(1-g.anchor.x),m=h._frame.width*-g.anchor.x,n=h._frame.height*(1-g.anchor.y),o=h._frame.height*-g.anchor.y),d[f]=m*j,d[f+1]=o*k,d[f+e]=l*j,d[f+e+1]=o*k,d[f+2*e]=l*j,d[f+2*e+1]=n*k,d[f+3*e]=m*j,d[f+3*e+1]=n*k,f+=4*e},d.prototype.uploadPosition=function(a,b,c,d,e,f){for(var g=0;c>g;g++){var h=a[b+g].position;d[f]=h.x,d[f+1]=h.y,d[f+e]=h.x,d[f+e+1]=h.y,d[f+2*e]=h.x,d[f+2*e+1]=h.y,d[f+3*e]=h.x,d[f+3*e+1]=h.y,f+=4*e}},d.prototype.uploadRotation=function(a,b,c,d,e,f){for(var g=0;c>g;g++){var h=a[b+g].rotation;d[f]=h,d[f+e]=h,d[f+2*e]=h,d[f+3*e]=h,f+=4*e}},d.prototype.uploadUvs=function(a,b,c,d,e,f){for(var g=0;c>g;g++){var h=a[b+g]._texture._uvs;h?(d[f]=h.x0,d[f+1]=h.y0,d[f+e]=h.x1,d[f+e+1]=h.y1,d[f+2*e]=h.x2,d[f+2*e+1]=h.y2,d[f+3*e]=h.x3,d[f+3*e+1]=h.y3,f+=4*e):(d[f]=0,d[f+1]=0,d[f+e]=0,d[f+e+1]=0,d[f+2*e]=0,d[f+2*e+1]=0,d[f+3*e]=0,d[f+3*e+1]=0,f+=4*e)}},d.prototype.uploadAlpha=function(a,b,c,d,e,f){for(var g=0;c>g;g++){var h=a[b+g].alpha;d[f]=h,d[f+e]=h,d[f+2*e]=h,d[f+3*e]=h,f+=4*e}},d.prototype.destroy=function(){this.renderer.gl&&this.renderer.gl.deleteBuffer(this.indexBuffer),e.prototype.destroy.apply(this,arguments),this.shader.destroy(),this.indices=null,this.tempMatrix=null}},{"../../math":29,"../../renderers/webgl/WebGLRenderer":45,"../../renderers/webgl/utils/ObjectRenderer":59,"./ParticleBuffer":36,"./ParticleShader":38}],38:[function(a,b,c){function d(a){e.call(this,a,["attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute float aColor;","attribute vec2 aPositionCoord;","attribute vec2 aScale;","attribute float aRotation;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying float vColor;","void main(void){"," vec2 v = aVertexPosition;"," v.x = (aVertexPosition.x) * cos(aRotation) - (aVertexPosition.y) * sin(aRotation);"," v.y = (aVertexPosition.x) * sin(aRotation) + (aVertexPosition.y) * cos(aRotation);"," v = v + aPositionCoord;"," gl_Position = vec4((projectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = aColor;","}"].join("\n"),["precision lowp float;","varying vec2 vTextureCoord;","varying float vColor;","uniform sampler2D uSampler;","uniform float uAlpha;","void main(void){"," vec4 color = texture2D(uSampler, vTextureCoord) * vColor * uAlpha;"," if (color.a == 0.0) discard;"," gl_FragColor = color;","}"].join("\n"),{uAlpha:{type:"1f",value:1}},{aPositionCoord:0,aRotation:0})}var e=a("../../renderers/webgl/shaders/TextureShader");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d},{"../../renderers/webgl/shaders/TextureShader":58}],39:[function(a,b,c){function d(a,b,c,d){if(h.call(this),e.sayHello(a),d)for(var i in g.DEFAULT_RENDER_OPTIONS)"undefined"==typeof d[i]&&(d[i]=g.DEFAULT_RENDER_OPTIONS[i]);else d=g.DEFAULT_RENDER_OPTIONS;this.type=g.RENDERER_TYPE.UNKNOWN,this.width=b||800,this.height=c||600,this.view=d.view||document.createElement("canvas"),this.resolution=d.resolution,this.transparent=d.transparent,this.autoResize=d.autoResize||!1,this.blendModes=null,this.preserveDrawingBuffer=d.preserveDrawingBuffer,this.clearBeforeRender=d.clearBeforeRender,this._backgroundColor=0,this._backgroundColorRgb=[0,0,0],this._backgroundColorString="#000000",this.backgroundColor=d.backgroundColor||this._backgroundColor,this._tempDisplayObjectParent={worldTransform:new f.Matrix,worldAlpha:1,children:[]},this._lastObjectRendered=this._tempDisplayObjectParent}var e=a("../utils"),f=a("../math"),g=a("../const"),h=a("eventemitter3");d.prototype=Object.create(h.prototype),d.prototype.constructor=d,b.exports=d,Object.defineProperties(d.prototype,{backgroundColor:{get:function(){return this._backgroundColor},set:function(a){this._backgroundColor=a,this._backgroundColorString=e.hex2string(a),e.hex2rgb(a,this._backgroundColorRgb)}}}),d.prototype.resize=function(a,b){this.width=a*this.resolution,this.height=b*this.resolution,this.view.width=this.width,this.view.height=this.height,this.autoResize&&(this.view.style.width=this.width/this.resolution+"px", this.view.style.height=this.height/this.resolution+"px")},d.prototype.destroy=function(a){a&&this.view.parent&&this.view.parent.removeChild(this.view),this.type=g.RENDERER_TYPE.UNKNOWN,this.width=0,this.height=0,this.view=null,this.resolution=0,this.transparent=!1,this.autoResize=!1,this.blendModes=null,this.preserveDrawingBuffer=!1,this.clearBeforeRender=!1,this._backgroundColor=0,this._backgroundColorRgb=null,this._backgroundColorString=null}},{"../const":19,"../math":29,"../utils":73,eventemitter3:10}],40:[function(a,b,c){function d(a,b,c){e.call(this,"Canvas",a,b,c),this.type=i.RENDERER_TYPE.CANVAS,this.context=this.view.getContext("2d",{alpha:this.transparent}),this.refresh=!0,this.maskManager=new f,this.roundPixels=!1,this.currentScaleMode=i.SCALE_MODES.DEFAULT,this.currentBlendMode=i.BLEND_MODES.NORMAL,this.smoothProperty="imageSmoothingEnabled",this.context.imageSmoothingEnabled||(this.context.webkitImageSmoothingEnabled?this.smoothProperty="webkitImageSmoothingEnabled":this.context.mozImageSmoothingEnabled?this.smoothProperty="mozImageSmoothingEnabled":this.context.oImageSmoothingEnabled?this.smoothProperty="oImageSmoothingEnabled":this.context.msImageSmoothingEnabled&&(this.smoothProperty="msImageSmoothingEnabled")),this.initPlugins(),this._mapBlendModes(),this._tempDisplayObjectParent={worldTransform:new h.Matrix,worldAlpha:1},this.resize(a,b)}var e=a("../SystemRenderer"),f=a("./utils/CanvasMaskManager"),g=a("../../utils"),h=a("../../math"),i=a("../../const");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,g.pluginTarget.mixin(d),d.prototype.render=function(a){var b=a.parent;this._lastObjectRendered=a,a.parent=this._tempDisplayObjectParent,a.updateTransform(),a.parent=b,this.context.setTransform(1,0,0,1,0,0),this.context.globalAlpha=1,this.currentBlendMode=i.BLEND_MODES.NORMAL,this.context.globalCompositeOperation=this.blendModes[i.BLEND_MODES.NORMAL],navigator.isCocoonJS&&this.view.screencanvas&&(this.context.fillStyle="black",this.context.clear()),this.clearBeforeRender&&(this.transparent?this.context.clearRect(0,0,this.width,this.height):(this.context.fillStyle=this._backgroundColorString,this.context.fillRect(0,0,this.width,this.height))),this.renderDisplayObject(a,this.context)},d.prototype.destroy=function(a){this.destroyPlugins(),e.prototype.destroy.call(this,a),this.context=null,this.refresh=!0,this.maskManager.destroy(),this.maskManager=null,this.roundPixels=!1,this.currentScaleMode=0,this.currentBlendMode=0,this.smoothProperty=null},d.prototype.renderDisplayObject=function(a,b){var c=this.context;this.context=b,a.renderCanvas(this),this.context=c},d.prototype.resize=function(a,b){e.prototype.resize.call(this,a,b),this.currentScaleMode=i.SCALE_MODES.DEFAULT,this.smoothProperty&&(this.context[this.smoothProperty]=this.currentScaleMode===i.SCALE_MODES.LINEAR)},d.prototype._mapBlendModes=function(){this.blendModes||(this.blendModes={},g.canUseNewCanvasBlendModes()?(this.blendModes[i.BLEND_MODES.NORMAL]="source-over",this.blendModes[i.BLEND_MODES.ADD]="lighter",this.blendModes[i.BLEND_MODES.MULTIPLY]="multiply",this.blendModes[i.BLEND_MODES.SCREEN]="screen",this.blendModes[i.BLEND_MODES.OVERLAY]="overlay",this.blendModes[i.BLEND_MODES.DARKEN]="darken",this.blendModes[i.BLEND_MODES.LIGHTEN]="lighten",this.blendModes[i.BLEND_MODES.COLOR_DODGE]="color-dodge",this.blendModes[i.BLEND_MODES.COLOR_BURN]="color-burn",this.blendModes[i.BLEND_MODES.HARD_LIGHT]="hard-light",this.blendModes[i.BLEND_MODES.SOFT_LIGHT]="soft-light",this.blendModes[i.BLEND_MODES.DIFFERENCE]="difference",this.blendModes[i.BLEND_MODES.EXCLUSION]="exclusion",this.blendModes[i.BLEND_MODES.HUE]="hue",this.blendModes[i.BLEND_MODES.SATURATION]="saturate",this.blendModes[i.BLEND_MODES.COLOR]="color",this.blendModes[i.BLEND_MODES.LUMINOSITY]="luminosity"):(this.blendModes[i.BLEND_MODES.NORMAL]="source-over",this.blendModes[i.BLEND_MODES.ADD]="lighter",this.blendModes[i.BLEND_MODES.MULTIPLY]="source-over",this.blendModes[i.BLEND_MODES.SCREEN]="source-over",this.blendModes[i.BLEND_MODES.OVERLAY]="source-over",this.blendModes[i.BLEND_MODES.DARKEN]="source-over",this.blendModes[i.BLEND_MODES.LIGHTEN]="source-over",this.blendModes[i.BLEND_MODES.COLOR_DODGE]="source-over",this.blendModes[i.BLEND_MODES.COLOR_BURN]="source-over",this.blendModes[i.BLEND_MODES.HARD_LIGHT]="source-over",this.blendModes[i.BLEND_MODES.SOFT_LIGHT]="source-over",this.blendModes[i.BLEND_MODES.DIFFERENCE]="source-over",this.blendModes[i.BLEND_MODES.EXCLUSION]="source-over",this.blendModes[i.BLEND_MODES.HUE]="source-over",this.blendModes[i.BLEND_MODES.SATURATION]="source-over",this.blendModes[i.BLEND_MODES.COLOR]="source-over",this.blendModes[i.BLEND_MODES.LUMINOSITY]="source-over"))}},{"../../const":19,"../../math":29,"../../utils":73,"../SystemRenderer":39,"./utils/CanvasMaskManager":43}],41:[function(a,b,c){function d(a,b){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.canvas.width=a,this.canvas.height=b}d.prototype.constructor=d,b.exports=d,Object.defineProperties(d.prototype,{width:{get:function(){return this.canvas.width},set:function(a){this.canvas.width=a}},height:{get:function(){return this.canvas.height},set:function(a){this.canvas.height=a}}}),d.prototype.clear=function(){this.context.setTransform(1,0,0,1,0,0),this.context.clearRect(0,0,this.canvas.width,this.canvas.height)},d.prototype.resize=function(a,b){this.canvas.width=a,this.canvas.height=b},d.prototype.destroy=function(){this.context=null,this.canvas=null}},{}],42:[function(a,b,c){var d=a("../../../const"),e={};b.exports=e,e.renderGraphics=function(a,b){var c=a.worldAlpha;a.dirty&&(this.updateGraphicsTint(a),a.dirty=!1);for(var e=0;eB?B:A,b.beginPath(),b.moveTo(w,x+A),b.lineTo(w,x+z-A),b.quadraticCurveTo(w,x+z,w+A,x+z),b.lineTo(w+y-A,x+z),b.quadraticCurveTo(w+y,x+z,w+y,x+z-A),b.lineTo(w+y,x+A),b.quadraticCurveTo(w+y,x,w+y-A,x),b.lineTo(w+A,x),b.quadraticCurveTo(w,x,w,x+A),b.closePath(),(f.fillColor||0===f.fillColor)&&(b.globalAlpha=f.fillAlpha*c,b.fillStyle="#"+("00000"+(0|h).toString(16)).substr(-6),b.fill()),f.lineWidth&&(b.globalAlpha=f.lineAlpha*c,b.strokeStyle="#"+("00000"+(0|i).toString(16)).substr(-6),b.stroke())}}},e.renderGraphicsMask=function(a,b){var c=a.graphicsData.length;if(0!==c){b.beginPath();for(var e=0;c>e;e++){var f=a.graphicsData[e],g=f.shape;if(f.type===d.SHAPES.POLY){var h=g.points;b.moveTo(h[0],h[1]);for(var i=1;iz?z:y,b.moveTo(u,v+y),b.lineTo(u,v+x-y),b.quadraticCurveTo(u,v+x,u+y,v+x),b.lineTo(u+w-y,v+x),b.quadraticCurveTo(u+w,v+x,u+w,v+x-y),b.lineTo(u+w,v+y),b.quadraticCurveTo(u+w,v,u+w-y,v),b.lineTo(u+y,v),b.quadraticCurveTo(u,v,u,v+y),b.closePath()}}}},e.updateGraphicsTint=function(a){if(16777215!==a.tint)for(var b=(a.tint>>16&255)/255,c=(a.tint>>8&255)/255,d=(255&a.tint)/255,e=0;e>16&255)/255*b*255<<16)+((g>>8&255)/255*c*255<<8)+(255&g)/255*d*255,f._lineTint=((h>>16&255)/255*b*255<<16)+((h>>8&255)/255*c*255<<8)+(255&h)/255*d*255}}},{"../../../const":19}],43:[function(a,b,c){function d(){}var e=a("./CanvasGraphics");d.prototype.constructor=d,b.exports=d,d.prototype.pushMask=function(a,b){b.context.save();var c=a.alpha,d=a.worldTransform,f=b.resolution;b.context.setTransform(d.a*f,d.b*f,d.c*f,d.d*f,d.tx*f,d.ty*f),a.texture||(e.renderGraphicsMask(a,b.context),b.context.clip()),a.worldAlpha=c},d.prototype.popMask=function(a){a.context.restore()},d.prototype.destroy=function(){}},{"./CanvasGraphics":42}],44:[function(a,b,c){var d=a("../../../utils"),e={};b.exports=e,e.getTintedTexture=function(a,b){var c=a.texture;b=e.roundColor(b);var d="#"+("00000"+(0|b).toString(16)).substr(-6);if(c.tintCache=c.tintCache||{},c.tintCache[d])return c.tintCache[d];var f=e.canvas||document.createElement("canvas");if(e.tintMethod(c,b,f),e.convertTintToImage){var g=new Image;g.src=f.toDataURL(),c.tintCache[d]=g}else c.tintCache[d]=f,e.canvas=null;return f},e.tintWithMultiply=function(a,b,c){var d=c.getContext("2d"),e=a.crop;c.width=e.width,c.height=e.height,d.fillStyle="#"+("00000"+(0|b).toString(16)).substr(-6),d.fillRect(0,0,e.width,e.height),d.globalCompositeOperation="multiply",d.drawImage(a.baseTexture.source,e.x,e.y,e.width,e.height,0,0,e.width,e.height),d.globalCompositeOperation="destination-atop",d.drawImage(a.baseTexture.source,e.x,e.y,e.width,e.height,0,0,e.width,e.height)},e.tintWithOverlay=function(a,b,c){var d=c.getContext("2d"),e=a.crop;c.width=e.width,c.height=e.height,d.globalCompositeOperation="copy",d.fillStyle="#"+("00000"+(0|b).toString(16)).substr(-6),d.fillRect(0,0,e.width,e.height),d.globalCompositeOperation="destination-atop",d.drawImage(a.baseTexture.source,e.x,e.y,e.width,e.height,0,0,e.width,e.height)},e.tintWithPerPixel=function(a,b,c){var e=c.getContext("2d"),f=a.crop;c.width=f.width,c.height=f.height,e.globalCompositeOperation="copy",e.drawImage(a.baseTexture.source,f.x,f.y,f.width,f.height,0,0,f.width,f.height);for(var g=d.hex2rgb(b),h=g[0],i=g[1],j=g[2],k=e.getImageData(0,0,f.width,f.height),l=k.data,m=0;mb;++b)this.shaders[b].syncUniform(a)}},{"../shaders/TextureShader":58}],47:[function(a,b,c){function d(){e.call(this,"\nprecision mediump float;\n\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform vec2 resolution;\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\n\nvoid texcoords(vec2 fragCoord, vec2 resolution,\n out vec2 v_rgbNW, out vec2 v_rgbNE,\n out vec2 v_rgbSW, out vec2 v_rgbSE,\n out vec2 v_rgbM) {\n vec2 inverseVP = 1.0 / resolution.xy;\n v_rgbNW = (fragCoord + vec2(-1.0, -1.0)) * inverseVP;\n v_rgbNE = (fragCoord + vec2(1.0, -1.0)) * inverseVP;\n v_rgbSW = (fragCoord + vec2(-1.0, 1.0)) * inverseVP;\n v_rgbSE = (fragCoord + vec2(1.0, 1.0)) * inverseVP;\n v_rgbM = vec2(fragCoord * inverseVP);\n}\n\nvoid main(void){\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n vResolution = resolution;\n\n //compute the texture coords and send them to varyings\n texcoords(aTextureCoord * resolution, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n",'precision lowp float;\n\n\n/**\nBasic FXAA implementation based on the code on geeks3d.com with the\nmodification that the texture2DLod stuff was removed since it\'s\nunsupported by WebGL.\n\n--\n\nFrom:\nhttps://github.com/mitsuhiko/webgl-meincraft\n\nCopyright (c) 2011 by Armin Ronacher.\n\nSome rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n * Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the following\n disclaimer in the documentation and/or other materials provided\n with the distribution.\n\n * The names of the contributors may not be used to endorse or\n promote products derived from this software without specific\n prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n#ifndef FXAA_REDUCE_MIN\n #define FXAA_REDUCE_MIN (1.0/ 128.0)\n#endif\n#ifndef FXAA_REDUCE_MUL\n #define FXAA_REDUCE_MUL (1.0 / 8.0)\n#endif\n#ifndef FXAA_SPAN_MAX\n #define FXAA_SPAN_MAX 8.0\n#endif\n\n//optimized version for mobile, where dependent\n//texture reads can be a bottleneck\nvec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution,\n vec2 v_rgbNW, vec2 v_rgbNE,\n vec2 v_rgbSW, vec2 v_rgbSE,\n vec2 v_rgbM) {\n vec4 color;\n mediump vec2 inverseVP = vec2(1.0 / resolution.x, 1.0 / resolution.y);\n vec3 rgbNW = texture2D(tex, v_rgbNW).xyz;\n vec3 rgbNE = texture2D(tex, v_rgbNE).xyz;\n vec3 rgbSW = texture2D(tex, v_rgbSW).xyz;\n vec3 rgbSE = texture2D(tex, v_rgbSE).xyz;\n vec4 texColor = texture2D(tex, v_rgbM);\n vec3 rgbM = texColor.xyz;\n vec3 luma = vec3(0.299, 0.587, 0.114);\n float lumaNW = dot(rgbNW, luma);\n float lumaNE = dot(rgbNE, luma);\n float lumaSW = dot(rgbSW, luma);\n float lumaSE = dot(rgbSE, luma);\n float lumaM = dot(rgbM, luma);\n float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n mediump vec2 dir;\n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) *\n (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),\n max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),\n dir * rcpDirMin)) * inverseVP;\n\n vec3 rgbA = 0.5 * (\n texture2D(tex, fragCoord * inverseVP + dir * (1.0 / 3.0 - 0.5)).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * (2.0 / 3.0 - 0.5)).xyz);\n vec3 rgbB = rgbA * 0.5 + 0.25 * (\n texture2D(tex, fragCoord * inverseVP + dir * -0.5).xyz +\n texture2D(tex, fragCoord * inverseVP + dir * 0.5).xyz);\n\n float lumaB = dot(rgbB, luma);\n if ((lumaB < lumaMin) || (lumaB > lumaMax))\n color = vec4(rgbA, texColor.a);\n else\n color = vec4(rgbB, texColor.a);\n return color;\n}\n\n\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nvarying vec2 vResolution;\n\n//texcoords computed in vertex step\n//to avoid dependent texture reads\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform sampler2D uSampler;\n\n\nvoid main(void){\n\n gl_FragColor = fxaa(uSampler, vTextureCoord * vResolution, vResolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n}\n',{resolution:{type:"v2",value:{x:1,y:1}}})}var e=a("./AbstractFilter");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.prototype.applyFilter=function(a,b,c){var d=a.filterManager,e=this.getShader(a);d.applyFilter(e,b,c)}},{"./AbstractFilter":46}],48:[function(a,b,c){function d(a){var b=new f.Matrix;e.call(this,"attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 otherMatrix;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nvoid main(void)\n{\n gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vMaskCoord = ( otherMatrix * vec3( aTextureCoord, 1.0) ).xy;\n vColor = vec4(aColor.rgb * aColor.a, aColor.a);\n}\n","precision lowp float;\n\nvarying vec2 vMaskCoord;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform float alpha;\nuniform sampler2D mask;\n\nvoid main(void)\n{\n // check clip! this will stop the mask bleeding out from the edges\n vec2 text = abs( vMaskCoord - 0.5 );\n text = step(0.5, text);\n float clip = 1.0 - max(text.y, text.x);\n vec4 original = texture2D(uSampler, vTextureCoord);\n vec4 masky = texture2D(mask, vMaskCoord);\n original *= (masky.r * masky.a * alpha * clip);\n gl_FragColor = original;\n}\n",{mask:{type:"sampler2D",value:a._texture},alpha:{type:"f",value:1},otherMatrix:{type:"mat3",value:b.toArray(!0)}}),this.maskSprite=a,this.maskMatrix=b}var e=a("./AbstractFilter"),f=a("../../../math");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.prototype.applyFilter=function(a,b,c){var d=a.filterManager;this.uniforms.mask.value=this.maskSprite._texture,d.calculateMappedMatrix(b.frame,this.maskSprite,this.maskMatrix),this.uniforms.otherMatrix.value=this.maskMatrix.toArray(!0),this.uniforms.alpha.value=this.maskSprite.worldAlpha;var e=this.getShader(a);d.applyFilter(e,b,c)},Object.defineProperties(d.prototype,{map:{get:function(){return this.uniforms.mask.value},set:function(a){this.uniforms.mask.value=a}},offset:{get:function(){return this.uniforms.offset.value},set:function(a){this.uniforms.offset.value=a}}})},{"../../../math":29,"./AbstractFilter":46}],49:[function(a,b,c){function d(a){e.call(this,a),this.currentBlendMode=99999}var e=a("./WebGLManager");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.prototype.setBlendMode=function(a){if(this.currentBlendMode===a)return!1;this.currentBlendMode=a;var b=this.renderer.blendModes[this.currentBlendMode];return this.renderer.gl.blendFunc(b[0],b[1]),!0}},{"./WebGLManager":54}],50:[function(a,b,c){function d(a){e.call(this,a),this.filterStack=[],this.filterStack.push({renderTarget:a.currentRenderTarget,filter:[],bounds:null}),this.texturePool=[],this.textureSize=new i.Rectangle(0,0,a.width,a.height),this.currentFrame=null}var e=a("./WebGLManager"),f=a("../utils/RenderTarget"),g=a("../../../const"),h=a("../utils/Quad"),i=a("../../../math");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.prototype.onContextChange=function(){this.texturePool.length=0;var a=this.renderer.gl;this.quad=new h(a)},d.prototype.setFilterStack=function(a){this.filterStack=a},d.prototype.pushFilter=function(a,b){var c=a.filterArea?a.filterArea.clone():a.getBounds();c.x=0|c.x,c.y=0|c.y,c.width=0|c.width,c.height=0|c.height;var d=0|b[0].padding;if(c.x-=d,c.y-=d,c.width+=2*d,c.height+=2*d,this.renderer.currentRenderTarget.transform){var e=this.renderer.currentRenderTarget.transform;c.x+=e.tx,c.y+=e.ty,this.capFilterArea(c),c.x-=e.tx,c.y-=e.ty}else this.capFilterArea(c);if(c.width>0&&c.height>0){this.currentFrame=c;var f=this.getRenderTarget();this.renderer.setRenderTarget(f),f.clear(),this.filterStack.push({renderTarget:f,filter:b})}else this.filterStack.push({renderTarget:null,filter:b})},d.prototype.popFilter=function(){var a=this.filterStack.pop(),b=this.filterStack[this.filterStack.length-1],c=a.renderTarget;if(a.renderTarget){var d=b.renderTarget,e=this.renderer.gl;this.currentFrame=c.frame,this.quad.map(this.textureSize,c.frame),e.bindBuffer(e.ARRAY_BUFFER,this.quad.vertexBuffer),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,this.quad.indexBuffer);var f=a.filter;if(e.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aVertexPosition,2,e.FLOAT,!1,0,0),e.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aTextureCoord,2,e.FLOAT,!1,0,32),e.vertexAttribPointer(this.renderer.shaderManager.defaultShader.attributes.aColor,4,e.FLOAT,!1,0,64),this.renderer.blendModeManager.setBlendMode(g.BLEND_MODES.NORMAL),1===f.length)f[0].uniforms.dimensions&&(f[0].uniforms.dimensions.value[0]=this.renderer.width,f[0].uniforms.dimensions.value[1]=this.renderer.height,f[0].uniforms.dimensions.value[2]=this.quad.vertices[0],f[0].uniforms.dimensions.value[3]=this.quad.vertices[5]),f[0].applyFilter(this.renderer,c,d),this.returnRenderTarget(c);else{for(var h=c,i=this.getRenderTarget(!0),j=0;jthis.textureSize.width&&(a.width=this.textureSize.width-a.x),a.y+a.height>this.textureSize.height&&(a.height=this.textureSize.height-a.y)},d.prototype.resize=function(a,b){this.textureSize.width=a,this.textureSize.height=b;for(var c=0;cb;++b)a._array[2*b]=f[b].x,a._array[2*b+1]=f[b].y;g.uniform2fv(d,a._array);break;case"v3v":for(a._array||(a._array=new Float32Array(3*f.length)),b=0,c=f.length;c>b;++b)a._array[3*b]=f[b].x,a._array[3*b+1]=f[b].y,a._array[3*b+2]=f[b].z;g.uniform3fv(d,a._array);break;case"v4v":for(a._array||(a._array=new Float32Array(4*f.length)),b=0,c=f.length;c>b;++b)a._array[4*b]=f[b].x,a._array[4*b+1]=f[b].y,a._array[4*b+2]=f[b].z,a._array[4*b+3]=f[b].w;g.uniform4fv(d,a._array);break;case"t":case"sampler2D":if(!a.value||!a.value.baseTexture.hasLoaded)break;g.activeTexture(g["TEXTURE"+this.textureCount]);var h=a.value.baseTexture._glTextures[g.id];h||(this.initSampler2D(a),h=a.value.baseTexture._glTextures[g.id]),g.bindTexture(g.TEXTURE_2D,h),g.uniform1i(a._location,this.textureCount),this.textureCount++}},d.prototype.syncUniforms=function(){this.textureCount=1;for(var a in this.uniforms)this.syncUniform(this.uniforms[a])},d.prototype.initSampler2D=function(a){var b=this.gl,c=a.value.baseTexture;if(c.hasLoaded)if(a.textureData){var d=a.textureData;c._glTextures[b.id]=b.createTexture(),b.bindTexture(b.TEXTURE_2D,c._glTextures[b.id]),b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL,c.premultipliedAlpha),b.texImage2D(b.TEXTURE_2D,0,d.luminance?b.LUMINANCE:b.RGBA,b.RGBA,b.UNSIGNED_BYTE,c.source),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,d.magFilter?d.magFilter:b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,d.wrapS?d.wrapS:b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,d.wrapS?d.wrapS:b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,d.wrapT?d.wrapT:b.CLAMP_TO_EDGE)}else this.shaderManager.renderer.updateTexture(c)},d.prototype.destroy=function(){this.gl.deleteProgram(this.program),this.gl=null,this.uniforms=null,this.attributes=null,this.vertexSrc=null,this.fragmentSrc=null},d.prototype._glCompile=function(a,b){var c=this.gl.createShader(a);return this.gl.shaderSource(c,b),this.gl.compileShader(c),this.gl.getShaderParameter(c,this.gl.COMPILE_STATUS)?c:null}},{"../../../utils":73}],58:[function(a,b,c){function d(a,b,c,f,g){var h={uSampler:{type:"sampler2D",value:0},projectionMatrix:{type:"mat3",value:new Float32Array([1,0,0,0,1,0,0,0,1])}};if(f)for(var i in f)h[i]=f[i];var j={aVertexPosition:0,aTextureCoord:0,aColor:0};if(g)for(var k in g)j[k]=g[k];b=b||d.defaultVertexSrc,c=c||d.defaultFragmentSrc,e.call(this,a,b,c,h,j)}var e=a("./Shader");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.defaultVertexSrc=["precision lowp float;","attribute vec2 aVertexPosition;","attribute vec2 aTextureCoord;","attribute vec4 aColor;","uniform mat3 projectionMatrix;","varying vec2 vTextureCoord;","varying vec4 vColor;","void main(void){"," gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0);"," vTextureCoord = aTextureCoord;"," vColor = vec4(aColor.rgb * aColor.a, aColor.a);","}"].join("\n"),d.defaultFragmentSrc=["precision lowp float;","varying vec2 vTextureCoord;","varying vec4 vColor;","uniform sampler2D uSampler;","void main(void){"," gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;","}"].join("\n")},{"./Shader":57}],59:[function(a,b,c){function d(a){e.call(this,a)}var e=a("../managers/WebGLManager");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.prototype.start=function(){},d.prototype.stop=function(){this.flush()},d.prototype.flush=function(){},d.prototype.render=function(a){}},{"../managers/WebGLManager":54}],60:[function(a,b,c){function d(a){this.gl=a,this.vertices=new Float32Array([0,0,200,0,200,200,0,200]),this.uvs=new Float32Array([0,0,1,0,1,1,0,1]),this.colors=new Float32Array([1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]),this.indices=new Uint16Array([0,1,2,0,3,2]),this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,128,a.DYNAMIC_DRAW),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),this.upload()}d.prototype.constructor=d,d.prototype.map=function(a,b){var c=0,d=0;this.uvs[0]=c,this.uvs[1]=d,this.uvs[2]=c+b.width/a.width,this.uvs[3]=d,this.uvs[4]=c+b.width/a.width,this.uvs[5]=d+b.height/a.height,this.uvs[6]=c,this.uvs[7]=d+b.height/a.height,c=b.x,d=b.y,this.vertices[0]=c,this.vertices[1]=d,this.vertices[2]=c+b.width,this.vertices[3]=d,this.vertices[4]=c+b.width,this.vertices[5]=d+b.height,this.vertices[6]=c,this.vertices[7]=d+b.height,this.upload()},d.prototype.upload=function(){var a=this.gl;a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferSubData(a.ARRAY_BUFFER,0,this.vertices),a.bufferSubData(a.ARRAY_BUFFER,32,this.uvs),a.bufferSubData(a.ARRAY_BUFFER,64,this.colors)},b.exports=d},{}],61:[function(a,b,c){var d=a("../../../math"),e=a("../../../utils"),f=a("../../../const"),g=a("./StencilMaskStack"),h=function(a,b,c,h,i,j){if(this.gl=a,this.frameBuffer=null,this.texture=null,this.size=new d.Rectangle(0,0,1,1),this.resolution=i||f.RESOLUTION,this.projectionMatrix=new d.Matrix,this.transform=null,this.frame=null,this.stencilBuffer=null,this.stencilMaskStack=new g,this.filterStack=[{renderTarget:this,filter:[],bounds:this.size}],this.scaleMode=h||f.SCALE_MODES.DEFAULT,this.root=j,!this.root){this.frameBuffer=a.createFramebuffer(),this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,h===f.SCALE_MODES.LINEAR?a.LINEAR:a.NEAREST),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,h===f.SCALE_MODES.LINEAR?a.LINEAR:a.NEAREST);var k=e.isPowerOfTwo(b,c);k?(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT)):(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE)),a.bindFramebuffer(a.FRAMEBUFFER,this.frameBuffer),a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,this.texture,0)}this.resize(b,c)};h.prototype.constructor=h,b.exports=h,h.prototype.clear=function(a){var b=this.gl;a&&b.bindFramebuffer(b.FRAMEBUFFER,this.frameBuffer),b.clearColor(0,0,0,0),b.clear(b.COLOR_BUFFER_BIT)},h.prototype.attachStencilBuffer=function(){if(!this.stencilBuffer&&!this.root){var a=this.gl;this.stencilBuffer=a.createRenderbuffer(),a.bindRenderbuffer(a.RENDERBUFFER,this.stencilBuffer),a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,this.stencilBuffer),a.renderbufferStorage(a.RENDERBUFFER,a.DEPTH_STENCIL,this.size.width*this.resolution,this.size.height*this.resolution)}},h.prototype.activate=function(){var a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,this.frameBuffer);var b=this.frame||this.size;this.calculateProjection(b),this.transform&&this.projectionMatrix.append(this.transform),a.viewport(0,0,b.width*this.resolution,b.height*this.resolution)},h.prototype.calculateProjection=function(a){var b=this.projectionMatrix;b.identity(),this.root?(b.a=1/a.width*2,b.d=-1/a.height*2,b.tx=-1-a.x*b.a,b.ty=1-a.y*b.d):(b.a=1/a.width*2,b.d=1/a.height*2,b.tx=-1-a.x*b.a,b.ty=-1-a.y*b.d)},h.prototype.resize=function(a,b){if(a=0|a,b=0|b,this.size.width!==a||this.size.height!==b){if(this.size.width=a,this.size.height=b,!this.root){var c=this.gl;c.bindTexture(c.TEXTURE_2D,this.texture),c.texImage2D(c.TEXTURE_2D,0,c.RGBA,a*this.resolution,b*this.resolution,0,c.RGBA,c.UNSIGNED_BYTE,null),this.stencilBuffer&&(c.bindRenderbuffer(c.RENDERBUFFER,this.stencilBuffer),c.renderbufferStorage(c.RENDERBUFFER,c.DEPTH_STENCIL,a*this.resolution,b*this.resolution))}var d=this.frame||this.size;this.calculateProjection(d)}},h.prototype.destroy=function(){var a=this.gl;a.deleteFramebuffer(this.frameBuffer),a.deleteTexture(this.texture),this.frameBuffer=null,this.texture=null}},{"../../../const":19,"../../../math":29,"../../../utils":73,"./StencilMaskStack":62}],62:[function(a,b,c){function d(){this.stencilStack=[],this.reverse=!0,this.count=0}d.prototype.constructor=d,b.exports=d},{}],63:[function(a,b,c){function d(a){g.call(this),this.anchor=new e.Point,this._texture=null,this._width=0,this._height=0,this.tint=16777215,this.blendMode=j.BLEND_MODES.NORMAL,this.shader=null,this.cachedTint=16777215,this.texture=a||f.EMPTY}var e=a("../math"),f=a("../textures/Texture"),g=a("../display/Container"),h=a("../renderers/canvas/utils/CanvasTinter"),i=a("../utils"),j=a("../const"),k=new e.Point;d.prototype=Object.create(g.prototype),d.prototype.constructor=d,b.exports=d,Object.defineProperties(d.prototype,{width:{get:function(){return this.scale.x*this.texture._frame.width},set:function(a){this.scale.x=a/this.texture._frame.width,this._width=a}},height:{get:function(){return this.scale.y*this.texture._frame.height},set:function(a){this.scale.y=a/this.texture._frame.height,this._height=a}},texture:{get:function(){return this._texture},set:function(a){this._texture!==a&&(this._texture=a,this.cachedTint=16777215,a&&(a.baseTexture.hasLoaded?this._onTextureUpdate():a.once("update",this._onTextureUpdate,this)))}}}),d.prototype._onTextureUpdate=function(){this._width&&(this.scale.x=this._width/this.texture.frame.width),this._height&&(this.scale.y=this._height/this.texture.frame.height)},d.prototype._renderWebGL=function(a){a.setObjectRenderer(a.plugins.sprite),a.plugins.sprite.render(this)},d.prototype.getBounds=function(a){if(!this._currentBounds){var b,c,d,e,f=this._texture._frame.width,g=this._texture._frame.height,h=f*(1-this.anchor.x),i=f*-this.anchor.x,j=g*(1-this.anchor.y),k=g*-this.anchor.y,l=a||this.worldTransform,m=l.a,n=l.b,o=l.c,p=l.d,q=l.tx,r=l.ty;if(0===n&&0===o)0>m&&(m*=-1),0>p&&(p*=-1),b=m*i+q,c=m*h+q,d=p*k+r,e=p*j+r;else{var s=m*i+o*k+q,t=p*k+n*i+r,u=m*h+o*k+q,v=p*k+n*h+r,w=m*h+o*j+q,x=p*j+n*h+r,y=m*i+o*j+q,z=p*j+n*i+r;b=s,b=b>u?u:b,b=b>w?w:b,b=b>y?y:b,d=t,d=d>v?v:d,d=d>x?x:d,d=d>z?z:d,c=s,c=u>c?u:c,c=w>c?w:c,c=y>c?y:c,e=t,e=v>e?v:e,e=x>e?x:e,e=z>e?z:e}if(this.children.length){var A=this.containerGetBounds();h=A.x,i=A.x+A.width,j=A.y,k=A.y+A.height,b=h>b?b:h,d=j>d?d:j,c=c>i?c:i,e=e>k?e:k}var B=this._bounds;B.x=b,B.width=c-b,B.y=d,B.height=e-d,this._currentBounds=B}return this._currentBounds},d.prototype.getLocalBounds=function(){return this._bounds.x=-this._texture._frame.width*this.anchor.x,this._bounds.y=-this._texture._frame.height*this.anchor.y,this._bounds.width=this._texture._frame.width,this._bounds.height=this._texture._frame.height,this._bounds},d.prototype.containsPoint=function(a){this.worldTransform.applyInverse(a,k);var b,c=this._texture._frame.width,d=this._texture._frame.height,e=-c*this.anchor.x;return k.x>e&&k.xb&&k.yd;d+=6,f+=4)this.indices[d+0]=f+0,this.indices[d+1]=f+1,this.indices[d+2]=f+2,this.indices[d+3]=f+0,this.indices[d+4]=f+2,this.indices[d+5]=f+3;this.currentBatchSize=0,this.sprites=[],this.shader=null}var e=a("../../renderers/webgl/utils/ObjectRenderer"),f=a("../../renderers/webgl/WebGLRenderer"),g=a("../../const");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,f.registerPlugin("sprite",d),d.prototype.onContextChange=function(){var a=this.renderer.gl;this.shader=this.renderer.shaderManager.defaultShader,this.vertexBuffer=a.createBuffer(),this.indexBuffer=a.createBuffer(),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer),a.bufferData(a.ELEMENT_ARRAY_BUFFER,this.indices,a.STATIC_DRAW),a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bufferData(a.ARRAY_BUFFER,this.vertices,a.DYNAMIC_DRAW),this.currentBlendMode=99999},d.prototype.render=function(a){var b=a._texture;this.currentBatchSize>=this.size&&this.flush();var c=b._uvs;if(c){var d,e,f,g,h=a.anchor.x,i=a.anchor.y;if(b.trim){var j=b.trim;e=j.x-h*j.width,d=e+b.crop.width,g=j.y-i*j.height,f=g+b.crop.height}else d=b._frame.width*(1-h),e=b._frame.width*-h,f=b._frame.height*(1-i),g=b._frame.height*-i;var k=this.currentBatchSize*this.vertByteSize,l=a.worldTransform,m=l.a,n=l.b,o=l.c,p=l.d,q=l.tx,r=l.ty,s=this.colors,t=this.positions;this.renderer.roundPixels?(t[k]=m*e+o*g+q|0,t[k+1]=p*g+n*e+r|0,t[k+5]=m*d+o*g+q|0,t[k+6]=p*g+n*d+r|0,t[k+10]=m*d+o*f+q|0,t[k+11]=p*f+n*d+r|0,t[k+15]=m*e+o*f+q|0,t[k+16]=p*f+n*e+r|0):(t[k]=m*e+o*g+q,t[k+1]=p*g+n*e+r,t[k+5]=m*d+o*g+q,t[k+6]=p*g+n*d+r,t[k+10]=m*d+o*f+q,t[k+11]=p*f+n*d+r,t[k+15]=m*e+o*f+q,t[k+16]=p*f+n*e+r),t[k+2]=c.x0,t[k+3]=c.y0,t[k+7]=c.x1,t[k+8]=c.y1,t[k+12]=c.x2,t[k+13]=c.y2,t[k+17]=c.x3,t[k+18]=c.y3;var u=a.tint;s[k+4]=s[k+9]=s[k+14]=s[k+19]=(u>>16)+(65280&u)+((255&u)<<16)+(255*a.worldAlpha<<24),this.sprites[this.currentBatchSize++]=a}},d.prototype.flush=function(){if(0!==this.currentBatchSize){var a,b=this.renderer.gl;if(this.currentBatchSize>.5*this.size)b.bufferSubData(b.ARRAY_BUFFER,0,this.vertices);else{var c=this.positions.subarray(0,this.currentBatchSize*this.vertByteSize);b.bufferSubData(b.ARRAY_BUFFER,0,c)}for(var d,e,f,g,h=0,i=0,j=null,k=this.renderer.blendModeManager.currentBlendMode,l=null,m=!1,n=!1,o=0,p=this.currentBatchSize;p>o;o++)g=this.sprites[o],d=g._texture.baseTexture,e=g.blendMode,f=g.shader||this.shader,m=k!==e,n=l!==f,(j!==d||m||n)&&(this.renderBatch(j,h,i),i=o,h=0,j=d,m&&(k=e,this.renderer.blendModeManager.setBlendMode(k)),n&&(l=f,a=l.shaders?l.shaders[b.id]:l,a||(a=l.getShader(this.renderer)),this.renderer.shaderManager.setShader(a),a.uniforms.projectionMatrix.value=this.renderer.currentRenderTarget.projectionMatrix.toArray(!0),a.syncUniforms(),b.activeTexture(b.TEXTURE0))),h++;this.renderBatch(j,h,i),this.currentBatchSize=0}},d.prototype.renderBatch=function(a,b,c){if(0!==b){var d=this.renderer.gl;a._glTextures[d.id]?d.bindTexture(d.TEXTURE_2D,a._glTextures[d.id]):this.renderer.updateTexture(a),d.drawElements(d.TRIANGLES,6*b,d.UNSIGNED_SHORT,6*c*2),this.renderer.drawCount++}},d.prototype.start=function(){var a=this.renderer.gl;a.bindBuffer(a.ARRAY_BUFFER,this.vertexBuffer),a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,this.indexBuffer);var b=this.vertByteSize;a.vertexAttribPointer(this.shader.attributes.aVertexPosition,2,a.FLOAT,!1,b,0),a.vertexAttribPointer(this.shader.attributes.aTextureCoord,2,a.FLOAT,!1,b,8),a.vertexAttribPointer(this.shader.attributes.aColor,4,a.UNSIGNED_BYTE,!0,b,16)},d.prototype.destroy=function(){this.renderer.gl.deleteBuffer(this.vertexBuffer),this.renderer.gl.deleteBuffer(this.indexBuffer),this.shader.destroy(),this.renderer=null,this.vertices=null,this.positions=null,this.colors=null,this.indices=null,this.vertexBuffer=null,this.indexBuffer=null,this.sprites=null,this.shader=null}},{"../../const":19,"../../renderers/webgl/WebGLRenderer":45,"../../renderers/webgl/utils/ObjectRenderer":59}],65:[function(a,b,c){function d(a,b,c){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),this.resolution=c||i.RESOLUTION,this._text=null,this._style=null;var d=f.fromCanvas(this.canvas);d.trim=new g.Rectangle,e.call(this,d),this.text=a,this.style=b}var e=a("../sprites/Sprite"),f=a("../textures/Texture"),g=a("../math"),h=a("../utils"),i=a("../const");d.prototype=Object.create(e.prototype),d.prototype.constructor=d,b.exports=d,d.fontPropertiesCache={},d.fontPropertiesCanvas=document.createElement("canvas"),d.fontPropertiesContext=d.fontPropertiesCanvas.getContext("2d"),Object.defineProperties(d.prototype,{width:{get:function(){return this.dirty&&this.updateText(),this.scale.x*this._texture._frame.width},set:function(a){this.scale.x=a/this._texture._frame.width,this._width=a}},height:{get:function(){return this.dirty&&this.updateText(),this.scale.y*this._texture._frame.height},set:function(a){this.scale.y=a/this._texture._frame.height,this._height=a}},style:{get:function(){return this._style},set:function(a){a=a||{},"number"==typeof a.fill&&(a.fill=h.hex2string(a.fill)),"number"==typeof a.stroke&&(a.stroke=h.hex2string(a.stroke)),"number"==typeof a.dropShadowColor&&(a.dropShadowColor=h.hex2string(a.dropShadowColor)),a.font=a.font||"bold 20pt Arial",a.fill=a.fill||"black",a.align=a.align||"left",a.stroke=a.stroke||"black",a.strokeThickness=a.strokeThickness||0,a.wordWrap=a.wordWrap||!1,a.wordWrapWidth=a.wordWrapWidth||100,a.dropShadow=a.dropShadow||!1,a.dropShadowColor=a.dropShadowColor||"#000000",a.dropShadowAngle=a.dropShadowAngle||Math.PI/6,a.dropShadowDistance=a.dropShadowDistance||5, diff --git a/samples/events/Main.hx b/samples/events/Main.hx index 1ae1b01a..8d84eeb5 100644 --- a/samples/events/Main.hx +++ b/samples/events/Main.hx @@ -1,5 +1,6 @@ package samples.events; +import pixi.core.math.shapes.Rectangle; import pixi.interaction.EventTarget; import pixi.core.text.Text; import pixi.plugins.app.Application; @@ -24,10 +25,13 @@ class Main extends Application { _img.anchor.set(0.5, 0.5); _img.position.set(400, 300); _img.interactive = true; - _img.on("click", _onEvent); + _img.scale.set(3); _img.on("mouseover", _onEvent); - _img.on("mousedown", _onEvent); _img.on("touchstart", _onEvent); + _img.tap = _onEvent; + _img.click = _onEvent; + + _img.hitArea = new Rectangle(0, 0, 10, 10); _stage.addChild(_img); var style:TextStyle = {};